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 10.200.100.50 (OK)
curl ip.me --max-time 20 --interface 10.200.100.50 (ERROR)
Please tell me where my misconfiguration is.