Skip to content
This repository was archived by the owner on Jan 12, 2026. It is now read-only.

Possible backwards iptables config example #1

@akeym

Description

@akeym

When using your examples I found something that I think is wrong (but not entirely sure about). In the client configuration, I think the interfaces in the iptables post up/down section are swapped. For me, when I changed this:

PostUp = iptables -A FORWARD -i %i -j ACCEPT; iptables -t nat -A POSTROUTING -o INTERNAL_IP_INTERFACE -j MASQUERADE
PostDown = iptables -D FORWARD -i %i -j ACCEPT; iptables -t nat -D POSTROUTING -o INTERNAL_IP_INTERFACE -j MASQUERADE

to

PostUp = iptables -A FORWARD -i INTERNAL_IP_INTERFACE -j ACCEPT; iptables -t nat -A POSTROUTING -o %i -j MASQUERADE
PostDown = iptables -D FORWARD -i INTERNAL_IP_INTERFACE -j ACCEPT; iptables -t nat -D POSTROUTING -o %i -j MASQUERADE

My other clients on the client subnet could then have a static route like you mention at the end of the Readme ("another host" option) and actually reach the server subnet. Before I swapped those interface names around, only the client running Wireguard could reach the server subnet and would not route traffic for the other clients on the subnet.

In any case, thank you for putting this information out, I found it helpful!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions