1.ubuntu网络配置

网络配置文件/etc/network/interfaces

 auto lo

iface lo inet loopback

auto eth0

iface eth0 inet static

address 192.168.1.2

netmask 255.255.255.0

gateway 192.168.1.1

 

    address关键字指定IP地址
    netmask指定子网掩码
    gateway指定网关

重新启动网络以使其生效:
sudo /etc/init.d/networking restart

posted @ 2012-06-18 17:02  为了这有限的生命  阅读(125)  评论(0编辑  收藏  举报