User Tools

Site Tools


Sidebar

unix:freebsd:system_builds:networking

BSD Networking

This is actually “advanced networking” as we will be talking about LACP and vlans.

LAPC (bonding)

Edit /etc/rc.conf and modify as follows. be sure to remove any other network stanzas

ifconfig_bce0="up"
ifconfig_bce1="up"
cloned_interfaces="lagg0"
ifconfig_lagg0="laggproto failover laggport bce0 laggport bce1 10.0.0.15/24"
  • Bring up all interfaces (two shown)
  • create the “cloned” interface 'laggx' where 'x' is the number (0, 1, etc…)
  • Define the new interface as normal (ifconfig_lagg0 above)

The mode (laggproto) is one of:

  • failover
  • loadbalance
  • fec (old Cisco switches, same as loadbalance)
  • lacp (must be configured on switch also)
  • roundrobin (USE WITH CAUTION)

Best thing would be to use lacp if you can set up the switch, otherwise use either failover (preferred) or fec

vlan

In /etc/rc.conf, add one line, vlans_em0=“list of vlans”, then create an ifconfig line for each vlan defined, ie

vlans_bce0="10 20 30 40 50"
ifconfig_bce0_10="inet 192.168.20.20/24"
ifconfig_bce0_20="up"
ifconfig_bce0_30="dhcp"
ifconfig_bce0_40="up"
ifconfig_bce0_50="inet 10.0.0.15/24"

vlan plus bonding

In the following configuration, we are setting up two separate LAPC bonds, using two pair of interfaces, then adding appropriate vlans to them.

bce0 and bce1 will be paired into lagg0, and work on vlans 10, 20, 30 and 40.

em0 and em1 will be paired into lagg1, and work only with vlan 50.

when you are done, ifconfig should show you all the interfaces, properly sorted.

ifconfig_bce0="up"
ifconfig_bce1="up"
cloned_interfaces="lagg0 lagg1"
ifconfig_lagg0="laggproto failover laggport bce0 laggport bce1"

vlans_lagg0="10 20 30 40"
ifconfig_lagg0_10="inet 192.168.20.21/32"
ifconfig_lagg0_20="up"
ifconfig_lagg0_30="dhcp"
ifconfig_lagg0_40="up"

# iscsi interface
ifconfig_em0="up"
ifconfig_em1="up"
ifconfig_lagg1="laggproto failover laggport em0 laggport em1"

vlans_lagg1="50"
ifconfig_lagg1_50="inet 10.0.0.15/24"

Resources

unix/freebsd/system_builds/networking.txt · Last modified: 2017/12/17 23:39 by rodolico