View previous topic :: View next topic |
Author |
Message |
plut0 Apprentice
![Apprentice Apprentice](/images/ranks/rank_rect_2.gif)
Joined: 21 Dec 2004 Posts: 272
|
Posted: Wed May 30, 2007 6:52 pm Post subject: NIC bonding and aliases questions |
|
|
I have the following setup in /etc/conf.d/net:
Code: | slaves_bond0="eth0 eth1"
config_bond0=(
"172.19.51.160 netmask 255.255.0.0"
"172.19.51.161 netmask 255.255.0.0"
"172.19.51.162 netmask 255.255.0.0"
)
routes_bond0=( "default via 172.19.1.1" ) |
It works, no problem. However, ifconfig only shows the first ip address:
Code: | bond0 Link encap:Ethernet HWaddr 00:18:8B:3D:B6:88
inet addr:172.19.51.160 Bcast:172.19.255.255 Mask:255.255.0.0
UP BROADCAST RUNNING MASTER MULTICAST MTU:1500 Metric:1
RX packets:201907176 errors:0 dropped:0 overruns:0 frame:0
TX packets:208941207 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:64948858415 (61940.0 Mb) TX bytes:72322721800 (68972.3 Mb) |
How do I see all the IP addresses? Should I be using a different alias for each IP address?
Also, is there a way to add another IP address without restarting the net service? |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
di1bert l33t
![l33t l33t](/images/ranks/rank_rect_4.gif)
![](images/avatars/1322078658465db3da4a87f.gif)
Joined: 16 May 2002 Posts: 963 Location: Oslo, Norway
|
Posted: Wed May 30, 2007 7:59 pm Post subject: |
|
|
I've not played with ethernet bonding yet but out of interest what happens
when you run
The reason I ask is that on a server of mine (Gentoo) I've bound a second
address as an alias to eth1 (eth1:1 xxx.xxx.xxx.xxx) but it doesn't show up
if I run ifconfig, however it does if I run ip addr and the interface is
working as I am able to access the network on the other IP range.
...
-m _________________ choff. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
blu3bird Retired Dev
![Retired Dev Retired Dev](/images/ranks/rank-retired.gif)
Joined: 04 Oct 2003 Posts: 614 Location: Munich, Germany
|
Posted: Wed May 30, 2007 8:17 pm Post subject: |
|
|
As di1bert allready said: Linux can only handle one IP(v4) address per interface. To use several IP(v4) addresses it must create several (virtual) interfaces.
The first IP(v4) address is bound to the interface bond0
The second IP(v4) address is bound to the interface bond0:1
The third IP(v4) address is bound to the interface bond0:2
and so on...
Same rules apply if you are not using bonding...you'll get eth0, eth0:1, eth0:2...
If you run "ifconfig bond0" it will just sho bond0, not bond0:1 and not bond0:2. To see them all you can use "ifconfig -a" _________________ Black Holes are created when God divides by zero! |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
plut0 Apprentice
![Apprentice Apprentice](/images/ranks/rank_rect_2.gif)
Joined: 21 Dec 2004 Posts: 272
|
Posted: Wed May 30, 2007 10:00 pm Post subject: |
|
|
@di1bert
Thanks, "ip addr" worked.
@blu3bird
That was my point, "ifconfig -a" doesn't show the other interfaces. In fact, ifconfig doesn't work for the aliases either. If I run "ifconfig bond0:1" or anything of the like, it doesn't show the other IP addresses. I know it works with regular interface aliases (ie. eth0:1) but it doesn't seem to work with bonded interfaces. Perhaps this is a bug or limitation?
Should I be specifying bonded aliases in the config file or is what I am doing ok? I mean it works already I just can't see the other IP addresses with ifconfig. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
|