Created
June 3, 2025 08:02
-
-
Save andikurnia/cc0257d33d442c8688186879bf323dff to your computer and use it in GitHub Desktop.
Linux iptables configuration for communicate two interfaces
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| iptables -t nat -A POSTROUTING -o <iface1> -j MASQUERADE | |
| iptables -A FORWARD -i <iface1> -o <iface2> -m state --state RELATED,ESTABLISHED -j ACCEPT | |
| iptables -A FORWARD -i <iface2> -o <iface1> -j ACCEPT |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment