Re: Port Forwarding

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Barry A Rich wrote:
iptables -t nat -A PREROUTING -p tcp -d 192.168.0.1 --dport 5000 -j DNAT
--to 192.168.4.2:5000

iptables -t nat -A PREROUTING -p tcp -d 192.168.0.1 --dport 5001 -j DNAT
--to 192.168.5.2:5000

It does not work and I'm not sure what's wrong. What is the correct way to
do this?

I'd say your modems don't know nothing about the 192.168.0.x subnet, so they route the reply packets via their default route which is the ISP's gateway.

If you can add the 192.168.0.x route to the modem, you might be fine.

Or you could SNAT the packets going to the modems (in addition to the DNAT) as if they are from 192.168.4.x and 192.168.5.x respectively.

Though I have to say it, do you really need the 192.168.4/5.x subnets?

Regards,

--

Aleksander Kamenik
System Administrator
Krediidiinfo AS
an Experian Company
Phone: +372 665 9649
Email: aleksander@xxxxxxxxxxxxxxx

http://www.krediidiinfo.ee/
http://www.experiangroup.com/
--
To unsubscribe from this list: send the line "unsubscribe netfilter" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Netfilter Development]     [Linux Kernel Networking Development]     [Netem]     [Berkeley Packet Filter]     [Linux Kernel Development]     [Advanced Routing & Traffice Control]     [Bugtraq]

  Powered by Linux