Last active
January 6, 2020 02:34
-
-
Save amboxer21/52636b65c20b15741bac0939a36668dd to your computer and use it in GitHub Desktop.
iptable rules for my 1200ac openwrt router to allow remote play on Chiaki
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
IPADDR='192.168.1.224' | |
SOURCE='192.168.1.0/24' | |
for PORT in 80 443 9295; do | |
iptables -I FORWARD -p tcp ! --source $SOURCE -d $IPADDR --dport $PORT -j ACCEPT ; | |
iptables -I PREROUTING -t nat -p tcp ! --source $SOURCE --dport $PORT -j DNAT --to $IPADDR:$PORT ; | |
done | |
for PORT in 9296 9297; do | |
iptables -I FORWARD -p udp ! --source $SOURCE -d $IPADDR --dport $PORT -j ACCEPT ; | |
iptables -I PREROUTING -t nat -p udp ! --source $SOURCE --dport $PORT -j DNAT --to $IPADDR:$PORT ; | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The above iptables rules will forward all of the necessary ports to use Chiaki unless you are on the LAN! If this is not done then no one on the LAN will be able to use the internet. You don't need to use Chiaki while you are on the LAN anyway. In case you do for odd reason though then you can omit the following portion of the iptables rules '! --source $SOURCE'. This will forward everyone's port requests whether it be over the LAN or WAN.