linux7.2释放端口,centos7.2放行80端口

在CentOS7.2的环境中,通过`systemctl status firewalld.service`检查firewalld状态,发现已启动并运行。接着使用`firewall-cmd`命令添加了HTTP服务和80端口,并通过`--permanent`参数使其永久生效。最后,通过`firewall-cmd --reload`重新加载防火墙规则,确认设置成功。
摘要由CSDN通过智能技术生成

[root@localhost bin]# systemctl status firewalld.service

● firewalld.service - firewalld - dynamic firewall daemon

Loaded: loaded (/usr/lib/systemd/system/firewalld.service; enabled; vendor preset: enabled)

Active: active (running) since 三 2020-01-29 03:28:08 PST; 20min ago

Docs: man:firewalld(1)

Main PID: 507 (firewalld)

CGroup: /system.slice/firewalld.service

└─507 /usr/bin/python2 -Es /usr/sbin/firewalld --nofork --nopid

1月 29 03:28:09 localhost.localdomain firewalld[507]: WARNING: COMMAND_FAILED: '/usr/sbin/iptables -w10 -w --table filter --delete FORWARD --destination 192.168.122.0/24 --out-interface virbr0 --match conntrack --ctstate ...in that chain?).

1月 29 03:28:09 localhost.localdomain firewalld[507]: WARNING: COMMAND_FAILED: '/usr/sbin/iptables -w10 -w --table filter --delete FORWARD --source 192.168.122.0/24 --in-interface virbr0 --jump ACCEPT' failed: iptables: B...in that chain?).

1月 29 03:28:09 localhost.localdomain firewalld[507]: WARNING: COMMAND_FAILED: '/usr/sbin/iptables -w10 -w --table filter --delete FORWARD --in-interface virbr0 --out-interface virbr0 --jump ACCEPT' failed: iptables: Bad ...in that chain?).

1月 29 03:28:09 localhost.localdomain firewalld[507]: WARNING: COMMAND_FAILED: '/usr/sbin/iptables -w10 -w --table filter --delete FORWARD --out-interface virbr0 --jump REJECT' failed: iptables: No chain/target/match by that name.

1月 29 03:28:09 localhost.localdomain firewalld[507]: WARNING: COMMAND_FAILED: '/usr/sbin/iptables -w10 -w --table filter --delete FORWARD --in-interface virbr0 --jump REJECT' failed: iptables: No chain/target/match by that name.

1月 29 03:28:09 localhost.localdomain firewalld[507]: WARNING: COMMAND_FAILED: '/usr/sbin/iptables -w10 -w --table filter --delete INPUT --in-interface virbr0 --protocol udp --destination-port 53 --jump ACCEPT' failed: ip...in that chain?).

1月 29 03:28:09 localhost.localdomain firewalld[507]: WARNING: COMMAND_FAILED: '/usr/sbin/iptables -w10 -w --table filter --delete INPUT --in-interface virbr0 --protocol tcp --destination-port 53 --jump ACCEPT' failed: ip...in that chain?).

1月 29 03:28:09 localhost.localdomain firewalld[507]: WARNING: COMMAND_FAILED: '/usr/sbin/iptables -w10 -w --table filter --delete OUTPUT --out-interface virbr0 --protocol udp --destination-port 68 --jump ACCEPT' failed: ...in that chain?).

1月 29 03:28:09 localhost.localdomain firewalld[507]: WARNING: COMMAND_FAILED: '/usr/sbin/iptables -w10 -w --table filter --delete INPUT --in-interface virbr0 --protocol udp --destination-port 67 --jump ACCEPT' failed: ip...in that chain?).

1月 29 03:28:09 localhost.localdomain firewalld[507]: WARNING: COMMAND_FAILED: '/usr/sbin/iptables -w10 -w --table filter --delete INPUT --in-interface virbr0 --protocol tcp --destination-port 67 --jump ACCEPT' failed: ip...in that chain?).

Hint: Some lines were ellipsized, use -l to show in full.

[root@localhost bin]# sudo firewall-cmd --list-all

public (active)

target: default

icmp-block-inversion: no

interfaces: eno16777736

sources:

services: dhcpv6-client ssh

ports:

protocols:

masquerade: no

forward-ports:

source-ports:

icmp-blocks:

rich rules:

[root@localhost bin]# sudo firewall-cmd --add-service=http --permanent

success

[root@localhost bin]# sudo firewall-cmd --add-port=80/tcp --permanent

success

[root@localhost bin]# sudo firewall-cmd --reload

success

[root@localhost bin]# sudo firewall-cmd --list-all

public (active)

target: default

icmp-block-inversion: no

interfaces: eno16777736

sources:

services: dhcpv6-client http ssh

ports: 80/tcp

protocols:

masquerade: no

forward-ports:

source-ports:

icmp-blocks:

rich rules:

[root@localhost bin]#

标签:iptables,28,端口,firewalld,usr,507,centos7.2,80,localhost

来源: https://www.cnblogs.com/michaelcnblogs/p/12241109.html

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值