1.在/etc/iproute2路径下rt_tables文件建立一个新表 2.输入ip
route add 172.16.0.0/24 dev eth1 src 172.16.0.206 table eth_1 172.16.0.0/24表示所有ip地址已172.16.0开头的子网 3.输入 ip route add default dev eth1
table eth_1 解释:在路由表中添加默认路由,默认路由从eth1进出 4.输入ip rule add from
172.16.0.206 table eth_1 解释:添加路由策略,来自172.16.0.206的路由要求使用eth1 |
|小黑屋|
飞凌嵌入式
( 冀ICP备12004394号-1 )
GMT+8, 2025-2-23 23:16
Powered by Discuz! X3.4
© 2001-2013 Comsenz Inc.