vaab
vaab

Reputation: 10122

Send packet (icmp or else) through network interface, bypassing routing table

I'd like to send packet (icmp or else) through a specific network interface, bypassing the routing table.

Context: I'm connected through several interfaces to various endpoint. Some of them are able to route my traffic towards internet if I add a route to them. I don't want to touch the routing table (as it is a global system feature, and that I'm testing in parallel the devices for speed reason).

Initially, I thought a simple ping -I DEVICE -r ANY_IP_ONINTERNET would do the trick. But it doesn't: packets are NOT sent to the selected device as I would have expected and the command fails... tcpdump on the other end does not catch any packets: the packets don't seem to even be sent to the interface in the first place despite my explicit command.

When I add a route prior the ping, everything works as expected. But I would like to avoid this... And then, the -I DEVICE -r is not required anymore.

Note: I'm testing this with different VPNs with tapX and tunX devices.

EDIT: I tried combination with/without -r and using -I DEVICE or -I IP_ADDR_DEVICE. With no more success.

Upvotes: 1

Views: 2188

Answers (1)

Cyrus
Cyrus

Reputation: 88601

I suggest to use option -I with IP address of your device.

Upvotes: 1

Related Questions