linux上不了網(wǎng)
關閉防火墻
1) 重啟后生效
開啟: chkconfig iptables on 關閉: chkconfig iptables off
2) 即時生效,重啟后失效
開啟: service iptables start
關閉: service iptables stop
1、檢查當前環(huán)境配置的IP信息
2、檢查網(wǎng)絡配置是否正確
[root@hadoop/]# cat /etc/sysconfig/network-scripts/ifcfg-eth0
DECIVE=eth0 //指向的網(wǎng)絡配置文件 IPADDR=192.168.1.226 //IP地址 GATEWAY=192.168.1.1 //網(wǎng)關地址 DNS1=8.8.8.8 //DNS解析服務器 NETMASK=255.255.255.0 //子網(wǎng)掩碼
3、ping一下設置的網(wǎng)關是否能夠ping通,如果網(wǎng)關無法連通,則需要修改 /etc/sysconfig/network-scripts/ifcfg-eth0文件下的網(wǎng)關地 址
[root@hadoop/]# ping 192.168.1.1
4、檢查DNS服務器是否正確,使用命令
[root@hadoop etc]# cat resolv.conf
5、ping配置的DNS服務解析地址,看是否能夠ping通,如果無法連通,則需要修改,但必須保證是正常的能使用的DNS地址
6、只有上述配置都無誤后,就可以連通外網(wǎng)資源,再進行測試,是否能ping通外網(wǎng)資源
[root@hadoop etc]# ping www.baidu.com
推薦:linux運維教程