nftables

[root@evpn2 ~]# yum install -y nftables
Repository base is listed more than once in the configuration
CentOS-8 - Updates           24  B/s |  38  B     00:01    
Failed to synchronize cache for repo 'updates', ignoring this repo.
Last metadata expiration check: 0:41:40 ago on Fri 20 Mar 2020 09:42:20 PM CST.
Package nftables-1:0.9.0-8.el8.aarch64 is already installed.
Dependencies resolved.
Nothing to do.
Complete!
[root@evpn2 ~]# iptables -t nat -F
[root@evpn2 ~]# nft add table nat
[root@evpn2 ~]# nft add chain nat prerouting { type nat hook prerouting priority 0 \; }
[root@evpn2 ~]# nft add chain nat postrouting { type nat hook postrouting priority 100 \; }
[root@evpn2 ~]# nft add rule nat postrouting oifname default_g1  counter masquerade
[root@evpn2 ~]# nft add rule nat postrouting oifname enp1s0 -j MASQUERADE
Error: syntax error, unexpected newline
add rule nat postrouting oifname enp1s0 MASQUERADE
                                                  ^
[root@evpn2 ~]# nft add rule nat postrouting oifname enp1s0 counter masquerade

猜你喜欢

转载自www.cnblogs.com/dream397/p/12535407.html