您的位置:首页 > 理论基础 > 计算机网络

linux网络故障解决方法

2014-09-22 16:22 316 查看
1、linux本机能否访问httpd服务,判断linux本机能否访问www服务
wget http://localhost/index.html 
2、远程客户端能否连接上,判断linux端口是否可以访问
telnet 192.168.10.10 80
能否远程telnet  登陆80端口,对应的服务器ip地址是192.168.10.10

3、IPTABLES 防火墙是否有限制

允许任何IP脚本:
iptables -I INPUT -p TCP --dport 80 -j ACCEPT


禁止任何IP脚本:

iptables -I INPUT -p TCP --dport 80 -j DROP


限制特定IP脚本:

iptables -I INPUT -s 192.168.1.18 -p TCP --dport 80 -j DROP


关键/开启防火墙命令centos7.0 用的命令跟之前版本不一致

# systemctl stop firewalld
# systemctl disable firewalld

# iptables-service

# touch /etc/sysconfig/iptables
# systemctl start iptables
# systemctl enable iptables

# touch /etc/sysconfig/ip6tables
# systemctl start ip6tables
# systemctl enable ip6table


可以参考 redhat 官网:

Chapter 3. The Apache HTTP Server

https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Managing_Confined_Services/chap-Managing_Confined_Services-The_Apache_HTTP_Server.html

网卡的几个关键位置

1、

vim /etc/udev/rules.d/70-persistent-net.rules




2、

cd  /etc/sysconfig/network-scripts
vim ifcfg-eth0
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: