Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] iptables: forward 80 to 8080 -> iptables: No...
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
pgu
Guru
Guru


Joined: 30 Jul 2009
Posts: 594
Location: Oslo, Norway

PostPosted: Sun May 26, 2013 9:01 am    Post subject: [SOLVED] iptables: forward 80 to 8080 -> iptables: No... Reply with quote

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
View user's profile Send private message
papahuhn
l33t
l33t


Joined: 06 Sep 2004
Posts: 623

PostPosted: Sun May 26, 2013 9:27 am    Post subject: Reply with quote

Well, then it's the REDIRECT target?
_________________
Death by snoo-snoo!
Back to top
View user's profile Send private message
pgu
Guru
Guru


Joined: 30 Jul 2009
Posts: 594
Location: Oslo, Norway

PostPosted: Sun May 26, 2013 9:42 am    Post subject: Reply with quote

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
View user's profile Send private message
PaulBredbury
Watchman
Watchman


Joined: 14 Jul 2005
Posts: 7310

PostPosted: Sun May 26, 2013 10:06 am    Post subject: Reply with quote

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
View user's profile Send private message
pgu
Guru
Guru


Joined: 30 Jul 2009
Posts: 594
Location: Oslo, Norway

PostPosted: Sun May 26, 2013 10:19 am    Post subject: Reply with quote

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
View user's profile Send private message
papahuhn
l33t
l33t


Joined: 06 Sep 2004
Posts: 623

PostPosted: Sun May 26, 2013 12:22 pm    Post subject: Reply with quote

IP_NF_TARGET_REDIRECT was in the kernel at least since 2005.
_________________
Death by snoo-snoo!
Back to top
View user's profile Send private message
pgu
Guru
Guru


Joined: 30 Jul 2009
Posts: 594
Location: Oslo, Norway

PostPosted: Sun May 26, 2013 12:57 pm    Post subject: Reply with quote

papahuhn wrote:
IP_NF_TARGET_REDIRECT was in the kernel at least since 2005.


Found it now...
Back to top
View user's profile Send private message
pgu
Guru
Guru


Joined: 30 Jul 2009
Posts: 594
Location: Oslo, Norway

PostPosted: Sun May 26, 2013 2:49 pm    Post subject: Reply with quote

Yep, that was the problem. The option was not enabled in the kernel. Works now. Thanks!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum