0

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.

  • 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? – A.B Feb 18 '23 at 22:10
  • @A.B The question is very clear and there is no point of ambiguity in it. Please give constructive comments. – Mohamad Reza Feb 19 '23 at 06:46

0 Answers0