# Cretate tagged vlan on network interafce



## blind0ne (Sep 24, 2021)

Hello, 

I have the following enteries in my rc.conf:

```
cloned_interface="vlan105"
ifconfig_vlan105="vlan 105 vlandev bge0"
```
my real interface name in bge0, the vlan105 int is visible in the ifconfig output, but I can't see any mac on my tagged (trunk) switch interface.

Plese help me to bring up my int in 105 vlan on trunk switchport


----------



## SirDice (Sep 24, 2021)

```
vlans_bge0="105"
ifconfig_bge0_105="inet ... "
```


----------



## blind0ne (Sep 24, 2021)

SirDice said:


> ```
> vlans_bge0="105"
> ifconfig_bge0_105="inet ... "
> ```


here is my new config, but still no mac on port. 

vlans_bge0="105"
ifconfig_bge0_105="inet vlan 105 vlandev bge0" OR ifconfig_bge0_105="vlan 105 vlandev bge0" the same result, no mac...

Maybe I should load something, or what? In linux I used to write "modeprobe 80211q"

But, I really would like to continue with free bsd. Am I missing some point?


----------



## SirDice (Sep 24, 2021)

blind0ne said:


> ifconfig_bge0_105="inet vlan 105 vlandev bge0"


Don't add `vlandev` etc to the `ifconfig_bge0_105` variable, those are already set because of the `vlans_bge0`. Just set an IP address on the interface.


```
vlans_bge0="105"
ifconfig_bg0_105="inet 1.2.3.4 netmask 255.255.255.0"
```
That will give you a bge0.105 vlan(4) interface with the IP address 1.2.3.4, set to VLAN ID 105 and will use bge0 as the trunk interface.

If you don't need an IP address on that interface just use `up`:

```
vlans_bge0="105"
ifconfig_bg0_105="up"
```


----------



## blind0ne (Sep 24, 2021)

SirDice said:


> Don't add `vlandev` etc to the `ifconfig_bge0_105` variable, those are already set because of the `vlans_bge0`. Just set an IP address on the interface.
> 
> 
> ```
> ...




```
vlans_bge0="105"
ifconfig_bg0_105="up"
```

Still no mac with such config...


----------



## blind0ne (Sep 24, 2021)

Finally changed switchport from trunk to access, solved the problem, but still don't know how to resolve tagged traffic on freeBSD.


----------



## SirDice (Sep 24, 2021)

blind0ne said:


> Still no mac with such config...


Post the output from `ifconfig bge0.105`


----------



## im (Sep 25, 2021)

Check the state of parent interface. If your parent interface has no ip-address then just set it "UP".

```
ifconfig_bge0="up"
```

Here is the example that exactly works with tagged-only traffic.

```
ifconfig_bge0="up"
cloned_interfaces="vlan19 vlan21 vlan32"
ifconfig_vlan32="inet X.X.X.X netmask X.X.X.X vlan 32 vlandev bge0"
ifconfig_vlan21="inet X.X.X.X  netmask X.X.X.X vlan 21 vlandev bge0"
ifconfig_vlan19="inet X.X.X.X netmask X.X.X.X vlan 19 vlandev bge0"
```


----------



## blind0ne (Sep 28, 2021)

im said:


> Check the state of parent interface. If your parent interface has no ip-address then just set it "UP".
> 
> ```
> ifconfig_bge0="up"
> ...


The truth is that I don't need this interface to be configured with static ip address and subnet mask. The interface should then be configured with pppOe, and it does not beeing seen on switchport by mac-address, after it is configured in the way replied in this thread.


----------



## SirDice (Sep 28, 2021)

Is your switch port configured to accept tagged VLAN traffic?


----------



## blind0ne (Oct 5, 2021)

SirDice said:


> Is your switch port configured to accept tagged VLAN traffic?


Yep, for sure it was, the problem was solved by changing switchport from trunk to access. Thank you for help.


----------



## SirDice (Oct 5, 2021)

What brand is the switch? There's quite a bit of difference between various manufactures about what a 'trunk' is. HP for example calls a bundled connection a trunk, whereas Cisco uses 'trunk' for a connection that has tagged VLAN traffic on it. I tend to use the Cisco definition as that's what I've been taught (did CCNA many years ago).


----------

