IP
wwan0: flags=4305<UP,POINTOPOINT,RUNNING,NOARP,MULTICAST> mtu 1500
inet 10.164.219.2 netmask 255.255.255.252 destination 10.164.219.2
wlx08beac133294: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 172.168.111.115 netmask 255.255.255.0 broadcast 172.168.111.255
默认路由
default via 192.168.1.1 dev eth1 onlink
default via 10.164.219.1 dev wwan0 proto static metric 700
删除默认路由
route del default
建立策略路由
echo -e "100\tnet_gms " >> /etc/iproute2/rt_tables
ip route add default via 10.164.219.1 dev wwan0 table 100
echo -e "101\tnet_eth " >> /etc/iproute2/rt_tables
ip route add 172.168.30.0/24 via 192.168.1.1 dev eth1 table net_eth
ip route add 172.168.1.0/24 via 192.168.1.1 dev eth1 table net_eth
echo -e "102\tnet_wifi " >> /etc/iproute2/rt_tables
ip route add 172.168.113.0/24 via 172.168.111.1 dev wlx08beac133294 table net_wifi
ip route show table net_gms
172.168.113.73
IP
inet 10.162.62.198 netmask 255.255.255.252 destination 10.162.62.198