0

i have:

Normal eth0 interface with ip 192.168.1.100/24 gw 192.168.1.1 (normal router)

Dummy virtual interface with ip 172.16.1.1/32

WireGuard client interface called VPN0 up and running against VPNPROVIDER1

WireGuard Client interface Called VPN1 up and running against VPNPROVIDER2

What i want to do:

all the traffic originated from the Dummy virtual interface must go via VPN0

all the traffic originated from the ETH0 normal interface must go via VPN1.

Is this possible?

0

1 Answer 1

2

Assuming you mean incoming traffic on eth0 and Dummy should be forwarded via respective wireguard ifc:

ip rule add iif Dummy lookup 100 prio 100
ip route add default via a1.a2.a3.a4 dev VPN0 table 100
ip rule add iif eth0 lookup 101 prio 101
ip route add default via b1.b2.b3.b4 dev VPN1 table 101

where a1.a2.a3.a4 is the tunnel IP address of the wireguard server on VPN0
and b1.b2.b3.b4 is the tunnel IP address of the wireguard server on VPN1.

You might need to to tweak the rule's prio if you already have other ip rules.

Observe that this will supercede all other routing for traffic coming in those two interfaces, so your normal (main) routing table will not be used at all for that traffic.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .