# 802.1q vlan support - adding default gateway?

## imanassypov

Hi all,

How do you set the default gateway when using 802.1q trunking on the interface?

Here is what I have so far:

```

vlans_eth0="3"

config_eth0="null"

vlan3_name="eth0.3"

config_vlan3="192.168.3.70/24"

```

I cant figure out how to set the default gateway to say .1?

Thanks!

----------

## truc

the default gateway should not have anything to do with the fact you have vlan iface, so just configure it as usual

----------

## imanassypov

As a matter of fact, the way the dg gets setup should change.

With regular non-trunked setup, you configure your default gw something like this:

```

routes_eth0="default via 192.168.30.1"

```

However, when you run a trunk over that interface - physical eth0 comes up before any of your sub-interfaces. That causes an attempt to install a default gateway, which naturally fails because you dont have any ip addresses assigned to your vlans yet.

So I am thinking the above should change to something like

```

(does not work) routes_vlan1="default via 192.168.30.1"

```

I can not find any documentation on the topic.

----------

## AngelKnight

 *imanassypov wrote:*   

> Hi all,
> 
> How do you set the default gateway when using 802.1q trunking on the interface?
> 
> Here is what I have so far:
> ...

 

```

routes_vlan3="0.0.0.0/0 via 192.168.3.1"

```

And make certain vlan3 is set up, eth0.3 is brought up and eth0 is brought link-up also.

----------

