存档

‘Linux’ 分类的存档

ubuntu 网络配置

2009年3月15日 没有评论

在家里的一个虚拟机使用的是ubuntu 系统,从vmplanet.net 下的. 里面的网络经常是有时候有,有时候没有,有时候你重启一次又有了. 完全让人摸不着头脑. 网上google 了一下,配置一下ubuntu的网络.

首先用ifconfig 看一下网络设置:

在 /etc/network/interfaces 文件里 原先的配置是
auto lo
iface lo inet lookback

然后参照别人的改成
auto eth1
iface eth1 inet dhcp
其中配置的eth1 就是网卡接口,在ifconfig 里面显示的, dhcp 就是动态获得的ip. 如果要静态指定的话就是:
auto eth0
iface eth0 inet static
address 192.168.1.110
gateway 192.168.1.1
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255

然后用/etc/init.d/networking restart   重启网络连接.
同样也可以配置第二个ip 或则虚拟ip
auto eth0:1
iface eth0:1 inet static
address 192.168.1.60
netmask 255.255.255.0
network x.x.x.x
broadcast x.x.x.x
gateway x.x.x.x

参考资料

http://www.ubuntugeek.com/ubuntu-networking-configuration-using-command-line.html

ubuntu 的网络配置

http://www.chineselinuxuniversity.net/courses/using/introductions/6867.shtml

red hat 的网络配置

分类: Linux 标签: