Networking Forums

Networking Forums > Computer Networking > Linux Networking > policy routing and NAT

Reply
Thread Tools Display Modes

policy routing and NAT

 
 
jens
Guest
Posts: n/a

 
      08-28-2003, 04:23 PM
I use a multihomed enviroment on a Linux-box with 2.4.22 and iptable
1.2.8 which stateful inspection.

Internal eth0: 192.168.1.0/24
external 1: ppp0 with staic $IP1 gateway: $GW1
external 2: ppp2 with dynamic $IP2 gateway $GW2

I want to use policy routing with the following rules (this is only a
example)

ip rule add fwmark 5 table t1.out
ip rule add fwmark 6 table t2.out
ip route add default via $GW1 src $IP1 table t1.out
ip route add default via $GW2 src $IP2 table t2.out

ip route add default via $GW1

iptable -t nat -A POSTROUTING -o ppp0 -j MASQUERADE
iptable -t nat -A POSTROUTING -o ppp2 -j MASQUERADE

iptable -t mangle -A PREROUTING -p icmp --icmp-type ping -j MARK
--setmark 6
iptable -t mangle -A OUTPUT -p icmp --icmp-type ping -j MARK
--setmark 6

This works fine for all forwarded traffic, but every icmp-traffic
originated by the router itself goes out to ppp2 with the source IP
$IP1.

What have I to change, that the source IP for outgoing traffic on ppp2
and originated from the router will be changed to $IP2 (the address of
ppp2)?
 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Does anyone know how to debug Routing Policy Database (RPDB)? Treker Linux Networking 2 05-17-2008 08:05 AM
Cant locate wireless network policy in group policy Tom Windows Networking 0 05-11-2005 01:28 PM
policy-based routing and NAT with iptables Florian Pressler Windows Networking 0 02-19-2005 01:45 AM
policy-based routing and NAT with iptables Florian Pressler Linux Networking 0 02-19-2005 01:45 AM
policy routing Alex Harsch Linux Networking 0 11-22-2004 05:25 PM



1 2 3 4 5 6 7 8 9 10 11