关于能ping通ip 端口却不能访问的问题--网络防火墙问题

先明确iptables和UFW之间的关系才行...

iptables是后端数据库,纪录着所有是否允许端口的信息 可用如下命令查看 

iptables -L

UFW是上述数据库的前端,提供友好的,很显然很不友好.... 

iptables

Iptables is the database of firewall rules and is the actual firewall used in Linux systems. The traditional interface for configuring iptables in Linux systems is the command-line interface terminal. The other utilities in this section simplify the manipulation of the iptables database. 

UFW

UFW (Uncomplicated Firewall) is a front-end for iptables and is particularly well-suited for host-based firewalls. UFW was developed specifically for Ubuntu (but is available in other distributions), and is also configured from the terminal. 

Gufw is a graphical front-end to UFW, and is recommended for beginners.

UFW was introduced in Ubuntu 8.04 LTS (Hardy Heron), and is available by default in all Ubuntu installations after 8.04 LTS.

Guarddog

Guarddog is a front-end for iptables that functions in KDE-based desktops, such as Kubuntu. It has a greater deal of complexity (and flexibility, perhaps).

解决方法

只需要在iptables中加上相应的规则即可

(此处有坑)

iptables -A 和 iptables -I 命令是不同的 ,需要以如下命令添加才可行

iptables -I INPUT -p tcp --dport 21 -j ACCEPT
//即为开放tcp 21端口

 

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值