# [SOLVED] iptables: forward 80 to 8080 -> iptables: No...

## pgu

I'm trying to forward port 80 to 8080, but whenever I try I get:

```
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:

```
iptables -t nat -A PREROUTING -j ACCEPT

```

Last edited by pgu on Sun May 26, 2013 2:50 pm; edited 1 time in total

----------

## papahuhn

Well, then it's the REDIRECT target?

----------

## pgu

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?

----------

## PaulBredbury

```
$ zgrep REDIRECT /proc/config.gz 

CONFIG_NETFILTER_XT_TARGET_REDIRECT=y

CONFIG_IP_NF_TARGET_REDIRECT=y

CONFIG_BRIDGE_EBT_REDIRECT=y
```

----------

## pgu

 *PaulBredbury wrote:*   

> 
> 
> ```
> $ zgrep REDIRECT /proc/config.gz 
> 
> ...

 

Thanks. In which kernel were these introduced? It seems like my kernel is too old as I don't have any options named REDIR.

----------

## papahuhn

IP_NF_TARGET_REDIRECT was in the kernel at least since 2005.

----------

## pgu

 *papahuhn wrote:*   

> IP_NF_TARGET_REDIRECT was in the kernel at least since 2005.

 

Found it now...

----------

## pgu

Yep, that was the problem. The option was not enabled in the kernel. Works now. Thanks!

----------

