Linux Netfilter discussions
 help / color / mirror / Atom feed
* UDP packets not being SNAT-ed
@ 2008-07-31  1:58 Barry A Rich
  0 siblings, 0 replies; only message in thread
From: Barry A Rich @ 2008-07-31  1:58 UTC (permalink / raw)
  To: netfilter

I've configured an ubuntu PC as a router. All TCP based protocols are
working. The UDP packets are not getting SNAT-ed. Can someone help with the
setup?

The relevant iptables setup is:

$IPTABLES -A OUTPUT -o lo -s $UNIVERSE -d $UNIVERSE -j ACCEPT

$IPTABLES -t nat -A POSTROUTING -o $UPLINK1IF -j SNAT --to $UPLINK1IP

$IPTABLES -t nat -A POSTROUTING -o $UPLINK2IF -j SNAT --to $UPLINK2IP

$IPTABLES -t nat -A POSTROUTING -o $UPLINK3IF -j SNAT --to $UPLINK3IP

The routing setup is:

ip route add $UPLINK1NET dev $UPLINK1IF src $UPLINK1IP table uplink1

ip route add default via $UPLINK1GW table uplink1

ip route add $UPLINK2NET dev $UPLINK2IF src $UPLINK2IP table uplink2

ip route add default via $UPLINK2GW table uplink2

ip route add $UPLINK3NET dev $UPLINK3IF src $UPLINK3IP table uplink3

ip route add default via $UPLINK2GW table uplink3

ip route add default scope global \

 nexthop via $UPLINK1GW dev $UPLINK1IF weight 1 \

 nexthop via $UPLINK2GW dev $UPLINK2IF weight 1 \

 nexthop via $UPLINK3GW dev $UPLINK3IF weight 1




^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-07-31  1:58 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-31  1:58 UDP packets not being SNAT-ed Barry A Rich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox