linux 网络配置

自己在ubuntu的环境下配置过可以用

为网卡配置静态IP地址
sudo gedit /etc/network/interfaces

auto eth0
iface eth0 inet static
address 192.168.1.33
gateway 192.168.1.1
netmask 255.255.255.0

#network 192.168.1.0
#broadcast 192.168.1.255

 


设置主机名称(hostname) --可选
查看当前主机的主机名称:
sudo /bin/hostname

设置当前主机的主机名称:
sudo /bin/hostname newname
系统启动时,它会从/etc/hostname来读取主机的名称.

配置DNS
sudo gedit /etc/resolv.conf
# Generated by NetworkManager
nameserver 219.141.136.10

 

 

sudo /etc/init.d/networking restart

转载自:http://www.iteye.com/topic/314848

 

;