Created
October 28, 2009 22:25
-
-
Save NV/220919 to your computer and use it in GitHub Desktop.
/usr/local/sbin/post-firewall
This file contains 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/sh | |
# /usr/local/sbin/post-firewall | |
# $1 = vlan1 | |
# $2 = 192.168.1.1 | |
iptables -t nat -I PREROUTING 1 -p tcp -d "$2" --dport 80 -j DNAT --to "$2":8082 | |
iptables -t nat -D PREROUTING -i "$1" -p tcp --dport 80 -j DROP | |
iptables -t nat -I PREROUTING 2 -i "$1" -p tcp --dport 8082 -j DROP | |
iptables -I INPUT 1 -i "$1" -d "$2" -p tcp --syn --dport 8082 -j ACCEPT |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment