strongswan ipsec 多兴趣流子网配合源进源出策略测试

68 阅读1分钟


# Step 1: Define a new routing table  
echo "100 eth0table" >> /etc/iproute2/rt_tables  

# Step 2: Add routes to that table  
ip route add 10.1.0.0/24 via 172.18.0.100 dev eth0 table eth0table  
ip route add 10.11.0.0/24 via 172.18.0.100 dev eth0 table eth0table  

# Step 3: Add policy rule  
ip rule add from 172.18.0.0/16 table eth0table  

# Step 4: Verify  
ip rule show  
ip route show table eth0table  

# Step 5: Test connectivity  
ping -c 4 10.1.0.1  # Example test