[VLAN] Re: Vlan Digest, Vol 8, Issue 17

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Apr 22, 2005 at 05:06:37PM -0400, Patrice Seyed wrote:
> Thanks for the tips, still not quite getting it to go. Does vconfig
> handle ip aliasing ok?

No, that's out of scope for vconfig.


> As you may have noticed eth0:0 and eth0:1 are the same interface
> but "virtual" interfaces so i can have 2 ip addresses.

Right. I wasn't sure you positively needed the two VLANs to be
accessible on the particular eth0:0 and eth0:1 interfaces. If that's
actually the case, I think the simplest thing would be to rename the
eth0 interface, vconfig add the two VLAN interfaces, and then create
a bridge named eth0 with the two VLAN interfaces as members, but this
is really a horribly broken setup that should be avoided if possible.

> When i tried (per the howto and considering the aliasing):
> ifconfig eth0:0 0.0.0.0 up
> It complained:
> SIOCSIFFLAGS: Cannot assign requested address
> SIOCSIFFLAGS: Cannot assign requested address
> 
> at this point there are no interfaces besides lo showing in "ifconfig
> -a". 
> 
> and also when i tried:
> vconfig add eth0:0 20
> it complained:
> ERROR: trying to add VLAN #20 to IF - :eth0:0: - error: invalid
> argument

Right.

vconfig add eth0 20

creates a new interface called eth0.20, which you can assign an IP
address to just like any other. This interface is limited to VLAN 20
and cannot see anything outside of it.

You can not create VLAN interfaces off alias interfaces (eth0:0) but
you can create aliases off VLAN interfaces. (eth0.20:0)

I suggest you upgrade to the newer iproute2 package and the ip
utility for configuration of the Linux networking stack though, with
it you'd do

ip addr add 1.2.3.4/24 dev eth0.20
ip addr add 5.6.7.8/24 dev eth0.20

instead of dealing with the interface aliases. (eth0.20:0, eth0.20:1)

If you want to bridge the two VLANs together you just create a bridge
with the two VLAN interfaces as members.

vconfig add eth0 20
vconfig add eth0 2258
brctl addbr br0
brctl addif br0 eth0.20
brctl addif br0 eth0.2258
ip addr add 1.2.3.4/24 dev br0
ip addr add 1.2.3.5/24 dev br0

Note that you probably want routing instead of bridging if the two
VLANs don't use the same IP network. (Enable routing by
echo 1 > /proc/sys/net/ipv4/ip_forward
in a boot script.)

Also see a post at http://marc.theaimsgroup.com/?m=105098558615614
along with the following comments in the thread. Plus, to make dhcpd
run properly add

vconfig set_flag eth1.2 1
vconfig set_flag eth1.3 1

to the vconfig commands.

Hope this helps.


//Peter

[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]     [Video 4 Linux]

  Powered by Linux