# /etc/init.d/net and renaming VLAN interfaces

## Kobboi

Can anyone tell me if the following is possible through the use of the /etc/init.d/net initscript?

1) configure VLANs on an interface (e.g. add VLAN 30 to interface eth0)

2) rename the VLAN-ed interfaces (e.g. change eth0.30 to SETUP17)

3) configure IP address on the renamed interface (e.g. add 10.1.2.59/24 to SETUP17)

I can do all those things "manually" (with vconfig for 1, ip for 2 and ifconfig/ip for 3), but if the net-script can handle it, I would prefer it.

If not, what would be a good way to achieve my goal?

----------

## Januszzz

It is possible to setup vlans from /etc/conf.d/net of course. I remember that there is also possibility to rename interface, but according to 2 conventions only - this is set_name_type option (not possible to make SETUP17, my guess).

This is my config with vlans which is quite flexible as vlans are tied to bridges (but it doesn't have to be done that way, simple way is also good enough for most cases).

```

vlans_eth1="20 63 99 907 33 46 102"

config_eth1=( "null" )

vconfig_eth1=( "set_name_type DEV_PLUS_VID_NO_PAD" )

config_eth1_20=( "null" )

config_eth1_33=( "null" )

config_eth1_46=( "null" )

config_eth1_63=( "null" )

config_eth1_99=( "null" )

config_eth1_102=( "null" )

config_eth1_907=( "null" )

# normal network example:

config_eth0=("10.0.0.10 netmask 255.255.255.0")

routes_eth0=("default via 10.0.0.254")

# Bridges:

bridge_br20="eth1.20"

bridge_br33="eth1.33"

bridge_br46="eth1.46"

bridge_br63="eth1.63"

bridge_br99="eth1.99"

bridge_br102="eth1.102"

bridge_br907="eth1.907"

config_br20=( "null" )

config_br33=( "null" )

config_br46=( "null" )

config_br63=( "null" )

config_br99=( "null" )

config_br102=( "null" )

config_br907=( "null" )

```

To setup an interface to a vlan just add the interface to a bridge.

The bridges can have ip addresses, but this shortens path to the router - the machine routes packets instead of the router (gateway or sth else).

brctl show will show you interfaces (vlans) bridget to a bridge. There is unresolved (?) issue of initscripts dependencies which made me to start bridges using net.lo script, but manually from /etc/conf.d/local.start.

Regards.

----------

## Kobboi

I eventually went for bypassing the entire net-script and creating my own. Apparently a simple provides() function that echoes "net" suffices to not let the other init-scripts be aware of this.

----------

