Hi I am trying to forward port 80 to 8080 locally using iptables with the following /sbin/iptables -t nat -I PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 8080 However this does not get put into the iptables configuration even after running iptables-save Have i missed something along the way? thanks
Hi, On Thu, Oct 23, 2008 at 09:15, Tom Brown <tom at ng23.net> wrote:> However this does not get put into the iptables configuration even after > running iptables-saveiptables-save will only output the rules in a way that iptables-restore will be able to rebuild the rules from. If what you want is for these rules to be up when you boot the machine, what you want is probably "service iptables save", which will use iptables-save to record these rules to /etc/sysconfig/iptables, and a script automatically calls iptables-restore to read that file upon boot. HTH, Filipe
Tom Brown wrote:> I am trying to forward port 80 to 8080 locally using iptables with the > following > > /sbin/iptables -t nat -I PREROUTING -p tcp --dport 80 -j REDIRECT > --to-port 8080 > > However this does not get put into the iptables configuration even after > running iptables-save > > Have i missed something along the way?Try adding it manually to the iptables config. # vim /etc/sysconfig/iptables And then restart iptables. Regards, Max
Maybe Matching Threads
- Redirecting port 8080 to port 80 - how to add in /etc/sysconfig/iptables file?
- Redirecting port 8080 to port 80 - how to add in /etc/sysconfig/iptables file?
- Redirecting port 8080 to port 80 - how to add in /etc/sysconfig/iptables file?
- iptables nat table rules
- iptables