配置网卡的方法
1、vim /etc/sysconfig/network-scripts/ifcfg-eno1677728
systemctl restart network
2、nmtui
3、nm-connection-editor
允许放行 ACCEPT
拒绝 REJECT
拒绝 DROP
日志 LOG
iptables -L 列出所有规则
iptables -F 清空匹配规则
iptables -A 写到规则后面
iptables -P INPUT DROP 修改匹配规则
iptables -I INPUT -s 192.168.10.1/24 -p tcp --dport 22 -j ACCEPT 插入匹配规则前面
iptables -D INPUT 2 删除策略 第二条
从上往下匹配 匹配到就会结束
禁止端口号
--dport 22
--dport 22:80
[root@linuxprobe ~]# iptables -I INPUT -p tcp --dport 12345 -j REJECT
[root@linuxprobe ~]# iptables -A INPUT -p tcp --dport 1000:1024 -j REJECT