ip address forwarding

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

 



Hi all,

 

I am trying to set up a one-to-one mapping for selected addresses through my iptables natted router (i.e. 10.42.0.99 would have a static map through my iptables router to a valid ip address on the wan side).  The problem I am having is that while I can ping the nat ip I do not seem to be able to access services beyond the nat router.  Obviously I am a newbie to iptables…any help/constructive criticism would be greatly appreciated. Here is the code I am using:

 

iptables –t nat –A POSTROUTING –o eth1 –j MASQUERADE

iptables –A FORWARD –I eth0 –j ACCEPT

echo 1 > /proc/sys/net/ipv4/ip_forward

route add –net 10.42.0.0 netmask 255.255.0.0 gw 10.42.0.1 dev eth0

iptables -t nat -A PREROUTING  -i eth1 -d 64.x.x.x  -j DNAT  --to-destination 10.42.0.99

iptables -t nat -A POSTROUTING -s 10.42.0.99 -o eth1 -j SNAT --to 64.x.x.x

ip address add 64.x.x.x dev eth1

 

Thanks

 

Richard


[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