创建带tag的子接口

ip link add link eth0 name eth0.${vlan_id} type vlan id ${vlan_id}
ip link set eth0.${vlan_id} up
ip addr add x.x.x.x/xx dev eth0.${vlan_id}
ip route add default via x.x.x.1
ip route delete default via x.x.x.x

你可能感兴趣的:(网络,服务器,linux)