创建子接口连接外网方法

sudo ip link add link p3p1 name p3p1.1312 type vlan id 1312 

ifconfig p3p1.1312 10.133.13.12/24 up

sudo ip link set p3p1 up 

sudo ip link set p3p1.1312 up 
sudo ip addr add 10.133.12.105/24 dev p3p1.1312 
sudo ip route delete default via 10.254.3.1 
sudo ip route add default via 10.133.12.254 
sudo ip route list

你可能感兴趣的:(linux)