Linux基于源IP的策略路由
2022-08-29 本文已影响0人
袁先生的笔记
-
在 /etc/iproute2/rt_tables 中添加自定义路由表
100 my_table
-
在自定义路由表中添加规则
ip route add default dev eth1 table my_table
-
添加路由策略,特定源IP使用自定义路由表
ip rule add from 192.168.0.0/24 my_table
在 /etc/iproute2/rt_tables 中添加自定义路由表
100 my_table
在自定义路由表中添加规则
ip route add default dev eth1 table my_table
添加路由策略,特定源IP使用自定义路由表
ip rule add from 192.168.0.0/24 my_table