Linux操作系统下修改IP.DNS和路由配置

06-21

在Linux操作系统下修改IP、DNS和路由配置ifconfig eth0 新ip然后编辑/etc/sysconfig/network-scripts/ifcfg-eth0,修改ip一、修改IP地址[aeolus@db1 network-scripts]$ vi ifcfg-eth0DEVICE=eth0ONBOOT=yesBOOTPROTO=staticIPADDR=219.136.241.211NETMASK=255.255.255.128GATEWAY=219.136.241.254二、修改网关vi /etc/sysconfig/networkNETWORKING=yesHOSTNAME=AaronGATEWAY=192.168.1.1三、修改DNS[aeolus@db1 etc]$ vi resolv.confnameserver 202.96.128.68nameserver 219.136.241.206四、重新启动网络配置/etc/init.d/network restart修改ip地址即时生效:# ifconfig eth0 192.168.0.20 netmask 255.255.255.0启动生效:修改/etc/sysconfig/network-scripts/ifcfg-eth0修改default gateway即时生效:# route add default gw 192.168.0.254启动生效:修改/etc/sysconfig/network-scripts/ifcfg-eth0修改dns修改/etc/resolv.conf修改后可即时生效,启动同样有效修改host name即时生效:# hostname fc2启动生效:修改/etc/sysconfig/network