# Configuring VLANs troubles

## easy_john

Configuration is as follows:

eth0 and eth1 add together in the trunk "bond0", on top of the trunk "bond0" run vlan's

Config like this:

---

slaves_bond0 = "eth0 eth1"

config_bond0 = ("null")

vlans_bond0 = "12 34"

vconfig_bond0 = ("set_name_type VLAN_PLUS_VID_NO_PAD")

config_vlan12 = ("10.1.12.1 netmask 255.255.255.0")

routes_vlan12 = ("default via 10.1.12.254")

config_vlan34 = ("10.1.34.1 netmask 255.255.255.0")

routes_vlan34 = ("default via 10.1.34.254")

RC_NEED_vlan12 = "net.bond0"

RC_NEED_vlan34 = "net.bond0"

---

In this case, everything works, and net.bond0 start all vlans.

Thenext task - make it so that it would work with per-vlan startup scripts.

From docummentation, it is necessary to add the line

 vlan_start_bond0 = "no"

Just add a line does not change anything, all interfaces are raised through net.bond0.

The next step - I try to remove the line "vlans_bond =" 12 34 "

Now bond0 starts only bringing eth0 eth1, and does not start vlan.

But after that no longer start net.vlan12 themselves:

* Network interface vlan12 does not exist

* Please verify hardware or kernel module (driver)

Any idea?

----------

## easy_john

up please..

----------

## easy_john

one more up

----------

## truc

Please, use BBCode to make your inaitial post readable, you'll probably get more answer, or at least, people will try reading your post

----------

## easy_john

 *truc wrote:*   

> Please, use BBCode to make your inaitial post readable, you'll probably get more answer, or at least, people will try reading your post

 

what exactly unreadable in my post?

----------

## easy_john

Up please.

I need start/stop vlans per separate scripts.

----------

## unax

Hello, comrades!

I have some strange problem to.

VLAN interface can't start.

now kernel version 2.6.38-gentoo-r2 with support VLAN, configuration contain this options:

cat /usr/src/linux/.config | grep VLA

```
CONFIG_VLAN_8021Q=m

CONFIG_VLAN_8021Q_GVRP=y

CONFIG_MACVLAN=m

CONFIG_R8169_VLAN=y
```

But, i already tried to make kernel with CONFIG_VLAN_8021Q=y

try to start and has

#/etc/init.d/net.vlan1 restart

```
 * Bringing up interface vlan1

 *   ERROR: interface vlan1 does not exist

 *   Ensure that you have loaded the correct kernel module for your hardware

 * ERROR: net.vlan1 failed to start
```

but, modules exist in system runtime

#lsmod 

```
Module                  Size  Used by

8021q                  15673  0 

garp                    4934  1 8021q

stp                     1491  1 garp
```

for example i try to bringing up interface with simple network configuration, here:

```
config_eth0=( "10.10.10.22 netmask 255.255.254.0" )

routes_eth0=( "default gw 10.10.10.1" )

dns_servers_eth0="10.10.11.1 10.10.10.1"

vlans_eth1="1"

config_eth1=( "10.10.6.1 netmask 255.255.255.0" )

vconfig_eth1=( "set_name_type VLAN_PLUS_VID_NO_PAD" )

vconfig_vlan1=( "set_flag 1" "set_egress_map 2 6" )

config_vlan1=( "10.10.7.1 netmask 255.255.255.0" )
```

interface eth1 is exist and worked, even has a ping to him. Network addapter is DGE-530T REV-B2

```
eth1      Link encap:Ethernet  HWaddr 00:1e:58:a7:ec:3d  

          inet addr:10.10.6.1  Bcast:10.10.6.255  Mask:255.255.255.0

          inet6 addr: fe80::21e:58ff:fea7:ec3d/64 Scope:Link

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

          RX packets:16 errors:0 dropped:0 overruns:0 frame:0

          TX packets:6 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000 

          RX bytes:2089 (2.0 KiB)  TX bytes:492 (492.0 B)

          Interrupt:19
```

and exist to vconfig [ebuild R ] net-misc/vconfig-1.9 USE="-static"

when vconfig reinstalling, write the message 

( * MTU problems exist for many ethernet drivers. * Reduce the MTU on the interface to 1496 to work around them.)

but I think the problem is not in this.

until that time i was creating VLANs on the servers and had no problem with it..

but now i don't know what the problem is  :Sad: 

----------

## unax

oh! I hastened to create this theme, sorry   :Embarassed: 

in this kernel version the different syntax, and my problem solved as..

example /etc/conf.d/net

 *Quote:*   

> vlans_eth1="2 3"
> 
> config_eth1="10.10.6.1/24"
> 
> vlan2_name="vlan2"
> ...

 

----------

