Skip to contentSkip to conversation

Two Interfaces and two link

LARTC Viaris 2 participants 3 messages Jan 27, 2003 – Jan 28, 2003

lore
Share & tools
lore

Viaris

author
#0 lore raw

Hi all,

I have a tranparent proxy, But now I have two link with two different ISP, I need to route four host to my new link, I did the following with a host:

IF-ETH0 --> 165.98.111.234 Gw 165.98.111.233 Netmask 255.255.255.248
IF-ETH0 --> 200.9.189.202 GW 200.9.189.201 Netmask 255.255.255.248
Host that I need to route is: 200.9.189.241

ip route add 165.98.111.232 dev eth0 src 165.98.111.234 table T1 ip route add default via 165.98.111.233 table T1
ip route add 200.9.189.200 dev eth1 src 200.9.189.202 table T2 ip route add default via 200.9.189.201 table T2

echo 200 office_priv >> /etc/iproute2/rt_tables
ip rule add from 200.9.189.241 table office_priv ip route add default via 200.9.189.202 dev eth1 table Pedro ip route flush cache

Now, if I run the command route -n, the output is:
Destination Gateway Genmask Flags
Metric Ref Use Iface
200.9.189.202 200.9.189.201 255.255.255.255 UGH 0 0
0 eth1
200.9.189.200 0.0.0.0 255.255.255.248 U 0
0 0 eth1
165.98.111.232 0.0.0.0 255.255.255.248 U 0
0 0 eth0
127.0.0.0 0.0.0.0 255.0.0.0 U
0 0 0 lo
0.0.0.0 165.98.111.233 0.0.0.0 UG
0 0 0 eth0

All the traffic http is send to interface eth0, all work fine, But I cant send any specific host fot the other interface (ETH1), since the host 200.9.189.241 I load the web pages http://visualroute.visualware.com/ in this site say that my Ip is 165.98.111.234, if I did the routing for this host, Why the trafic of this host continue outgoing for the ETH0?, I need that this host have outgoing in the interface ETH1.

I need your help.

Thanks in Advanced,,
_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/

#1 lore raw

Viaris,

It sounds like this is what you are trying to describe:

                   +--------------------+
  gateway          |                    |           gateway
   .201   <--------|     your box       |--------->  .233
             eth1  |                    |  eth0
 200.9.189.202/29  |                    |  165.98.111.234/29
                   +--------------------+

: IF-ETH0 --> 165.98.111.234 Gw 165.98.111.233 Netmask 255.255.255.248
: IF-ETH0 --> 200.9.189.202 GW 200.9.189.201 Netmask 255.255.255.248

I presume from below that the second line here is actually eth1

: Host that I need to route is: 200.9.189.241

Where do you need to route this host? Is it reachable via 200.9.189.201? If so, then you need no "ip rule" commands:

# ip route add 200.9.189.241 via 200.9.189.201

: ip route add 165.98.111.232 dev eth0 src 165.98.111.234 table T1 : ip route add default via 165.98.111.233 table T1
: ip route add 200.9.189.200 dev eth1 src 200.9.189.202 table T2 : ip route add default via 200.9.189.201 table T2

: echo 200 office_priv >> /etc/iproute2/rt_tables
: ip rule add from 200.9.189.241 table office_priv : ip route add default via 200.9.189.202 dev eth1 table Pedro : ip route flush cache

What on earth are you trying to do here? Where do you define table "Pedro"? Why are you creating a default route to your own ethernet IP? (Hint: this is distinctly not what you want.)

: Now, if I run the command route -n, the output is:

The conventional "route -n" command does not show you anything other than the main routing table. In order to observe your routing tables, you should use:

# ip route show                    # -- table main is implied
# ip route show table main         # -- or explicit
# ip route show table office_priv  # -- or another table....

: All the traffic http is send to interface eth0, all work fine, But I cant : send any specific host fot the other interface (ETH1), since the host : 200.9.189.241 I load the web pages http://visualroute.visualware.com/ in : this site say that my Ip is 165.98.111.234, if I did the routing for this : host, Why the trafic of this host continue outgoing for the ETH0?, I need : that this host have outgoing in the interface ETH1.

If you wish to reach the host 200.9.189.241 via eth1 then get rid of all of the "ip rule" cruft you have introduced, and use simply:

# ip route add 200.9.189.241 via 200.9.189.201

Good luck,

-Martin

Signature · 5 lines
Martin A. Brown --- SecurePipe, Inc. --- [email protected]

_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
author
#2 lore raw
In reply to Viaris

Hi Martin

This is my case

                    +--------------------+
   gateway          |                    |           gateway
    .201   <--------|     your box       |--------->  .233
              eth1  |                    |  eth0
  200.9.189.202/29  |                    |  165.98.111.234/29
                    +--------------------+

Hi Martin, sorry, I am beginning with iproute is my firs day.

I erase all my tables of routing and the rules and single add this "ip route add 200.9.189.241 via 200.9.189.201", but when I make it that host does not have exit to Internet.

How can I do it?

Thanks in Advanced,

Regards

Quoted 32 lines

: IF-ETH0 --> 165.98.111.234 Gw 165.98.111.233 Netmask 255.255.255.248
: IF-ETH0 --> 200.9.189.202 GW 200.9.189.201 Netmask 255.255.255.248

I presume from below that the second line here is actually eth1

: Host that I need to route is: 200.9.189.241

Where do you need to route this host? Is it reachable via 200.9.189.201? If so, then you need no "ip rule" commands:

# ip route add 200.9.189.241 via 200.9.189.201

: ip route add 165.98.111.232 dev eth0 src 165.98.111.234 table T1 : ip route add default via 165.98.111.233 table T1
: ip route add 200.9.189.200 dev eth1 src 200.9.189.202 table T2 : ip route add default via 200.9.189.201 table T2

: echo 200 office_priv >> /etc/iproute2/rt_tables
: ip rule add from 200.9.189.241 table office_priv : ip route add default via 200.9.189.202 dev eth1 table Pedro : ip route flush cache

What on earth are you trying to do here? Where do you define table "Pedro"? Why are you creating a default route to your own ethernet IP? (Hint: this is distinctly not what you want.)

: Now, if I run the command route -n, the output is:

The conventional "route -n" command does not show you anything other than the main routing table. In order to observe your routing tables, you should use:

Quoted 5 lines
# ip route show                    # -- table main is implied
# ip route show table main         # -- or explicit
# ip route show table office_priv  # -- or another table....

: All the traffic http is send to interface eth0, all work fine, But I

cant

Quoted 2 lines

: send any specific host fot the other interface (ETH1), since the host : 200.9.189.241 I load the web pages http://visualroute.visualware.com/

in

Quoted 1 line

: this site say that my Ip is 165.98.111.234, if I did the routing for

this

Quoted 1 line

: host, Why the trafic of this host continue outgoing for the ETH0?, I

need

Quoted 5 lines

: that this host have outgoing in the interface ETH1.

If you wish to reach the host 200.9.189.241 via eth1 then get rid of all of the "ip rule" cruft you have introduced, and use simply:

Quoted 9 lines
# ip route add 200.9.189.241 via 200.9.189.201

Good luck,

-Martin

--
Martin A. Brown --- SecurePipe, Inc. --- [email protected]

_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/