Linux基本网络配置

shell>vi /etc/sysconfig/network-scripts/ifcfg-eth0
 
静态:
DEVICE=eth0
BOOTPROTO=static
IPADDR=192.168.1.2
NETMASK=255.255.255.0
GETEWAY=192.168.1.1
ONBOOT=yes
TYPE=Ethernet
动态:
DEVICE=eth0
BOOTPROTO=dhcp
ONBOOT=yes
TYPE=Ethernet
配置DNS
shell>vi /etc/resolv.conf
nameserver 202.99.166.4
 
配置主机名:
shell>vi /etc/sysconfig/network
networking=yes
hostname=linux-test
 
shell>/etc/rc.d/initd.d/network restart

你可能感兴趣的:(linux,ifcfg-eth0,eth0,休闲,网络配置)