LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 09-20-2004, 11:14 AM   #1
tblack
LQ Newbie
 
Registered: Sep 2004
Posts: 2

Rep: Reputation: 0
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:1E6
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:1E8
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:1E8
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:F5B
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:F5B
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]#
 
Old 09-27-2004, 03:47 PM   #2
tblack
LQ Newbie
 
Registered: Sep 2004
Posts: 2

Original Poster
Rep: Reputation: 0
Just to follow up, I found a solution for this:

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

Works well.

Tony
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Can route through bypass firewall? Randomandy Linux - Networking 1 08-15-2005 08:33 PM
how to authenticate external users but bypass prompt on local LAN users? taiwf Linux - Security 5 07-13-2005 09:01 AM
v-noob: connecting two pc's through eth interface garba Linux - Networking 3 06-14-2005 07:12 AM
Need help to route traffic properly with 2 eth cards mchan Linux - Networking 1 03-20-2005 07:55 PM
How to bring eth interface up correctly? cold Linux - Networking 2 06-18-2004 02:40 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 06:31 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration