You are not logged in.
I am using nftables as the firewall for my home openvpn server, and all rules are defined and working correctly.
The problem is, every time I reboot the server, the vpn stops working and I have to change the default FORWARD policy to make it work with:
# iptables -P FORWARD ACCEPT# iptables -vL
Chain INPUT (policy ACCEPT 1953 packets, 185K bytes)
 pkts bytes target     prot opt in     out     source               destination
Chain FORWARD (policy DROP 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination
    0     0 DOCKER-USER  all  --  any    any     anywhere             anywhere
    0     0 DOCKER-ISOLATION-STAGE-1  all  --  any    any     anywhere             anywhere
    0     0 ACCEPT     all  --  any    docker0  anywhere             anywhere             ctstate RELATED,ESTABLISHED
    0     0 DOCKER     all  --  any    docker0  anywhere             anywhere
    0     0 ACCEPT     all  --  docker0 !docker0  anywhere             anywhere
    0     0 ACCEPT     all  --  docker0 docker0  anywhere             anywhere
Chain OUTPUT (policy ACCEPT 1736 packets, 179K bytes)
 pkts bytes target     prot opt in     out     source               destination
Chain DOCKER (1 references)
 pkts bytes target     prot opt in     out     source               destination
    0     0 ACCEPT     tcp  --  !docker0 docker0  anywhere             172.17.0.2           tcp dpt:http
Chain DOCKER-ISOLATION-STAGE-1 (1 references)
 pkts bytes target     prot opt in     out     source               destination
    0     0 DOCKER-ISOLATION-STAGE-2  all  --  docker0 !docker0  anywhere             anywhere
    0     0 RETURN     all  --  any    any     anywhere             anywhere
Chain DOCKER-ISOLATION-STAGE-2 (1 references)
 pkts bytes target     prot opt in     out     source               destination
    0     0 DROP       all  --  any    docker0  anywhere             anywhere
    0     0 RETURN     all  --  any    any     anywhere             anywhere
Chain DOCKER-USER (1 references)
 pkts bytes target     prot opt in     out     source               destination
    0     0 RETURN     all  --  any    any     anywhere             anywhere# iptables -vL -t nat
Chain PREROUTING (policy ACCEPT 261 packets, 34811 bytes)
 pkts bytes target     prot opt in     out     source               destination
  218 27489 DOCKER     all  --  any    any     anywhere             anywhere             ADDRTYPE match dst-type LOCAL
Chain INPUT (policy ACCEPT 39 packets, 6623 bytes)
 pkts bytes target     prot opt in     out     source               destination
Chain OUTPUT (policy ACCEPT 9 packets, 548 bytes)
 pkts bytes target     prot opt in     out     source               destination
    0     0 DOCKER     all  --  any    any     anywhere            !127.0.0.0/8          ADDRTYPE match dst-type LOCAL
Chain POSTROUTING (policy ACCEPT 9 packets, 548 bytes)
 pkts bytes target     prot opt in     out     source               destination
    0     0 MASQUERADE  all  --  any    !docker0  172.17.0.0/16        anywhere
    0     0 MASQUERADE  tcp  --  any    any     172.17.0.2           172.17.0.2           tcp dpt:http
Chain DOCKER (2 references)
 pkts bytes target     prot opt in     out     source               destination
    0     0 RETURN     all  --  docker0 any     anywhere             anywhere
    0     0 DNAT       tcp  --  !docker0 any     anywhere             anywhere             tcp dpt:sunproxyadmin to:172.17.0.2:80I cannot find where this -P FORWARD DROP rule is coming from, here are the places I have looked:
# bat /etc/iptables/*
───────┬───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
       │ File: /etc/iptables/empty.rules
───────┼───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
   1   │ # Empty iptables rule file
   2   │ *filter
   3   │ :INPUT ACCEPT [0:0]
   4   │ :FORWARD ACCEPT [0:0]
   5   │ :OUTPUT ACCEPT [0:0]
   6   │ COMMIT
───────┴───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
───────┬───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
       │ File: /etc/iptables/ip6tables.rules
───────┼───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
   1   │ # Empty iptables rule file
   2   │ *filter
   3   │ :INPUT ACCEPT [0:0]
   4   │ :FORWARD ACCEPT [0:0]
   5   │ :OUTPUT ACCEPT [0:0]
   6   │ COMMIT
───────┴───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
───────┬───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
       │ File: /etc/iptables/iptables.rules
───────┼───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
   1   │ # Empty iptables rule file
   2   │ *filter
   3   │ :INPUT ACCEPT [0:0]
   4   │ :FORWARD ACCEPT [0:0]
   5   │ :OUTPUT ACCEPT [0:0]
   6   │ COMMIT
───────┴───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────# systemctl status iptables.service
○ iptables.service - IPv4 Packet Filtering Framework
     Loaded: loaded (/usr/lib/systemd/system/iptables.service; disabled; preset: disabled)
     Active: inactive (dead)I think I am missing something very very stupid, but I am humbly requesting help for this one as I could not find a solution to have this rule persist across restarts.
Thank you.
Last edited by tvidal (2024-10-28 13:33:51)
Offline
Look at docker defaults
Last edited by edacval (2024-10-25 21:58:04)
Offline
Hi,
I would never have guessed that.
Thank you!
Fixed by creating the following file:
───────┬───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
       │ File: /etc/systemd/system/docker.service.d/override.conf
───────┼───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
   1   │ [Service]
   2   │ ExecStartPost=iptables -R DOCKER-USER 1 -j ACCEPT
───────┴───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────Last edited by tvidal (2024-10-28 13:31:20)
Offline

\o/
Please always remember to mark resolved threads by editing your initial posts subject - so others will know that there's no task left, but maybe a solution to find.
Thanks.
Offline
\o/
Please always remember to mark resolved threads by editing your initial posts subject - so others will know that there's no task left, but maybe a solution to find.
Thanks.
So, I tried to edit the post and change the subject, but I can only add 3 more characters, which is not enough for the [SOLVED] prefix.
Is there anything else I should do?
Offline

Be concise 
[SOLVED] How to find source of the -P FORWARD DROP iptables rule
Offline