Networking Forums

Networking Forums > Computer Networking > Linux Networking > One Linux box, two WAN interface...

Reply
Thread Tools Display Modes

One Linux box, two WAN interface...

 
 
JKB
Guest
Posts: n/a

 
      04-27-2007, 04:48 PM
Hello,

I'm trying to configure both iptables and iproute2 to use two WAN
interfaces on a Linux Box (debian/sparc64).

Root rayleigh:[~] > route
Table de routage IP du noyau
Destination Passerelle Genmask Indic Metric Ref Use
Iface
192.168.0.128 * 255.255.255.0 U 0 0 0 eth0
192.168.253.0 * 255.255.255.0 U 0 0 0 eth2
192.168.254.0 * 255.255.255.0 U 0 0 0 eth1
default 192.168.254.254 0.0.0.0 UG 0 0 0 eth1
Root rayleigh:[~] >

This server is a gateway for my LAN (eth0) and I can send packets
from LAN workstations to eth1 or eth2. I have written some iptables
rules to dispatch traffic between eth1 and eth2 :

ip rule add from 192.168.253.1 lookup backup priority 100
ip rule add fwmark 0x01 table backup priority 101
ip route add default via 192.168.253.254 dev eth2 table backup
ip route flush cache
echo 0 > /proc/sys/net/ipv4/conf/eth2/rp_filter

Root rayleigh:[~] > iptables -L -t mangle
Chain PREROUTING (policy ACCEPT)
target prot opt source destination
MARK tcp -- 192.168.0.84 anywhere tcp
dpt:smtp MARK set 0x1

Thus, all smtp traffic that comes from 192.168.0.84 (a LAN workstation)
goes to WAN by eth2 and not by default route eth1.

Problem : I want to configure the gateway itself to send locally
generated packet by eth2. Why ? I have tried to write some iptables
rules without any success...

Thanks in advance,

JKB
 
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
understanding TCP-IP interface in linux kernel will_u_tellmemore Linux Networking 4 10-30-2006 08:29 AM
bonded interface in linux renjith Linux Networking 2 03-07-2006 08:52 AM
get ip address of an interface in linux kernel. Giacomo Linux Networking 2 07-07-2005 07:28 AM
PROGRAMMING MY WIRELESS INTERFACE in linux sam1967 Wireless Internet 2 06-08-2005 06:49 AM
Linux API to create logical interface on a physical interface? Zarko Coklin Linux Networking 2 07-18-2004 01:50 AM



1 2 3 4 5 6 7 8 9 10 11