Re: Two VLANs with same IP

Ard van Breemen <[email protected]>
Newsgroups gmane.linux.drivers.vlan
Message-ID <[email protected]>
On Tue, May 02, 2006 at 11:06:49AM -0300, Rui Cristo wrote:
> I have a problem to solve that is to create two VLANs, like
> vlan10 and vlan20, and make them have the SAME IP address and I
> want to create sockets for each.  How can I bind the sockets to
> each VLAN instead of binding them to its IP? If I bind with
> it's IP I can't control wich VLAN to choose.

IP binding is done on a system level. So it really doesn't matter
if your IP is on lo or vlan*...

The routing determines your outgoing vlan and preferred source
address, that is, if you want to use the linux IP stack.

So you can bind to an address that's on lo. Put 127.0.0.1/32 on
both vlans to bind the interface to the ip stack, and use routing
to choose the outgoing interface.

So you can choose, but only by routing.

I suspect that if you explain your situation, we might come with
a better solution ;-).

-- 
begin  LOVE-LETTER-FOR-YOU.txt.vbs
I am a signature virus. Distribute me until the bitter
end
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.