【原创】centos 打开防火墙端…
来源:互联网 发布:卖衣服的淘宝店 编辑:程序博客网 时间:2024/06/05 23:07
自己写了一个服务(10.20.30.10:9000),另一台机器访问的时候访问不到。
2. sudo service iptablesstop
curl : (7) couldn't connect tohost
wget:Connectingto 10.20.30.10:9000... failed: No route tohost.
python:IOError: [Errno socket error][Errno 113] No route to host
------------
经了解,是centos防火墙的原因。解决方法:
sudo vi/etc/sysconfig/iptables
加上一句:-A INPUT -p tcp -m tcp --dport9000 -j ACCEPT 或者 -A INPUT -p tcp -m state--state NEW -m tcp --dport 9000 -j ACCEPT
保存退出后,sudo service iptables restart
1. sudo service iptables start
3. sudo service iptablesrestart
[zhangzhipeng@localhost test]$ sudo service iptablesrestart
iptables: Setting chains to policy ACCEPT: filter [ OK ]
iptables: Flushing firewall rules: [ OK ]
iptables: Unloading modules: [ OK ]
iptables: Applying firewall rules: [ OK ]
4. sudo service iptablesstatus
[zhangzhipeng@localhost test]$ sudo service iptablesstatus
Table: filter
Chain INPUT (policy ACCEPT)
num target prot opt source destination
1 ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcpdpt:9000
2 ACCEPT all -- 0.0.0.0/0 0.0.0.0/0 stateRELATED,ESTABLISHED
3 ACCEPT icmp -- 0.0.0.0/0 0.0.0.0/0
4 ACCEPT all -- 0.0.0.0/0 0.0.0.0/0
5 ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 state NEWtcp dpt:22
6 REJECT all -- 0.0.0.0/0 0.0.0.0/0 reject-with icmp-host-prohibited
Chain FORWARD (policy ACCEPT)
num target prot opt source destination
1 REJECT all -- 0.0.0.0/0 0.0.0.0/0 reject-with icmp-host-prohibited
Chain OUTPUT (policy ACCEPT)
num target prot opt source destination
0 0
- 【原创】centos 打开防火墙端…
- centos 5.6 打开防火墙
- Centos打开关闭防火墙
- 【原创】centos python2.6.6&…
- CENTOS 设置文件夹打开方式:…
- centos 打开or关闭防火墙
- CentOS 启动防火墙打开端口
- centos 打开80端口防火墙
- CentOS 7防火墙问题,永久给…
- 【原创】Fedora17 快捷键打开终端
- CentOS防火墙中打开指定的端口
- Linux CentOS 防火墙 端口 操作 打开 关闭
- CentOS防火墙打开和关闭端口
- Cisco asa5510 防火墙限…
- 【开机动画】原创 - 熊…
- 【开机动画】原创 - 熊…
- 【开机动画】原创 - 熊…
- 【开机动画】原创 - 熊…
- 【原创】Python PyQuery&nbsp…
- 【原创】linux zip 只压…
- 关于java多线程
- 【原创】python Reuqests&nbs…
- 【原创】centos python2.6.6&…
- 【原创】centos 打开防火墙端…
- huchi's mysql扫盲笔记
- 【原创】 下载 安装 bootstrap
- 【原创】VIM 快捷键大全&nbsp…
- matlab 常用集合相关的函数
- 【转载+总结】Python 干货
- 对StrongReference,WeakReference,SoftReference和PhantomReference的认识
- 【原创】python修改文件某行的内容
- 【转载】python -- 15个…