LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   bypass local prerouting route for external eth interface? (https://www.linuxquestions.org/questions/linux-networking-3/bypass-local-prerouting-route-for-external-eth-interface-232955/)

tblack 09-20-2004 11:14 AM

bypass local prerouting route for external eth interface?
 
I am working on a test tool that will act as both a client and server on
one linux box. The intent of this is to put generated traffic on the
external test network. The problem is when the client and server both
reside on the same box, the local routing takes precedence over the static
routes I set.

Is there a way to bypass the local prerouting process and force the data
to be routed through the external interface?

Thanks in advance,
Tony

Here is some info to chomp on:

[root@mars tool]# /sbin/ifconfig
eth0 Link encap:Ethernet HWaddr 00:0C:F1:81:1E:D6
inet addr:10.0.4.253 Bcast:10.0.4.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:165631 errors:0 dropped:0 overruns:0 frame:0
TX packets:141182 errors:0 dropped:0 overruns:2 carrier:0
collisions:2403 txqueuelen:100
RX bytes:34431157 (32.8 Mb) TX bytes:75837717 (72.3 Mb)
Interrupt:11 Base address:0xde80 Memory:feafe000-feafe038

eth1 Link encap:Ethernet HWaddr 00:0C:F1:81:1E:D8
inet addr:102.1.1.2 Bcast:102.1.1.2 Mask:255.255.255.255
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:75 errors:0 dropped:0 overruns:0 frame:0
TX packets:183 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:4122 (4.0 Kb) TX bytes:8406 (8.2 Kb)
Interrupt:11 Base address:0xdd80 Memory:feafd000-feafd038

eth1:40 Link encap:Ethernet HWaddr 00:0C:F1:81:1E:D8
inet addr:102.1.1.41 Bcast:102.255.255.255 Mask:255.255.255.255
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:17982 errors:0 dropped:0 overruns:0 frame:0
TX packets:250 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:1962538 (1.8 Mb) TX bytes:16190 (15.8 Kb)
Interrupt:11 Base address:0xdd80 Memory:feafd000-feafd038

eth2 Link encap:Ethernet HWaddr 00:07:E9:1A:F5:DB
inet addr:122.0.0.2 Bcast:122.0.0.2 Mask:255.255.255.255
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:17982 errors:0 dropped:0 overruns:0 frame:0
TX packets:250 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:1962538 (1.8 Mb) TX bytes:16190 (15.8 Kb)
Interrupt:11 Base address:0xdf00 Memory:feaa0000-feac0000

eth2:40 Link encap:Ethernet HWaddr 00:07:E9:1A:F5:DB
inet addr:122.0.0.41 Bcast:122.255.255.255 Mask:255.255.255.255
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:17982 errors:0 dropped:0 overruns:0 frame:0
TX packets:250 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:1962538 (1.8 Mb) TX bytes:16190 (15.8 Kb)
Interrupt:11 Base address:0xdf00 Memory:feaa0000-feac0000

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:4846069 errors:0 dropped:0 overruns:0 frame:0
TX packets:4846069 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:486087573 (463.5 Mb) TX bytes:486087573 (463.5 Mb)

[root@mars tool]# /sbin/route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
102.1.1.41 * 255.255.255.255 UH 0 0 0 eth2
122.0.0.41 * 255.255.255.255 UH 0 0 0 eth1
10.0.4.0 * 255.255.255.0 U 0 0 0 eth0
169.254.0.0 * 255.255.0.0 U 0 0 0 eth2
127.0.0.0 * 255.0.0.0 U 0 0 0 lo
default 10.0.4.1 0.0.0.0 UG 0 0 0 eth0
[root@mars tool]# /sbin/ip route ls table all
102.1.1.41 dev eth2 scope link src 122.0.0.41
122.0.0.41 dev eth1 scope link src 102.1.1.41
10.0.4.0/24 dev eth0 scope link
169.254.0.0/16 dev eth2 scope link
127.0.0.0/8 dev lo scope link
default via 10.0.4.1 dev eth0
local 102.1.1.41 dev eth1 table local proto kernel scope host src 102.1.1.41
broadcast 127.255.255.255 dev lo table local proto kernel scope link src 127.0.0.1
broadcast 122.255.255.255 dev eth2 table local proto kernel scope link src 122.0.0.41
broadcast 10.0.4.0 dev eth0 table local proto kernel scope link src 10.0.4.253
local 122.0.0.41 dev eth2 table local proto kernel scope host src 122.0.0.41
local 102.1.1.2 dev eth1 table local proto kernel scope host src 102.1.1.2
broadcast 102.1.1.2 dev eth1 table local proto kernel scope link src 102.1.1.2
broadcast 10.0.4.255 dev eth0 table local proto kernel scope link src 10.0.4.253
broadcast 102.255.255.255 dev eth1 table local proto kernel scope link src 102.1.1.41
broadcast 127.0.0.0 dev lo table local proto kernel scope link src 127.0.0.1
local 122.0.0.2 dev eth2 table local proto kernel scope host src 122.0.0.2
broadcast 122.0.0.2 dev eth2 table local proto kernel scope link src 122.0.0.2
local 10.0.4.253 dev eth0 table local proto kernel scope host src 10.0.4.253
local 127.0.0.1 dev lo table local proto kernel scope host src 127.0.0.1
local 127.0.0.0/8 dev lo table local proto kernel scope host src 127.0.0.1
[root@mars tool]#
[root@mars tool]#
[root@mars tool]# /usr/sbin/traceroute 102.1.1.41
traceroute to 102.1.1.41 (102.1.1.41), 30 hops max, 38 byte packets
1 102.1.1.41 (102.1.1.41) 0.066 ms 0.036 ms 0.012 ms

[root@mars tool]# uname -a
Linux mars 2.4.20-8 #1 Thu Mar 13 17:54:28 EST 2003 i686 i686 i386 GNU/Linux
[root@mars tool]#

tblack 09-27-2004 03:47 PM

Just to follow up, I found a solution for this:

http://www.ssi.bg/~ja/send-to-self.txt

Works well.

Tony


All times are GMT -5. The time now is 09:00 PM.