Score:0

Traffic not routing through secondary IP on interface

lt flag

I am trying to add a secondary IP to my VPN tunnel tun0 interface, however I can't seem to get any traffic to originate from the secondary IP. I'm very new to this so apologies if this is a silly question.

This is the command I am using to add the IP:

ip address add 10.11.12.13/24 dev tun0

This is my interface:

tun0: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNOWN group default qlen 100
    link/none 
    inet 10.33.0.5/16 brd 10.33.255.255 scope global tun0
       valid_lft forever preferred_lft forever
    inet 10.11.12.13/24 scope global tun0
       valid_lft forever preferred_lft forever

This is my routing table:

Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         10.33.0.1       128.0.0.0       UG    0      0        0 tun0
default         10.33.0.1       0.0.0.0         UG    0      0        0 tun0
10.33.0.0       0.0.0.0         255.255.0.0     U     0      0        0 tun0
103.108.95.146  192.168.1.1     255.255.255.255 UGH   0      0        0 eth0
128.0.0.0       10.33.0.1       128.0.0.0       UG    0      0        0 tun0
unn-138-199-33- 192.168.1.1     255.255.255.255 UGH   0      0        0 eth0
192.168.1.0     0.0.0.0         255.255.255.0   U     0      0        0 eth0

curl and ping from the primary IP succeed:

sudo curl --interface 10.33.0.5 google.com
[HTTP 301 response]

sudo ping -vI 10.33.0.5 google.com
--- google.com ping statistics ---
3 packets transmitted, 3 received, 0% packet loss

But curl and ping from the secondary IP fail:

sudo curl --interface 10.11.12.13 google.com
[no response]

sudo ping -vI 10.11.12.13 google.com
--- google.com ping statistics ---
3 packets transmitted, 0 received, 100% packet loss

Any help would be appreciated.

paladin avatar
id flag
You should use the same subnet, or you need to adjust the routing tables. Try `ip address add 10.11.12.13/16 dev tun0` instead.
mongotron avatar
lt flag
Thanks for the suggestion @paladin but unfortunately that also didn't work.
A.B avatar
cl flag
A.B
It's also possible that the problem to solve is not on the local system but on the peer system (the one running its side of the tunnel). But there's no mention of it in the question.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.