880 bytes added ,  22:56, 22 July 2023
Adding information about setting up vlans
(Added OpenBSD page and details of PPPoE)
 
(Adding information about setting up vlans)
 
Line 21: Line 21:


[Todo: add a section of pf firewall usage in a router, for the above]
[Todo: add a section of pf firewall usage in a router, for the above]
== Using VLANs ==
Sometimes you want to run network ports in trunk mode and have the networking on them in vlans.  This is common on a router as it gives you more more network interfaces than are physically fitted to the router.
The current setup is this:
# cat /etc/hostname.em1
inet 10.0.1.1 255.255.255.0
That should be replaced with the singe word "up"
# echo "up" > /etc/hostname.em1
# cat /etc/hostname.em1
up
The reason for this is we will no longer use the interface directly, only vlans within it.
Now setup the vlan interface. Our vlan is going to be vlan 40.
# echo "inet 10.0.1.1 255.255.255.0 NONE vlan 40 vlandev em1" > /etc/hostname.vlan40
# sh /etc/netstart
Then <b>apply changes to /etc/pf.conf</b> to update your firewall to reflect that what was em1 is now vlan40 in firewall terms.
You can add as many more vlans as you need using the same technique.