Skip to contentSkip to conversation

is it possible with iptables

DISCUSSION Hlynur Thor Olason 2 participants 2 messages Dec 15, 2003

lore
Share & tools
lore
#0 lore raw

Im trying to get local traffic from a linux box destined for the same box routed through a test network.

further explanation:

I have 2 Ethernet cards in the linux box.

Call them eth0 with IP address 192.168.0.1 and

eth1 with IP = 192.168..0.2

eth1= 192.168.0.2 is connected to another computer a gateway which has the IP address 192.168.0.3. This computer is then connected to an external network which is again connected to eth0=192.168.0.1 in the first box.

Now the problem is I want to get locally generated packages in the box destined for 192.168.0.2 (eth1 in the box) to leave the box and be routed trough the network to the box again.

I have been trying to use iptables but not found a solution.

Any suggestion would be welcome? / Thor

#1 lore raw
Quoted 2 lines · Hlynur Thor Olason

Im trying to get local traffic from a linux box destined for the same box routed through a test network.

You should have a look to iproute package, trying to play with advanced routing stuff. Having a look at local routing table should be a good start :

root@elendil:~# ip route list table local
[...]
local 192.168.1.2 dev eth0  proto kernel  scope host  src 192.168.1.2
[...]

Maybe deleting this kind of entries will achieve what you want.

Signature · 2 lines
http://www.netexit.com/~sid/
PGP KeyID: 157E98EE FingerPrint: FA62226DA9E72FA8AECAA240008B480E157E98EE
Quoted 2 lines
Quoted 2 lines

Hi! I'm your friendly neighbourhood signature virus. Copy me to your signature file and help me spread!