Friday, April 7, 2017

How to add redirects for Web and SSL ports

iptables -F

iptables -t nat -I PREROUTING -p tcp --dport 80 -j REDIRECT --to-ports 8080

iptables -t nat -I OUTPUT -p tcp --dport 80 -j REDIRECT --to-ports 8080

iptables -t nat -I PREROUTING -p tcp -m tcp --dport 443 -j REDIRECT --to-ports 8181

iptables -t nat -I OUTPUT -p tcp --dport 443 -j REDIRECT --to-ports 8181


better yet...

iptables -t nat -A OUTPUT -p tcp -d XX.XX.XX.XX --dport 443 -j REDIRECT --to-port 8181
iptables -t nat -A OUTPUT -p tcp -d
XX.XX.XX.XX:80 -j REDIRECT --to-port 8080

No comments:

Post a Comment

OXY 3 Parts Needed

This blog post lists the parts needed to build and operate an OXY 3 .... but first an Oxy 3 unboxing video! Lynx OXY3-255 - Oxy 3 H...