当前位置:Linux教程 - Linux综合 - 修改机器名和Ip

修改机器名和Ip

  用vi编辑 /etc/sysconfig/network and /etc/sysconfig/network-scripts/ifcfg-eth01) /etc/sysconfig/networkNETWORKING = yesFORWARD_IPV4 = yesHOSTNAME = xxxx.com #你的主机名GATEWAY = 123.123.123.123 #网关GATEWAYDEV = eth02) /etc/sysconfig/network-scripts/ifcfg-eth0DEVICE = eth0IPADDR = xxx.xxx.xxx.xxx #你的IP地址NETMASK = xxx.xxx.xxx.xxx #你的子网掩码NETWORK = xxx.xxx.xxx.xxx #你的工作网络BROADCAST = xxx.xxx.xxx.xxx #你的广播址ONBOOT = yes然后运行 /etc/sysconfig/network-scripts/ifup eth0 启动。

(出处:http://www.sheup.com)