Gentoo Archives: gentoo-user

From: Marius Vaitiekunas <mariusvaitiekunas@×××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Adding more than one static IP
Date: Tue, 25 Jan 2011 16:50:14
Message-Id: AANLkTik-Va_K3+Oo0JCJtRYbw+mh_S-QyyPHW0h+Gscj@mail.gmail.com
In Reply to: Re: [gentoo-user] Adding more than one static IP by Amar Cosic
1 On Tue, Jan 25, 2011 at 1:08 PM, Amar Cosic <amar.cosic@×××××.com> wrote:
2
3 >
4 >
5 > On Tue, Jan 25, 2011 at 9:01 AM, Adam Carter <adamcarter3@×××××.com>wrote:
6 >
7 >>
8 >> config_eth0=( "77.xxx.104.14/24" )
9 >>> routes_eth0=( "default via 77.xxx.104.1" )
10 >>> config_eth0:1=( "77.xxx.104.100/24" )
11 >>> routes_eth0:1=( "default via 77.xxx.104.1" )
12 >>> config_eth0:2=( "77.xxx.104.101/24" )
13 >>> routes_eth0:2=( "default via 77.xxx.104.1" )
14 >>> config_eth0:3=( "77.xxx.105.100/24" )
15 >>> routes_eth0:3=( "default via 77.xxx.105.1" )
16 >>>
17 >>
18 >> You should let us know what you're trying to achieve with this. Every time
19 >> I have seen config like this, it has been because of fundamental
20 >> misunderstandings of networking. More that one IP address on a subnet
21 >> (unless there are VIPs) = fail.
22 >>
23 >> Remember routing occurs at layer 3, and for most configs should have no
24 >> reference physical interface. The OS knows which interface the next hop can
25 >> be found. In your config you've set the same route three times which makes
26 >> no sense.
27 >>
28 >> (ok i've oversimplified, but for 99.9% of cases the above is true)
29 >>
30 >
31 > I have this on Debian in /etc/network/interfaces:
32 >
33 > auto lo
34 > iface lo inet loopback
35 > auto eth0
36 > iface eth0 inet static
37 > address 82.xxx.148.194
38 > netmask 255.255.255.128
39 > gateway 82.xxx.148.131
40 > auto eth0:1
41 > iface eth0:1 inet static
42 > address 82.xxx.148.195
43 > netmask 255.255.255.128
44 > auto eth0:2
45 > iface eth0:2 inet static
46 > address 82.xxx.148.196
47 > netmask 255.255.255.128
48 > auto eth0:3
49 > iface eth0:3 inet static
50 > address 82.xxx.148.197
51 > netmask 255.255.255.128
52 >
53 >
54 > What I want to know is what is equivalent for this on Gentoo. Let's just
55 > say this is VPS server with 4 IP's assigned to me as customer
56 >
57 >
58 > --
59 > Amar Ćosić
60 > amar.cosic@×××××.com
61 >
62 >
63 Hi,
64
65 I am using like that in /etc/conf.d/net
66 -----
67 config_eth0=( "ip1 netmask 255.255.255.224"
68 "ip2 netmask 255.255.255.255"
69 "ip3 netmask 255.255.255.255"
70 )
71
72 routes_eth0=( "default via your_gw" )
73 -----
74
75 ifconfig doesn't show this info. I use ip command for that:
76
77 # ip addr
78
79 I hope it helps.
80 --
81 mv