设置静态IP、主机名 1. /etc/sysconfig/network [root@hadoop ~]# vi /etc/sysconfig/network NETWORKING=yes 2. /etc/sysconfig/network-scripts/ifcfg-eth0 [root@hadoop ~]# vi /etc/sysconfig/network-scripts/ifcfg-eth0 DEVICE="eth0" #引导使用的协议:无协议 | 静态 | bootp | dhcp HWADDR="00:0C:29:6F:B6:BE" #MAC地址 #引导是否激活设备: 是 | 否 DNS1="8.8.8.8" #域名解析服务器(没配) 3. /etc/hosts [root@hadoop ~]# vi /etc/hosts 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
--------- 可略过 ------- /etc/resolv.conf [root@hadoop ~]# vi /etc/resolv.conf search hadoop nameserver 8.8.8.8 #DNS域名解析服务器 ------------------------ 4. 应用变更 [root@hadoop ~]# ifdown eht0 [root@hadoop ~]# ifup eht0 #这两个操作只能在本机进行,远程操作无反应 [root@hadoop ~]# service network restart #重启网络服务 5. 重启 [root@hadoop ~]# reboot -h 0 或 shutdown -r 0 关闭防火墙: [root@hadoop ~]# service iptables status #查看防火墙状态 [root@hadoop ~]# service iptables stop #关闭防火墙 [root@hadoop ~]# chkconfig iptables off #关闭防火墙自启动 [root@hadoop ~]# chkconfig --list|grep iptables #查看防火墙状态 全off,即操作成功 |
|