View previous topic :: View next topic |
Author |
Message |
pgu l33t
Joined: 30 Jul 2009 Posts: 721 Location: Oslo, Norway
|
Posted: Sun May 26, 2013 9:01 am Post subject: [SOLVED] iptables: forward 80 to 8080 -> iptables: No... |
|
|
I'm trying to forward port 80 to 8080, but whenever I try I get:
Code: | iptables -t nat -A PREROUTING -i $WANIF -p tcp --dport 80 -j REDIRECT --to-port 8080
iptables: No chain/target/match by that name. |
However, it does not seem to be a problem with the nat table as this gives no errors:
Code: | iptables -t nat -A PREROUTING -j ACCEPT
|
Last edited by pgu on Sun May 26, 2013 2:50 pm; edited 1 time in total |
|
Back to top |
|
|
papahuhn l33t
Joined: 06 Sep 2004 Posts: 626
|
Posted: Sun May 26, 2013 9:27 am Post subject: |
|
|
Well, then it's the REDIRECT target? _________________ Death by snoo-snoo! |
|
Back to top |
|
|
pgu l33t
Joined: 30 Jul 2009 Posts: 721 Location: Oslo, Norway
|
Posted: Sun May 26, 2013 9:42 am Post subject: |
|
|
But what is wrong with it? All references and guides I find seem to advice the above. Is there a kernel option which have to be enabled for redirect? |
|
Back to top |
|
|
PaulBredbury Watchman
Joined: 14 Jul 2005 Posts: 7310
|
Posted: Sun May 26, 2013 10:06 am Post subject: |
|
|
Code: | $ zgrep REDIRECT /proc/config.gz
CONFIG_NETFILTER_XT_TARGET_REDIRECT=y
CONFIG_IP_NF_TARGET_REDIRECT=y
CONFIG_BRIDGE_EBT_REDIRECT=y |
|
|
Back to top |
|
|
pgu l33t
Joined: 30 Jul 2009 Posts: 721 Location: Oslo, Norway
|
Posted: Sun May 26, 2013 10:19 am Post subject: |
|
|
PaulBredbury wrote: | Code: | $ zgrep REDIRECT /proc/config.gz
CONFIG_NETFILTER_XT_TARGET_REDIRECT=y
CONFIG_IP_NF_TARGET_REDIRECT=y
CONFIG_BRIDGE_EBT_REDIRECT=y |
|
Thanks. In which kernel were these introduced? It seems like my kernel is too old as I don't have any options named REDIR. |
|
Back to top |
|
|
papahuhn l33t
Joined: 06 Sep 2004 Posts: 626
|
Posted: Sun May 26, 2013 12:22 pm Post subject: |
|
|
IP_NF_TARGET_REDIRECT was in the kernel at least since 2005. _________________ Death by snoo-snoo! |
|
Back to top |
|
|
pgu l33t
Joined: 30 Jul 2009 Posts: 721 Location: Oslo, Norway
|
Posted: Sun May 26, 2013 12:57 pm Post subject: |
|
|
papahuhn wrote: | IP_NF_TARGET_REDIRECT was in the kernel at least since 2005. |
Found it now... |
|
Back to top |
|
|
pgu l33t
Joined: 30 Jul 2009 Posts: 721 Location: Oslo, Norway
|
Posted: Sun May 26, 2013 2:49 pm Post subject: |
|
|
Yep, that was the problem. The option was not enabled in the kernel. Works now. Thanks! |
|
Back to top |
|
|
|