LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   iptables prob (https://www.linuxquestions.org/questions/linux-software-2/iptables-prob-393722/)

mchitrakar 12-16-2005 07:33 PM

iptables prob
 
iptables man page says there is option for "--to-destination" for DNAT...
but iptables in my comp doesnt accept it and gives error
as:

pitables v1.2.7a; Unknown arg '--to-destination'. try iptables -h ...for more informations


this has confused me. any suggestions?

Matir 12-16-2005 09:09 PM

Generally, arguments dependent upon another argument must come after that other argument. For example, in this case, you'd need '-j DNAT' before the '--to-destination'.

mchitrakar 12-17-2005 07:36 PM

the cmd i used is:
iptables -t nat -I PREROUTING -p tcp -d 203.78.160.242 --dport 80 -j REDIRECT --to 192.168.0.12
but still it did not occur...

mchitrakar 12-17-2005 07:38 PM

oops...even cmd :

iptables -t nat -I PREROUTING -p tcp -d 203.78.160.242 --dport 80 -j REDIRECT --to-destination 192.168.0.12

--???

Matir 12-18-2005 12:39 PM

You can't use --to-destination with -j REDIRECT. As the man page says, --to-destination is only valid with the 'BALANCE' and 'DNAT' targets. -j REDIRECT redirects to the LOCAL machine only, and as such, is only capable of changing ports.


All times are GMT -5. The time now is 11:35 PM.