Go Back   { mindfrost82.com } > Gadget Corner > Tech Newsgroups > Linux > Suse

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 07-22-2008, 12:44 PM
Alessandro Topo Galileo
 
Posts: n/a
routing problem

Hello all. I have a routing problem.
I have a linux machine (OpenSuSE) that acts as a gateway for the LAN and
is connected to internet using two different internet providers.
I want to ping this linux machine from the lan and from outside, using
both public ip (even from the lan, I have to call linux using external
public ip and not the internal lan ip).

Let's call:
$IP1 = linux ip on first provider's net
$P1_NET = first provider's net
$P1 = default gateway ip on first provider's net
$IF1 = ethernet interface wired with first provider's net

I have tried these commands:
ip route add $P1_NET dev $IF1 src $IP1 table 1
ip route add default via $P1 table 1
ip route add $P2_NET dev $IF2 src $IP2 table 2
ip route add default via $P2 table 2
ip route del default
ip route add default via $P1
ip rule add from $IP1 table 1
ip rule add from $IP2 table 2

Now, if I ping $IP1 or ping $IP2 I get correct answer from outside but
not from the LAN.

If I substitute the 7th line with this line:
ip rule add from $IP1 to 82.0.0.0/8 lookup 2

than ping works from LAN and from outside but obviously it works only
from external ip like 82.a.b.c.
Extending this for all valid addresses I would have to write a lot of rules:
ip rule add from $IP1 to 1.0.0.0/8 lookup 2
ip rule add from $IP1 to 2.0.0.0/8 lookup 2
ip rule add from $IP1 to 3.0.0.0/8 lookup 2
....
excluding 192.168.0.0/16, and than the same for $IP2. It seems me not
very good. :-)

Have you got any suggestion to solve the problem?
Thank you very much.
Reply With Quote
  #2 (permalink)  
Old 07-22-2008, 06:58 PM
noi ance
 
Posts: n/a
Re: routing problem

On Tue, 22 Jul 2008 14:44:01 +0200, Alessandro Topo Galileo typed this
message:

> Hello all. I have a routing problem.
> I have a linux machine (OpenSuSE) that acts as a gateway for the LAN and
> is connected to internet using two different internet providers. I want
> to ping this linux machine from the lan and from outside, using both
> public ip (even from the lan, I have to call linux using external public
> ip and not the internal lan ip).
>
> Let's call:
> $IP1 = linux ip on first provider's net $P1_NET = first provider's net
> $P1 = default gateway ip on first provider's net $IF1 = ethernet
> interface wired with first provider's net
>
> I have tried these commands:
> ip route add $P1_NET dev $IF1 src $IP1 table 1 ip route add default via
> $P1 table 1
> ip route add $P2_NET dev $IF2 src $IP2 table 2 ip route add default via
> $P2 table 2
> ip route del default
> ip route add default via $P1
> ip rule add from $IP1 table 1
> ip rule add from $IP2 table 2
>
> Now, if I ping $IP1 or ping $IP2 I get correct answer from outside but
> not from the LAN.
>
> If I substitute the 7th line with this line: ip rule add from $IP1 to
> 82.0.0.0/8 lookup 2
>
> than ping works from LAN and from outside but obviously it works only
> from external ip like 82.a.b.c.
> Extending this for all valid addresses I would have to write a lot of
> rules: ip rule add from $IP1 to 1.0.0.0/8 lookup 2 ip rule add from $IP1
> to 2.0.0.0/8 lookup 2 ip rule add from $IP1 to 3.0.0.0/8 lookup 2 ...
> excluding 192.168.0.0/16, and than the same for $IP2. It seems me not
> very good. :-)
>
> Have you got any suggestion to solve the problem? Thank you very much.


Going on a limb here but wouldn't this be something better defined in
your /etc/hosts table.

/etc/hosts on remote machine.

$IP1 Linuxbox1_on.external.network

or
$P1_NET Linuxbox1_on.external.network


192.168.0.2 Linuxbox1_on.internal.network
Reply With Quote
  #3 (permalink)  
Old 07-23-2008, 09:09 AM
Alessandro Topo Galileo
 
Posts: n/a
Re: routing problem

Il 22/07/2008 20.58, noi ance ha scritto:

> Going on a limb here but wouldn't this be something better defined in
> your /etc/hosts table.
>
> /etc/hosts on remote machine.


This does not solve the problem, anyway thank you for your answer.
At last, it works (for interested people: comp.os.linux.networking,
thread with the same name).
Reply With Quote
Reply

  { mindfrost82.com } > Gadget Corner > Tech Newsgroups > Linux > Suse


Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

vB code is On
Smilies are Off
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 10:39 PM.


Powered by vBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.
© 1999-2008 mindfrost82.com v11.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109