# bge Driver and vlans



## connchri (Jul 26, 2018)

I'm having a right headache trying to get vlans set up on my FreeBSD 11.1 Release box.

Long story short, I created 2 vlans by following the handbook, and could not get vlans to work.  So a few questions before I continue...

Do you have to have the interface (in this case bge0) configured with it's own IP address, etc, before you can create additional vlan interfaces (bge0.1, bge0.2, etc), or can you just jump right in a create your bge0.1 and bge0.2 vlan 'interfaces'?

Is my config correct, my /etc/rc.conf is as follows (in regards to networking)...

```
vlans_bge0="1 2"
ifconfig_bge0_1="inet 192.168.1.45/24"
ifconfig_bge0_2="inet 192.168.2.40/24"
```

When configured as above, I get no traffic, can't ping, and ifconfig informs me that the link is 100baseT simplex.

The best I have got working so far is setting my rc.conf as follows:

```
ifconfig_bge0="inet 192.168.1.45/24"
```
And manually creating a vlan by:

```
ifconfig bge0.2 create vlan 2 vlandev bge0 inet 192.168.2.40/24
```

This creates the vlan 'interface' as I'd like, but then when I ping it the number of dropped packets is inconsistent.  Sometimes dropping 5% then dropping 90%.  I've not set default routing and nameservers up, as this is redundant at the mo.

The bge0 interface is patched into a procurve 1800-24g switch, and I've been over my ports god knows how many times - there's nothing wrong there, as I've set it up with vlans in other o/s without issue.

When I revert to not using vlans, the interface is fine and I have no issues.  Could the problem be this broadcom driver/NIC?  It's an old Dell Optiplex 745 USFF Core 2 Duo system I'm using.  Ultimately it will be a web server, file server, and database server.  Not high loads, but I do want to seperate network traffic for security reasons, and vlans are part of the solution.

Or am I missing something obvious?

The alternative is I get out the old, but effective, octo-core 20GB ram, yester-year work station (HP XW6600) which is overkill for my needs (and hot, and noisy, and electrically demanding), but I do have a nice 4 port Intel based NIC in it that would probably play along much nicer. (Btw, I have no problem with the XW6600, but the missus will!)


----------



## connchri (Jul 27, 2018)

Update, I was missing something obvious...


```
ifconfig_bge0="up"
```

This must be put AFTER the previous statements, as it appears the interface down after configuring vlans...


----------



## SirDice (Jul 27, 2018)

Order of things in rc.conf is irrelevant. They're just variables that are being sourced by various rc(8) scripts.


----------



## connchri (Jul 29, 2018)

SirDice said:


> Order of things in rc.conf is irrelevant. They're just variables that are being sourced by various rc(8) scripts.



Wasn't aware of this, thanks for informing me.

Perhaps I made a spelling error of sorts then in rc.config.  What confused me the most was the amount of dropped packets when manually creating a vlan - as if it were configured correctly but intermittantly.  I've got hold of an old C2D all intel box (intel NIC), and will throw this together.  I don't trust the bge adapter - I can recall it was flaky many moons ago under windows too, perhaps there's an issue with it.


----------

