I currently have 3 VLANs. VLAN 1 is my default VLAN, and has on it a DHCP server, and my internet router.

I have set up VLAN 2 and VLAN 3, and my layer 3 switch has routing enabled and an IP for each VLAN.

The layer 3 switch is also set up with DHCP helper addresses, so that devices on VLAN 2 and 3 can both get IP addresses in the correct range from the DHCP server on VLAN 1.

All devices on all VLANs can ping each other, expect that devices on VLANs 2 and 3 are unable to ping the router on VLAN 1, or get any internet connection.

The Layer 3 switch has it’s default gateway at the router, and I hoped that this would be used as the next hop for accessing sites outside my LAN.

All of the devices on my network have the layer 3 switch as their default gateway, using the correct IP address for their specific VLAN.

So far, I have not done anything on the routing table of the layer 3 switch at all. It’s all on it’s default settings. I think I need a default route of some sort setting up, so that when people try to access the router, the Layer 3 can point them in the right direction.

However I’m not sure of the best way to do this. Can I set some sort of default rule that says that all internet traffic from all VLANs should look beyond the layer 3 switch, or do I need a specific rule for each VLAN to say where the internet traffic needs to go?

Any help would be greatly appreciated!

EDIT:

Here is my (sanitised) routing table.

IP Route Entries

Destination Gateway VLAN Type Sub-Type Metric Dist.


0.0.0.0/0 1.2.3.4 1 static 10 1
10.0.8.0/24 Zone-8 108 connected 1 0
10.0.1.0/24 DEFAULT_VLAN 1 connected 1 0
127.0.0.0/8 reject static 0 0
127.0.0.1/32 lo0 connected 1 0

4 Spice ups

I will double check my core switch as well when I get in the office, but I have a similar setup and I have

ip route 0.0.0.0 0.0.0.0 default gateway subnet

So assuming my default gateway is 1.2.3.4 on with the subnet mask of 255.255.255.0 I would need:

ip route 0.0.0.0 0.0.0.0 1.2.3.4/24

My routes table has the following headings on each of the default rows:

Destination | Gateway | VLAN | Type | Sub-type | Metric | Dist

The top row is currently:

0.0.0.0/0 | 1.2.3.4 | 1 | static | n/a | 10 | 1

Does that mean that I have the default route, but that it is currently only applying to VLAN 1, and not 2 and 3?

Thanks for your help!

@cweb

So I tried running the command:

ip route 0.0.0.0/0 1.2.3.4

However because there is already a line in the routing table with these addresses, it didn’t seem to do anything. The one that is there only seems to apply to vlan 1:

Destination | Gateway | VLAN | Type | Sub-type | Metric | Dist

0.0.0.0/0 | 1.2.3.4 | 1 | static | n/a | 10 | 1

I could try removing the line and then re-adding it, but I can’t do that right now as that route is being used.

I can’t seem to find the correct syntax for applying a route to specific VLANs, or a command to create a route for all VLANs…

Have you set up inter-VLAN routing? 802.1Q encapsulation with subinterfaces set for each VLAN on the connection from your layer 3 switch to the default gateway I think will solve your problem.

Yes, inter VLAN working was fine for everything apart from the internet connection.

I’ve just solved this - my setup was fine, but the internet router (which I am unable to configure) was only aware of my original VLAN so was unable to send the traffic back. It’s been resolved by my ISP modifying this rule.

I’ve just solved this - my setup was fine, but the internet router (which I am unable to configure) was only aware of my original VLAN so was unable to send the traffic back. It’s been resolved by my ISP modifying this rule.