Operating System - Linux
1829400 Members
1661 Online
109991 Solutions
New Discussion

Re: Issue with virtual IP addresses on trunk

 
SOLVED
Go to solution
L_Dieter
Occasional Advisor

Issue with virtual IP addresses on trunk

Hi,

I have following configuration: A grid of 10 RHEL 4/u4 linux machines with some network cards. Our network people created a trunk on their switch so I have eth0.X and eth0.Y Vlan definitions. Now I want to put virutal IPs on eth0.X.

# ifconfig eth0.X:1 add XXX.XXX.XXX.XXX.
# ifconfig eth0.X:2 add YYY.YYY.YYY.YYY

Everything works perfect. But when I run ifconfig -a I cannot see the index number (:1 or :2). I did not find it in /proc filesystem neigther.

Does anybody has an idea how to reveal the index number.

Thanks
6 REPLIES 6
Al Licause
Trusted Contributor

Re: Issue with virtual IP addresses on trunk

I just created a new alias on our RHES v4.4 system as such:

ifconfig eth0:1 a.b.c.d/24

Then ran ifconfig -a.....it shows all of the interface addresses along with the alias for eth0:1. Not sure why you are not seeing them but I've never seen the ifconfig add syntax used to create aliases. Could have something to do with it.
L_Dieter
Occasional Advisor

Re: Issue with virtual IP addresses on trunk

Hi,

Maybe this explains it better:

Contents of /etc/sysconfig/network-scripts/ifcfg-eth0

DEVICE=eth0
ONBOOT=no

/etc/sysconfig/network-scripts/ifcfg-eth0.1

DEVICE=eth0.1
....
ONBOOT=yes
VLAN=yes

# service network restart

Then adding the IP address of the machine.

# ifconfig eth0.1 add 192.168.1.10

Now adding a virtual IP on the same NIC

# ifconfig eth0.1:1 add 192.168.1.100

If now you do ifconfig -a you see:

eth0 ....
eth0.1: ....
eth0.1: ....

What I would expect is

eth0 ....
eth0.1:0 ....
eth0.1:1 ....

Best regards,
Dieter
L_Dieter
Occasional Advisor

Re: Issue with virtual IP addresses on trunk

Indeed, normally ifconfig NIC add is used to add IPv6 interfaces.

But nevertheless, for our team of sysadmins, it is nice to have a ifconfig NIC add and ifconfig NIC del commands. It is working anyway for IPv6 and IPv4.

The only thing is that ifconfig -a truncates the (lets say the awk { print $1 } string).

Where ever I look, I do not find the indexes.

It is for me important to mount/unmount floating databases, but of course I need to mention the right index in the command ifconfig NIC: del .

Best regards,
Dieter
Alexander Samad
Frequent Advisor
Solution

Re: Issue with virtual IP addresses on trunk

Another command to use is ip part of the iproute package

ip li

will show you all the link available on the system, all up and all the down ones.

ip addr
will show you all the addresses attach to an interface

You can add/modi/del addresses, routes etc
L_Dieter
Occasional Advisor

Re: Issue with virtual IP addresses on trunk

Alexander,

Did you know that you are a hero?

You solved this issue.
L_Dieter
Occasional Advisor

Re: Issue with virtual IP addresses on trunk

#ip addr

is indeed the perfect solution for my problem.