vlan_create_if() {
local tag=${1}
local IP=${2}
local PCP=${3}
local parent=${4}
on -d ifconfig vlan${tag} create
on -d if_up -p vlan${tag}
on -d ifconfig vlan${tag} up
on -d ifconfig vlan${tag} vlan ${tag} vlanif ${parent}
on -d ifconfig vlan${tag} ${IP}
on -d ifconfig vlan${tag} vlanprio ${PCP}
}
MAC=AA:BB:CC:DD:00:02
ifconfig ravb0 link ${MAC} active
sysctl -w net.inet.ip.ttl=3
# tag IP PCP parent
vlan_create_if 100 192.168.10.2 1 ravb0
vlan_create_if 400 192.168.40.2 4 ravb0
vlan_create_if 600 192.168.60.2 6 ravb0
vlan_create_if 110 192.168.11.2 1 ravb0
vlan_create_if 120 192.168.12.2 1 ravb0
vlan_create_if 160 192.168.16.2 1 ravb0
#check result
ifconfig
sysctl net.inet.ip.ttl
bridge_create_if()