ubuntu静态网络配置

版权声明:本文为博主原创文章,遵循 CC 4.0 by-sa 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/g_r_u_b/article/details/7624758

//配置静态IP,子网掩码,网关
sudo vi /etc/network/interfaces

auto lo
iface lo inet loopback
auto eth0
iface eth0 inet static
address 211.80.61.54
netmask 255.255.255.0
gateway 211.80.61.254

//配置NDS
sudo vi /etc/resolv.conf

# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
#     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 202.120.2.100
nameserver 202.120.2.101

//防止resolv.conf被overwritten
sudo vi /etc/resolvconf/resolv.conf.d/base

nameserver 202.120.2.100
nameserver 202.120.2.101

//克隆mac地址

sudo ifconfig eth0 down
sudo ifconfig eth0 hw ether xx:xx:xx:xx:xx:xx
sudo ifconfig eth0 up

//重启网络
sudo /etc/init.d/networking restart

//卸载network-manager
sudo apt-get remove network_manager

//重启
sudo reboot


展开阅读全文

没有更多推荐了,返回首页