Closed jiangcuo closed 1 year ago
pve-firewall compile
root@pve2:~# pve-firewall compile
ipset cmdlist:
exists PVEFW-0-management-v4 (j8O39qcq8i0yNRpysdeI42h3zNI)
create PVEFW-0-management-v4 hash:net family inet hashsize 64 maxelem 64 bucketsize 12
add PVEFW-0-management-v4 10.13.14.0/24
exists PVEFW-0-management-v6 (6g+lzHFoCegXcweHRfBY4vRsbOc)
create PVEFW-0-management-v6 hash:net family inet6 hashsize 64 maxelem 64 bucketsize 12
iptables cmdlist:
exists PVEFW-Drop (83WlR/a4wLbmURFqMQT3uJSgIG8)
-A PVEFW-Drop -j PVEFW-DropBroadcast
-A PVEFW-Drop -p icmp -m icmp --icmp-type fragmentation-needed -j ACCEPT
-A PVEFW-Drop -p icmp -m icmp --icmp-type time-exceeded -j ACCEPT
-A PVEFW-Drop -m conntrack --ctstate INVALID -j DROP
-A PVEFW-Drop -p udp --match multiport --dports 135,445 -j DROP
-A PVEFW-Drop -p udp --dport 137:139 -j DROP
-A PVEFW-Drop -p udp --sport 137 --dport 1024:65535 -j DROP
-A PVEFW-Drop -p tcp --match multiport --dports 135,139,445 -j DROP
-A PVEFW-Drop -p udp --dport 1900 -j DROP
-A PVEFW-Drop -p tcp -m tcp ! --tcp-flags FIN,SYN,RST,ACK SYN -j DROP
-A PVEFW-Drop -p udp --sport 53 -j DROP
exists PVEFW-DropBroadcast (NyjHNAtFbkH7WGLamPpdVnxHy4w)
-A PVEFW-DropBroadcast -m addrtype --dst-type BROADCAST -j DROP
-A PVEFW-DropBroadcast -m addrtype --dst-type MULTICAST -j DROP
-A PVEFW-DropBroadcast -m addrtype --dst-type ANYCAST -j DROP
-A PVEFW-DropBroadcast -d 224.0.0.0/4 -j DROP
exists PVEFW-FORWARD (qnNexOcGa+y+jebd4dAUqFSp5nw)
-A PVEFW-FORWARD -m conntrack --ctstate INVALID -j DROP
-A PVEFW-FORWARD -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
-A PVEFW-FORWARD -m physdev --physdev-is-bridged --physdev-in fwln+ -j PVEFW-FWBR-IN
-A PVEFW-FORWARD -m physdev --physdev-is-bridged --physdev-out fwln+ -j PVEFW-FWBR-OUT
exists PVEFW-FWBR-IN (wiWVRhS8/LKvniz+c5HbbSZvh7Q)
-A PVEFW-FWBR-IN -m conntrack --ctstate INVALID,NEW -j PVEFW-smurfs
-A PVEFW-FWBR-IN -m physdev --physdev-is-bridged --physdev-out veth801i0 -j veth801i0-IN
exists PVEFW-FWBR-OUT (Rp6VMTxc1JlnbhOFPEexNKRsg2k)
-A PVEFW-FWBR-OUT -m physdev --physdev-is-bridged --physdev-in veth801i0 -j veth801i0-OUT
exists PVEFW-HOST-IN (7qUG7NLALEEQ4kmQyphqfgk3gRU)
-A PVEFW-HOST-IN -i lo -j ACCEPT
-A PVEFW-HOST-IN -m conntrack --ctstate INVALID -j DROP
-A PVEFW-HOST-IN -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
-A PVEFW-HOST-IN -m conntrack --ctstate INVALID,NEW -j PVEFW-smurfs
-A PVEFW-HOST-IN -p igmp -j RETURN
-A PVEFW-HOST-IN -p icmp -m icmp --icmp-type any -j RETURN
-A PVEFW-HOST-IN -m set --match-set PVEFW-0-management-v4 src -p tcp --dport 8006 -j RETURN
-A PVEFW-HOST-IN -m set --match-set PVEFW-0-management-v4 src -p tcp --dport 5900:5999 -j RETURN
-A PVEFW-HOST-IN -m set --match-set PVEFW-0-management-v4 src -p tcp --dport 3128 -j RETURN
-A PVEFW-HOST-IN -m set --match-set PVEFW-0-management-v4 src -p tcp --dport 22 -j RETURN
-A PVEFW-HOST-IN -m set --match-set PVEFW-0-management-v4 src -p tcp --dport 60000:60050 -j RETURN
-A PVEFW-HOST-IN -d 10.13.14.2 -s 10.13.14.1 -p udp --dport 5404:5405 -j RETURN
-A PVEFW-HOST-IN -d 10.13.14.2 -s 10.13.14.3 -p udp --dport 5404:5405 -j RETURN
-A PVEFW-HOST-IN -d 10.13.14.2 -s 10.13.14.4 -p udp --dport 5404:5405 -j RETURN
-A PVEFW-HOST-IN -j PVEFW-Reject
-A PVEFW-HOST-IN -m limit --limit 1/sec -j NFLOG --nflog-prefix ":0:7:PVEFW-HOST-IN: policy REJECT: "
-A PVEFW-HOST-IN -g PVEFW-reject
exists PVEFW-HOST-OUT (/ea45QRsMYvZjzNCQQo+8XQ0zn8)
-A PVEFW-HOST-OUT -o lo -j ACCEPT
-A PVEFW-HOST-OUT -m conntrack --ctstate INVALID -j DROP
-A PVEFW-HOST-OUT -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
-A PVEFW-HOST-OUT -p igmp -j RETURN
-A PVEFW-HOST-OUT -d 10.13.14.0/24 -p tcp --dport 8006 -j RETURN
-A PVEFW-HOST-OUT -d 10.13.14.0/24 -p tcp --dport 22 -j RETURN
-A PVEFW-HOST-OUT -d 10.13.14.0/24 -p tcp --dport 5900:5999 -j RETURN
-A PVEFW-HOST-OUT -d 10.13.14.0/24 -p tcp --dport 3128 -j RETURN
-A PVEFW-HOST-OUT -s 10.13.14.2 -d 10.13.14.1 -p udp --dport 5404:5405 -j RETURN
-A PVEFW-HOST-OUT -s 10.13.14.2 -d 10.13.14.3 -p udp --dport 5404:5405 -j RETURN
-A PVEFW-HOST-OUT -s 10.13.14.2 -d 10.13.14.4 -p udp --dport 5404:5405 -j RETURN
-A PVEFW-HOST-OUT -j RETURN
exists PVEFW-INPUT (+5iMmLaxKXynOB/+5xibfx7WhFk)
-A PVEFW-INPUT -j PVEFW-HOST-IN
exists PVEFW-OUTPUT (LjHoZeSSiWAG3+2ZAyL/xuEehd0)
-A PVEFW-OUTPUT -j PVEFW-HOST-OUT
exists PVEFW-Reject (h3DyALVslgH5hutETfixGP08w7c)
-A PVEFW-Reject -j PVEFW-DropBroadcast
-A PVEFW-Reject -p icmp -m icmp --icmp-type fragmentation-needed -j ACCEPT
-A PVEFW-Reject -p icmp -m icmp --icmp-type time-exceeded -j ACCEPT
-A PVEFW-Reject -m conntrack --ctstate INVALID -j DROP
-A PVEFW-Reject -p udp --match multiport --dports 135,445 -j PVEFW-reject
-A PVEFW-Reject -p udp --dport 137:139 -j PVEFW-reject
-A PVEFW-Reject -p udp --sport 137 --dport 1024:65535 -j PVEFW-reject
-A PVEFW-Reject -p tcp --match multiport --dports 135,139,445 -j PVEFW-reject
-A PVEFW-Reject -p udp --dport 1900 -j DROP
-A PVEFW-Reject -p tcp -m tcp ! --tcp-flags FIN,SYN,RST,ACK SYN -j DROP
-A PVEFW-Reject -p udp --sport 53 -j DROP
exists PVEFW-SET-ACCEPT-MARK (Hg/OIgIwJChBUcWU8Xnjhdd2jUY)
-A PVEFW-SET-ACCEPT-MARK -j MARK --set-mark 0x80000000/0x80000000
exists PVEFW-logflags (HC8CEuX2HT92HaS+8/71UerEnag)
-A PVEFW-logflags -m limit --limit 1/sec -j NFLOG --nflog-prefix ":0:7:PVEFW-logflags: DROP: "
-A PVEFW-logflags -j DROP
exists PVEFW-reject (Jlkrtle1mDdtxDeI9QaDSL++Npc)
-A PVEFW-reject -m addrtype --dst-type BROADCAST -j DROP
-A PVEFW-reject -s 224.0.0.0/4 -j DROP
-A PVEFW-reject -p icmp -j DROP
-A PVEFW-reject -p tcp -j REJECT --reject-with tcp-reset
-A PVEFW-reject -p udp -j REJECT --reject-with icmp-port-unreachable
-A PVEFW-reject -p icmp -j REJECT --reject-with icmp-host-unreachable
-A PVEFW-reject -j REJECT --reject-with icmp-host-prohibited
exists PVEFW-smurflog (ehR9MsiJdo/7X3yNWp9nxAhhZDA)
-A PVEFW-smurflog -m limit --limit 1/sec -j NFLOG --nflog-prefix ":0:7:PVEFW-smurflog: DROP: "
-A PVEFW-smurflog -j DROP
exists PVEFW-smurfs (HssVe5QCBXd5mc9kC88749+7fag)
-A PVEFW-smurfs -s 0.0.0.0/32 -j RETURN
-A PVEFW-smurfs -m addrtype --src-type BROADCAST -g PVEFW-smurflog
-A PVEFW-smurfs -s 224.0.0.0/4 -g PVEFW-smurflog
exists PVEFW-tcpflags (CMFojwNPqllyqD67NeI5m+bP5mo)
-A PVEFW-tcpflags -p tcp -m tcp --tcp-flags FIN,SYN,RST,PSH,ACK,URG FIN,PSH,URG -g PVEFW-logflags
-A PVEFW-tcpflags -p tcp -m tcp --tcp-flags FIN,SYN,RST,PSH,ACK,URG NONE -g PVEFW-logflags
-A PVEFW-tcpflags -p tcp -m tcp --tcp-flags SYN,RST SYN,RST -g PVEFW-logflags
-A PVEFW-tcpflags -p tcp -m tcp --tcp-flags FIN,SYN FIN,SYN -g PVEFW-logflags
-A PVEFW-tcpflags -p tcp -m tcp --sport 0 --tcp-flags FIN,SYN,RST,ACK SYN -g PVEFW-logflags
exists veth801i0-IN (BsU3g3/Sg6xfqpVBxS+UmZaOBeI)
-A veth801i0-IN -p udp --sport 67 --dport 68 -j ACCEPT
-A veth801i0-IN -j ACCEPT
-A veth801i0-IN -j PVEFW-Drop
-A veth801i0-IN -m limit --limit 1/sec -j NFLOG --nflog-prefix ":801:7:veth801i0-IN: policy DROP: "
-A veth801i0-IN -j DROP
exists veth801i0-OUT (7M1pxdAtWpAFV51o2YEJdtdoItI)
-A veth801i0-OUT -p udp --sport 68 --dport 67 -g PVEFW-SET-ACCEPT-MARK
-A veth801i0-OUT -m mac ! --mac-source AC:BD:EF:67:8D:9B -j DROP
-A veth801i0-OUT -j MARK --set-mark 0x00000000/0x80000000
-A veth801i0-OUT -g PVEFW-SET-ACCEPT-MARK
ip6tables cmdlist:
exists PVEFW-Drop (Jb79Uw7z1vZglIcV7QXA5uY/nbk)
-A PVEFW-Drop -p tcp --dport 43 -j PVEFW-reject
-A PVEFW-Drop -j PVEFW-DropBroadcast
-A PVEFW-Drop -p icmpv6 -m icmpv6 --icmpv6-type destination-unreachable -j ACCEPT
-A PVEFW-Drop -p icmpv6 -m icmpv6 --icmpv6-type time-exceeded -j ACCEPT
-A PVEFW-Drop -p icmpv6 -m icmpv6 --icmpv6-type packet-too-big -j ACCEPT
-A PVEFW-Drop -m conntrack --ctstate INVALID -j DROP
-A PVEFW-Drop -p udp --match multiport --dports 135,445 -j DROP
-A PVEFW-Drop -p udp --dport 137:139 -j DROP
-A PVEFW-Drop -p udp --sport 137 --dport 1024:65535 -j DROP
-A PVEFW-Drop -p tcp --match multiport --dports 135,139,445 -j DROP
-A PVEFW-Drop -p udp --dport 1900 -j DROP
-A PVEFW-Drop -p tcp -m tcp ! --tcp-flags FIN,SYN,RST,ACK SYN -j DROP
-A PVEFW-Drop -p udp --sport 53 -j DROP
exists PVEFW-DropBroadcast (8Krk5Nh8pDZOOc7BQAbM6PlyFSU)
-A PVEFW-DropBroadcast -d ff00::/8 -j DROP
exists PVEFW-FORWARD (qnNexOcGa+y+jebd4dAUqFSp5nw)
-A PVEFW-FORWARD -m conntrack --ctstate INVALID -j DROP
-A PVEFW-FORWARD -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
-A PVEFW-FORWARD -m physdev --physdev-is-bridged --physdev-in fwln+ -j PVEFW-FWBR-IN
-A PVEFW-FORWARD -m physdev --physdev-is-bridged --physdev-out fwln+ -j PVEFW-FWBR-OUT
exists PVEFW-FWBR-IN (ZUxWDqbMi/uHc6Jwz2SMABCHHUA)
-A PVEFW-FWBR-IN -m physdev --physdev-is-bridged --physdev-out veth801i0 -j veth801i0-IN
exists PVEFW-FWBR-OUT (Rp6VMTxc1JlnbhOFPEexNKRsg2k)
-A PVEFW-FWBR-OUT -m physdev --physdev-is-bridged --physdev-in veth801i0 -j veth801i0-OUT
exists PVEFW-HOST-IN (kNDHa3oHu3YIE0QhP8Wmp0ouGdo)
-A PVEFW-HOST-IN -i lo -j ACCEPT
-A PVEFW-HOST-IN -m conntrack --ctstate INVALID -j DROP
-A PVEFW-HOST-IN -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
-A PVEFW-HOST-IN -p icmpv6 --icmpv6-type router-solicitation -j RETURN
-A PVEFW-HOST-IN -p icmpv6 --icmpv6-type router-advertisement -j RETURN
-A PVEFW-HOST-IN -p icmpv6 --icmpv6-type neighbor-solicitation -j RETURN
-A PVEFW-HOST-IN -p icmpv6 --icmpv6-type neighbor-advertisement -j RETURN
-A PVEFW-HOST-IN -p igmp -j RETURN
-A PVEFW-HOST-IN -m set --match-set PVEFW-0-management-v6 src -p tcp --dport 8006 -j RETURN
-A PVEFW-HOST-IN -m set --match-set PVEFW-0-management-v6 src -p tcp --dport 5900:5999 -j RETURN
-A PVEFW-HOST-IN -m set --match-set PVEFW-0-management-v6 src -p tcp --dport 3128 -j RETURN
-A PVEFW-HOST-IN -m set --match-set PVEFW-0-management-v6 src -p tcp --dport 22 -j RETURN
-A PVEFW-HOST-IN -m set --match-set PVEFW-0-management-v6 src -p tcp --dport 60000:60050 -j RETURN
-A PVEFW-HOST-IN -j PVEFW-Reject
-A PVEFW-HOST-IN -m limit --limit 1/sec -j NFLOG --nflog-prefix ":0:7:PVEFW-HOST-IN: policy REJECT: "
-A PVEFW-HOST-IN -g PVEFW-reject
exists PVEFW-HOST-OUT (br2bPbA9ZjuHOMNhV8tfLRw1mAs)
-A PVEFW-HOST-OUT -o lo -j ACCEPT
-A PVEFW-HOST-OUT -m conntrack --ctstate INVALID -j DROP
-A PVEFW-HOST-OUT -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
-A PVEFW-HOST-OUT -p icmpv6 --icmpv6-type router-solicitation -j RETURN
-A PVEFW-HOST-OUT -p icmpv6 --icmpv6-type neighbor-solicitation -j RETURN
-A PVEFW-HOST-OUT -p icmpv6 --icmpv6-type neighbor-advertisement -j RETURN
-A PVEFW-HOST-OUT -p igmp -j RETURN
-A PVEFW-HOST-OUT -j RETURN
exists PVEFW-INPUT (+5iMmLaxKXynOB/+5xibfx7WhFk)
-A PVEFW-INPUT -j PVEFW-HOST-IN
exists PVEFW-OUTPUT (LjHoZeSSiWAG3+2ZAyL/xuEehd0)
-A PVEFW-OUTPUT -j PVEFW-HOST-OUT
exists PVEFW-Reject (aL1nrxJk/u3XmTb3Am2eaM/3yCM)
-A PVEFW-Reject -p tcp --dport 43 -j PVEFW-reject
-A PVEFW-Reject -j PVEFW-DropBroadcast
-A PVEFW-Reject -p icmpv6 -m icmpv6 --icmpv6-type destination-unreachable -j ACCEPT
-A PVEFW-Reject -p icmpv6 -m icmpv6 --icmpv6-type time-exceeded -j ACCEPT
-A PVEFW-Reject -p icmpv6 -m icmpv6 --icmpv6-type packet-too-big -j ACCEPT
-A PVEFW-Reject -m conntrack --ctstate INVALID -j DROP
-A PVEFW-Reject -p udp --match multiport --dports 135,445 -j PVEFW-reject
-A PVEFW-Reject -p udp --dport 137:139 -j PVEFW-reject
-A PVEFW-Reject -p udp --sport 137 --dport 1024:65535 -j PVEFW-reject
-A PVEFW-Reject -p tcp --match multiport --dports 135,139,445 -j PVEFW-reject
-A PVEFW-Reject -p udp --dport 1900 -j DROP
-A PVEFW-Reject -p tcp -m tcp ! --tcp-flags FIN,SYN,RST,ACK SYN -j DROP
-A PVEFW-Reject -p udp --sport 53 -j DROP
exists PVEFW-SET-ACCEPT-MARK (Hg/OIgIwJChBUcWU8Xnjhdd2jUY)
-A PVEFW-SET-ACCEPT-MARK -j MARK --set-mark 0x80000000/0x80000000
exists PVEFW-logflags (HC8CEuX2HT92HaS+8/71UerEnag)
-A PVEFW-logflags -m limit --limit 1/sec -j NFLOG --nflog-prefix ":0:7:PVEFW-logflags: DROP: "
-A PVEFW-logflags -j DROP
exists PVEFW-reject (etEECUYcgUdzuuO+LDP83pu0S8Y)
-A PVEFW-reject -p icmpv6 -j DROP
-A PVEFW-reject -p tcp -j REJECT --reject-with tcp-reset
-A PVEFW-reject -p udp -j REJECT --reject-with icmp6-port-unreachable
-A PVEFW-reject -j REJECT --reject-with icmp6-adm-prohibited
exists PVEFW-tcpflags (CMFojwNPqllyqD67NeI5m+bP5mo)
-A PVEFW-tcpflags -p tcp -m tcp --tcp-flags FIN,SYN,RST,PSH,ACK,URG FIN,PSH,URG -g PVEFW-logflags
-A PVEFW-tcpflags -p tcp -m tcp --tcp-flags FIN,SYN,RST,PSH,ACK,URG NONE -g PVEFW-logflags
-A PVEFW-tcpflags -p tcp -m tcp --tcp-flags SYN,RST SYN,RST -g PVEFW-logflags
-A PVEFW-tcpflags -p tcp -m tcp --tcp-flags FIN,SYN FIN,SYN -g PVEFW-logflags
-A PVEFW-tcpflags -p tcp -m tcp --sport 0 --tcp-flags FIN,SYN,RST,ACK SYN -g PVEFW-logflags
exists veth801i0-IN (eylwMreuhYN0bIIU+41u39WF9Ic)
-A veth801i0-IN -p udp --sport 547 --dport 546 -j ACCEPT
-A veth801i0-IN -p icmpv6 --icmpv6-type router-solicitation -j ACCEPT
-A veth801i0-IN -p icmpv6 --icmpv6-type router-advertisement -j ACCEPT
-A veth801i0-IN -p icmpv6 --icmpv6-type neighbor-solicitation -j ACCEPT
-A veth801i0-IN -p icmpv6 --icmpv6-type neighbor-advertisement -j ACCEPT
-A veth801i0-IN -j ACCEPT
-A veth801i0-IN -j PVEFW-Drop
-A veth801i0-IN -m limit --limit 1/sec -j NFLOG --nflog-prefix ":801:7:veth801i0-IN: policy DROP: "
-A veth801i0-IN -j DROP
exists veth801i0-OUT (fCGi7gkcSjFv08/JlJQ68WwTcNA)
-A veth801i0-OUT -p udp --sport 546 --dport 547 -g PVEFW-SET-ACCEPT-MARK
-A veth801i0-OUT -m mac ! --mac-source AC:BD:EF:67:8D:9B -j DROP
-A veth801i0-OUT -p icmpv6 --icmpv6-type router-advertisement -j DROP
-A veth801i0-OUT -j MARK --set-mark 0x00000000/0x80000000
-A veth801i0-OUT -p icmpv6 --icmpv6-type router-solicitation -g PVEFW-SET-ACCEPT-MARK
-A veth801i0-OUT -p icmpv6 --icmpv6-type neighbor-solicitation -g PVEFW-SET-ACCEPT-MARK
-A veth801i0-OUT -p icmpv6 --icmpv6-type neighbor-advertisement -g PVEFW-SET-ACCEPT-MARK
-A veth801i0-OUT -g PVEFW-SET-ACCEPT-MARK
ebtables cmdlist:
create PVEFW-FORWARD (ULtZ6lqjrD/jAKLY+OZo3BbXs9k)
-A PVEFW-FORWARD -p IPv4 -j ACCEPT
-A PVEFW-FORWARD -p IPv6 -j ACCEPT
-A PVEFW-FORWARD -o fwln+ -j PVEFW-FWBR-OUT
create PVEFW-FWBR-OUT (Oz3wY23V6zPYkpJgslECLMiUJUQ)
-A PVEFW-FWBR-OUT -i veth801i0 -j veth801i0-OUT
create veth801i0-OUT (AZWuRqAw8jxvVxHB09krHwL4Y1Y)
-A veth801i0-OUT -s ! ac:bd:ef:67:8d:9b -j DROP
-A veth801i0-OUT -j ACCEPT
iptables table raw cmdlist:
ip6tables table raw cmdlist:
detected changes
lsmod
root@pve2:~# lsmod
Module Size Used by
bpfilter 16384 0
crct10dif_ce 16384 1
ipmi_devintf 20480 0
ipmi_msghandler 65536 1 ipmi_devintf
cppc_cpufreq 20480 0
zfs 3035136 6
zunicode 335872 1 zfs
zzstd 450560 1 zfs
zlua 159744 1 zfs
zcommon 90112 1 zfs
znvpair 106496 2 zfs,zcommon
zavl 20480 1 zfs
icp 237568 1 zfs
spl 106496 6 zfs,icp,zzstd,znvpair,zcommon,zavl
drm 557056 0
fuse 131072 5
dm_mod 131072 7
dax 36864 1 dm_mod
nvme 49152 1
nvme_core 94208 2 nvme
root@pve2:~# sysctl -a|grep bridge
net.bridge.bridge-nf-call-arptables = 0
net.bridge.bridge-nf-call-ip6tables = 1
net.bridge.bridge-nf-call-iptables = 1
net.bridge.bridge-nf-filter-pppoe-tagged = 0
net.bridge.bridge-nf-filter-vlan-tagged = 0
net.bridge.bridge-nf-pass-vlan-input-dev = 0
root@pve2:~# pct config 801
arch: arm64
cmode: console
cores: 1
hostname: proxy
memory: 1024
net0: name=eth0,bridge=vmbr0,firewall=1,gw=10.13.14.254,hwaddr=AC:BD:EF:67:8D:9B,ip=10.13.14.11/24,ip6=auto,type=veth
onboot: 1
ostype: ubuntu
rootfs: local:801/vm-801-disk-0.raw,size=5G
swap: 0
action1: apt autoremove docker.io && reboot
result: working.
iptable -L