Ping between virtual interface on the same machine
Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I would like to try to ping each other from the host machine, and it works if I use the IP addresses:
--------------------------------------------------------------------------
$ ping -I 172.16.0.2 172.16.0.1 -c 5
PING 172.16.0.1 (172.16.0.1) from 172.16.0.2 : 56(84) bytes of data.
64 bytes from 172.16.0.1: icmp_seq=1 ttl=64 time=0.059 ms
64 bytes from 172.16.0.1: icmp_seq=2 ttl=64 time=0.075 ms
64 bytes from 172.16.0.1: icmp_seq=3 ttl=64 time=0.086 ms
64 bytes from 172.16.0.1: icmp_seq=4 ttl=64 time=0.057 ms
64 bytes from 172.16.0.1: icmp_seq=5 ttl=64 time=0.055 ms
In the first case, Wireshark doesn't see anything monitoring srs_spgw_sgi, in the second case it captures the five ICMP packets arriving to srs_spgw_sgi (but with "no response seen" warning).
I have removed all rp filtering and enabled ip forwarding (net.ipv4.ip_forward).
I don't understand why does not work in the second case... could you help me?
Thank you!!
Andrea
Last edited by andre88; 03-26-2019 at 06:05 AM.
Reason: I inverted the two cases in the sentence about Wireshark
Ping using ipv4 in this case will need to have the host and clients able to communicate either within the same subnet or by all having the correct routing (as above). However there is also the question of how you configured the virtual nic in the vm settings as they may have an impact.
Hi, thank you for your answers!
First of all: I have edited the thread, because I inverted the two cases in the sentence about Wireshark. Now it's right!
@nini09: what do you mean about resolving interface name? What should I do? I tried to add
172.16.0.1 srs_spgw_sgi
172.16.0.2 tun_srsue
to /etc/hosts and even to /etc/network/interfaces, both together and also alternatively, but this did not work.
@jefro: what do you mean with "simple ping ip address"? Something like the first test I made?
Sorry guys but I'm a beginner on both Linux and networking! Thank you!!
That is dependant on the implementation of ping tool, how does it map interface name to IP address.
Normally, we shouldn't use the option of forcing source interface, using routing table is correct way.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.