您的位置:首页 > 其它

ubuntu网卡配置

2012-08-10 17:42 260 查看
1、dhcp自动获取

sudo vi /etc/network/interfaces

auto eth0

iface eth0 inet dhcp
设置生效:
sudo /etc/init.d/networking restart

sudo dhclient eth0

2、静态IP地址

sudo vi /etc/network/interfaces
auto eth0

iface eth0 inet static

address 192.168.3.90
netmask 255.255.255.0

gateway 192.168.3.1
设置生效:
sudo /etc/init.d/networking restart

3、虚拟IP地址

sudo vi /etc/network/interfaces
添加:
auto eth0:1

iface eth0:1 inet static

address 192.168.1.60

netmask 255.255.255.0

gateway 192.168.1.1
设置生效:
sudo /etc/init.d/networking restart本文出自 “notepad” 博客,请务必保留此出处http://sndapk.blog.51cto.com/5385144/960507
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: