Score:0

Can't create a pseudo network interface on Debian 11

lb flag

I have a KVM based Debian 11 (bullseye) VPS with internet access on eth0 network adapter. The public IP has been assigned by DHCP. The IPs and Routes are as what follows:

ifconfig and iptable BEFORE adding new interface

Note: Due to hide my server IP, the public IP is masked in the images.

Now, I created a dummy network interface named eth1 and assigned a private IP address (10.200.100.50):

modprobe dummy
ip link add eth1 type dummy
ip addr add 10.200.100.50/32 brd + dev eth1 label eth1

and also, added a new route to the iptable:

ip route add 10.200.100.50/32 via XXX.YYY.ZZZ.1 dev eth0 onlink

Note: XXX.YYY.ZZZ.1 is eth0 default gateway.

ifconfig and iptable AFTER adding new interface

Now the problem is here, I have ping with 10.200.100.50 but can't connect to the internet through it:

PING OK BUT CURL NOT OK

ping 10.200.100.50 (OK)
curl ip.me --max-time 20 --interface 10.200.100.50 (ERROR)

Please tell me where my misconfiguration is.

A.B avatar
cl flag
A.B
Could also be a misconception and an [XY problem](https://meta.stackexchange.com/questions/66377/what-is-the-xy-problem). What is your actual goal?
Mohamad Reza avatar
lb flag
@A.B The question is very clear and there is no point of ambiguity in it. Please give constructive comments.
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.