# Help needed setting up Gentoo-based router for multiple VLAN

## Logge

Hi!

First of all - I'm no expert in routing and VLAN's!

I'm currently underway setting up a network at a site that needs dynamic segmentation of the network.

There will be a need for 10 VLAN's up and running.

For this network I've chosen a server based on Gentoo to do the magic like routing between the VLAN's.

I've managed to set up eth1 with the 10 different VLAN's in /etc/conf.d/net, the script creates them like a charm.

The port that the gentoo router is connected to on the switch is configured to act as a trunk for all the VLAN's.

However, when trying to ping the main switch who's a member of VLAN1, I get no response what so ever.

Just to troubleshoot, i've added all the vlan's as tagged members to the trunk.

The current route table looks like this

```
genesis ~ # ip route

10.0.50.0/30 dev vlan50  proto kernel  scope link  src 10.0.50.1 

10.0.20.0/29 dev vlan20  proto kernel  scope link  src 10.0.20.1 

10.0.0.0/29 dev eth0  proto kernel  scope link  src 10.0.0.5  metric 3 

10.0.1.0/29 dev vlan1  proto kernel  scope link  src 10.0.1.1 

10.0.2.0/29 dev vlan2  proto kernel  scope link  src 10.0.2.1 

10.0.10.0/28 dev vlan10  proto kernel  scope link  src 10.0.10.1 

10.0.30.0/27 dev vlan30  proto kernel  scope link  src 10.0.30.1 

10.0.70.0/27 dev vlan70  proto kernel  scope link  src 10.0.70.1 

10.0.60.0/27 dev vlan60  proto kernel  scope link  src 10.0.60.1 

10.0.40.0/27 dev vlan40  proto kernel  scope link  src 10.0.40.1 

10.0.99.0/24 dev vlan99  proto kernel  scope link  src 10.0.99.1 

127.0.0.0/8 via 127.0.0.1 dev lo  scope link 

default via 10.0.0.1 dev eth0  metric 3 

```

Anyone out there able to explain to me why pinging eg. vlan1 doesn't work!?

Ping works when eth1 is up and running without VLAN's configured.

How do I proceed adding routes so that for example vlan30 gains access to a printer on vlan20?

Gratefull for quick responses!!

//Oskar

----------

## cassiol

hellooo

please post your /etc/conf.d/net

try that

 *Quote:*   

> 
> 
> /etc/init.d/net.eth1 stop 
> 
> ifconfig eth1 up
> ...

 

if not work, please post again

----------

## Logge

Hi and thanks for answering!

This is a stripped down /etc/conf.d/net - removed all but one of the vlans

```
modules=("iproute2")

dns_domain_lo="mylocaldomain"

config_eth0=("dhcp")

config_eth1=("10.0.1.1 netmask 255.255.255.248")

vlans_eth1="2"

vconfig_eth1=("set_name_type VLAN_PLUS_VID_NO_PAD")

config_vlan2=("10.0.2.1 netmask 255.255.255.248")

```

Now this setup is currently working. I've setup two dhcpd and my laptop connected to the port assigned vlan2

is recieving a correct ip. Ping works both to the switch at 10.0.1.2 and to the laptop 10.0.2.5.

It seems to be working but is it working correctly? How to clients connected to the different vlans get connection to the internet?

I'm also trying to setup mac-auth with freeradius to dynamicly assign the correct vlan to the plugged in devices.

But it doesn't seem to work, freeradius in debug mode doesn't even seem to get called even though it's listening on eth1.

Any ideas??

----------

