Re: [Vserver] An interesting problem/bug with IP aliases

2003-11-03 Thread Jacques Gelinas
On Fri, 31 Oct 2003 10:05:02 -0500, Chris Wright wrote
 * Jacques Gelinas ([EMAIL PROTECTED]) wrote:
  The ip command uses the same kernel interface as ifconfig to setup IP aliases.
  The SECONDARY flag can't be touched using the kernel interface.
  So the command will produce the same problem.
  
  While the ip command do more, especially on the routing side, it does the
  same thing on the IP aliases side.
 
 This isn't actually the case.  The difference is how you can set the
 secondary flag, etc.  Try this:
 
 # ip addr add 192.168.1.0/24 dev eth0
 # ip addr add 192.168.1.1 dev eth0
 # ip addr add 192.168.1.2 dev eth0
 # ip addr list
 
 now you have two useable aliaes .1 and .2 (try pinging them from another
 machine).  With .1 being the first one you set up (take note of the
 subnets that they are assigned to).

Yes I am taking note. Both (1.2 and 1.1) end up on /32. I am getting the same
result with ifconfig. They end up on different networks.


$ /sbin/ip addr add 192.168.0.0/24 dev eth0
$ /sbin/ip addr add 192.168.0.1 dev eth0
$ /sbin/ip addr add 192.168.0.2 dev eth0
$ /sbin/ip addr list


inet 192.168.0.0/24 scope global eth0
inet 192.168.0.1/32 scope global eth0
inet 192.168.0.2/32 scope global eth0

Now if I do

$ /sbin/ip addr add 192.168.0.0/24 dev eth0
$ /sbin/ip addr add 192.168.0.1/24 dev eth0
$ /sbin/ip addr add 192.168.0.2/24 dev eth0
$ /sbin/ip addr list

inet 192.168.0.0/24 scope global eth0
inet 192.168.0.1/24 scope global secondary eth0
inet 192.168.0.2/24 scope global secondary eth0

Now if I delete 192.168.0.0, I am loosing then all.

-

I have review this problem. I realise now why most people have not experienced
this problem. If you set an IP alias (using whatever tool) on eth0, using the same
network as currently defined on eth0, then the aliases become all secondary
and you loose the aliases definition only if you unconfigure eth0, which you seldom
do.

We have withness this problem because we generally use private networks inside
a host server and all the vservers are hook to this network. We do this to
achieve physical network failover. All our server have 2 nics and using gated
the internal network used by the vservers is advertised on both nics.

Using the ip addr add 192.168.0.0/24 dev eth0 above should cure our own
problem. I realise this is not a typical setup.


-
Jacques Gelinas [EMAIL PROTECTED]
vserver: run general purpose virtual servers on one box, full speed!
http://www.solucorp.qc.ca/miscprj/s_context.hc
___
Vserver mailing list
[EMAIL PROTECTED]
http://list.linux-vserver.org/mailman/listinfo/vserver


Re: [Vserver] An interesting problem/bug with IP aliases

2003-11-03 Thread Chris Wright
* Jacques Gelinas ([EMAIL PROTECTED]) wrote:
 $ /sbin/ip addr add 192.168.0.0/24 dev eth0
 $ /sbin/ip addr add 192.168.0.1 dev eth0
 $ /sbin/ip addr add 192.168.0.2 dev eth0
 $ /sbin/ip addr list
 
 
 inet 192.168.0.0/24 scope global eth0
 inet 192.168.0.1/32 scope global eth0
 inet 192.168.0.2/32 scope global eth0
 
 Now if I do
 
 $ /sbin/ip addr add 192.168.0.0/24 dev eth0
 $ /sbin/ip addr add 192.168.0.1/24 dev eth0
 $ /sbin/ip addr add 192.168.0.2/24 dev eth0
 $ /sbin/ip addr list
 
 inet 192.168.0.0/24 scope global eth0
 inet 192.168.0.1/24 scope global secondary eth0
 inet 192.168.0.2/24 scope global secondary eth0
 
 Now if I delete 192.168.0.0, I am loosing then all.

Yup, this latter example is what happens with ifconfig.

 I have review this problem. I realise now why most people have not experienced
 this problem. If you set an IP alias (using whatever tool) on eth0, using the same
 network as currently defined on eth0, then the aliases become all secondary
 and you loose the aliases definition only if you unconfigure eth0, which you seldom
 do.
 
 We have withness this problem because we generally use private networks inside
 a host server and all the vservers are hook to this network. We do this to
 achieve physical network failover. All our server have 2 nics and using gated
 the internal network used by the vservers is advertised on both nics.
 
 Using the ip addr add 192.168.0.0/24 dev eth0 above should cure our own
 problem. I realise this is not a typical setup.

We have seen similar problems in the linux-ha project.  Use of ip
instead of ifconfig gives much better flexibility, IMHO.  Hope it's
working for you now.

thanks,
-chris
-- 
Linux Security Modules http://lsm.immunix.org http://lsm.bkbits.net
___
Vserver mailing list
[EMAIL PROTECTED]
http://list.linux-vserver.org/mailman/listinfo/vserver