0

I,

I would like to redirect specific ports through a specific interface.

Until now what I accomplished it was

 cat /etc/iproute2/rt_tables | grep "200 force.route" > /dev/null
 if [ $? != 0 ]; then
   echo "200       force.route" >> /etc/iproute2/rt_tables
 fi

 ip rule del from all fwmark 200 table force.route
 ip rule add from all fwmark 200 table force.route
 ip route del 0.0.0.0/1 via 92.240.245.1 dev tun_02 table force.route
 ip route add 0.0.0.0/1 via 92.240.245.1 dev tun_02 table force.route
 ip route flush cache
 iptables -A OUTPUT -t mangle -o br0 -p icmp -j MARK --set-mark 200

But....

when I ping the packages go through the specific device see with

 tcpdump -i tun_02

then, expecting response but I don't have a response to echo-request.

How can I accomplish that ?

Until now is what I accomplished.

sysadmin1138
  • 133,124
  • 18
  • 176
  • 300

1 Answers1

0

Resulution : Need to add the following two rules: ip route add 0.0.0.0/1 via 92.240.245.1 dev tun_02 table force.route

AND THE MISSING ONE ip route add default via 92.240.245.1 dev tun_02 table force.route