**IP地址配置,最簡單的一種
在命令運(yùn)行 setup,帶提示,按照提示修改即可
1.修改主機(jī)名
vi /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=server1.itcast.cn
2.修改ip地址
vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
TYPE=Ethernet
ONBOOT=yes #是否開機(jī)啟用
BOOTPROTO=static #ip地址設(shè)置為靜態(tài)
IPADDR=192.168.0.101
NETMASK=255.255.255.0
service network restart
3.修改ip地址和主機(jī)名的映射關(guān)系
vi /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.0.101 server1.itcast.cn
4.關(guān)閉iptables并設(shè)置其開機(jī)啟動/不啟動
service iptables stop
chkconfig iptables on
chkconfig iptables off