Gentoo Archives: gentoo-user

From: Bill Longman <bill.longman@×××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Adding more than one static IP
Date: Mon, 31 Jan 2011 14:56:30
Message-Id: AANLkTi=N0a0gjDWv12xxLCeEKohXe28F_qjKWzZ9mx_0@mail.gmail.com
In Reply to: [gentoo-user] Adding more than one static IP by Amar Cosic
1 On Mon, Jan 24, 2011 at 7:15 AM, Amar Cosic <amar.cosic@×××××.com> wrote:
2
3 > Hello list
4 >
5 > My mind is just "locked" at the moment and I am trying to figure out what
6 > am I doing wrong here. I have 4 static IP's on server machine and I have
7 > something like this in /etc/conf.d/net :
8 >
9 >
10 >
11 > config_eth0=( "77.xxx.104.14/24" )
12 > routes_eth0=( "default via 77.xxx.104.1" )
13 > config_eth0:1=( "77.xxx.104.100/24" )
14 > routes_eth0:1=( "default via 77.xxx.104.1" )
15 > config_eth0:2=( "77.xxx.104.101/24" )
16 > routes_eth0:2=( "default via 77.xxx.104.1" )
17 > config_eth0:3=( "77.xxx.105.100/24" )
18 > routes_eth0:3=( "default via 77.xxx.105.1" )
19 >
20 >
21 > eth0 works just fine while other ones fail. Could you help me with this one
22 > ?
23 >
24 >
25 Amar,
26
27 You should read up some more on how IP networking is configured and how it
28 works. A default route is, by definition, the next hop on the local network
29 to which packets are sent when no other local interface matches the intended
30 target IP address. Your IP stack looks for local interfaces which match the
31 target network for the target IP address. If it cannot find any, it has no
32 other recourse but to forward it to someone who might know better. That's
33 your default gateway router, and that's its job. If you tell your IP stack
34 that you have four default gateways, it will get very confused. Get rid of
35 all but one of those default route statements.
36
37 If, on the other hand, you just want your local machine to know the gateways
38 for those networks, your route statements should be of this form:
39
40 routes_eth:2=("77.xxx.104.101/24 via 77.xxx.104.1")