LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 09-04-2012, 12:07 PM   #1
ajaygarg
Member
 
Registered: Mar 2010
Location: New Delhi, India
Distribution: Fedora
Posts: 94

Rep: Reputation: 0
Ping working only one way


Hi all.

Please refer to http://www.linuxquestions.org/questi...vm-4175425590/ for the initial way that I got my internet working on a Debian-Squeeze VM, installed on a Fedora-14 guest.


Now, when I ping the guest from my VM, via ::

Code:
ping 192.168.1.2
(where 192.168.1.2 is the IP-Address of my guest machine), it works;




but when I do the other way round ::

Code:
ping 192.168.4.1
the guest machine fails to ping the VM.







For brevity, I am attaching the output of ifconfig of my Debian VM ::

Code:
br0       Link encap:Ethernet  HWaddr 08:00:27:0e:d9:58  
          inet addr:192.168.4.1  Bcast:192.168.7.255  Mask:255.255.252.0
          inet6 addr: fe80::a00:27ff:fe0e:d958/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2052 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:0 (0.0 B)  TX bytes:86400 (84.3 KiB)

br0:1     Link encap:Ethernet  HWaddr 08:00:27:0e:d9:58  
          inet addr:172.31.255.129  Bcast:172.31.255.255  Mask:255.255.255.128
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

eth0      Link encap:Ethernet  HWaddr 08:00:27:0e:d9:58  
          inet6 addr: fe80::a00:27ff:fe0e:d958/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2058 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:86868 (84.8 KiB)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:938 errors:0 dropped:0 overruns:0 frame:0
          TX packets:938 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:66704 (65.1 KiB)  TX bytes:66704 (65.1 KiB)

Any ideas what I may be doing wrong?
I will be grateful.


Thanks and Regards,
Ajay
 
Old 09-04-2012, 12:43 PM   #2
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
It appears you may be using two separate subnets and if so may require additional routing.

Your VM has an IP range: 192.168.4.0 - 192.168.7.255 for the subnet you've given based on its IP and Netmask. You can get calculations for CIDRs like this at:
http://www.subnet-calculator.com/cidr.php

You don't tell us what your NIC on the guest is setup for but since the IP is 192.168.1 it is NOT in the same subnet as above.

You might want to provide netstat -rn output for both the VM and the guest as well.

Also it may be a firewall issue. Do you have iptables enabled on the VM and if so is it allowing ICMP from the IP or subnet of the guest?

Finally it often helps when saying something doesn't work to give the actual command run and the output you saw. From what you wrote we might assume you did a ping of IP but if instead you did a ping of hostname and it resolved the wrong IP your issue could be a hosts or name resolution issue. By providing the actual command and output it helps keep people from asking you questions.
 
Old 09-04-2012, 12:51 PM   #3
Skaperen
Senior Member
 
Registered: May 2009
Location: center of singularity
Distribution: Xubuntu, Ubuntu, Slackware, Amazon Linux, OpenBSD, LFS (on Sparc_32 and i386)
Posts: 2,684
Blog Entries: 31

Rep: Reputation: 176Reputation: 176
Quote:
Originally Posted by ajaygarg View Post
Now, when I ping the guest from my VM, via ::

Code:
ping 192.168.1.2
(where 192.168.1.2 is the IP-Address of my guest machine), it works;
I don't follow you because of the mixed and/or misused terminology that makes this ambiguous. Are you doing the ping from host OS or the guest OS?

Your linked post mentions host. Here you mention guest. In both cases you mention VM. This is why it is so confusing as to what exactly you are doing.

There should be:
1. A host system.
2. Another host system on a separate machine on the same LAN so you can check from an outside perspective, if you have such a machine to use.
3. Virtual machine software (e.g VirtualBox)
4. A guest system with a different instance of OS (maybe a different OS, different distro, different architecture, or different version).

There should be a lot of configuration and diagnostic information:
1. ifconfig output from each system
2. route output from each system
3. ARP table dumps from each system
4. tcpdump outputs from various points, including bridges and/or tunnels
5. interface statistics in flux

Quote:
Originally Posted by ajaygarg View Post
but when I do the other way round ::

Code:
ping 192.168.4.1
the guest machine fails to ping the VM.
Same issue.

I'm wondering if your VM engine is where you are doing pings from and to. I haven't heard of such a feature (though that does not mean there isn't). But I would not know the context of how a virtual machine program would carry out performing a ping (does it do an ARP request or assume knowledge of the MAC address of the guest) or responding to one (is it configure with an IP address, too)?



Quote:
Originally Posted by ajaygarg View Post
For brevity, I am attaching the output of ifconfig of my Debian VM
Is that the guest or host?
 
Old 09-04-2012, 01:02 PM   #4
Skaperen
Senior Member
 
Registered: May 2009
Location: center of singularity
Distribution: Xubuntu, Ubuntu, Slackware, Amazon Linux, OpenBSD, LFS (on Sparc_32 and i386)
Posts: 2,684
Blog Entries: 31

Rep: Reputation: 176Reputation: 176
Unless you have a specific reason to do separate subnets and routing to virtual machine guests, I recommend bridging them to the host LAN connection, and using IP addresses from a LAN subnet (maybe just allow DHCP). This keeps things simple. Simple tends to more likely just work. Simple is easier to explain to others.
 
Old 09-04-2012, 11:38 PM   #5
ajaygarg
Member
 
Registered: Mar 2010
Location: New Delhi, India
Distribution: Fedora
Posts: 94

Original Poster
Rep: Reputation: 0
Thanks MensaWater and Skaperen for the replies.
And sorry for my ambiguous terminologies


Let me clear myself ::

a)
Fedora-14 is my host machine (machine over which VirtualBox is installed, into which Debian Squeeze VM has been set up)


b)
Debian Squeeze is my guest machine (VM).



Now, as I said that I could get the internet working only by setting the "Bridged Adapter" to NAT.



Also, I will prevent putting other details here (as requested by Skaperen). This is because I made some progress, as follows ::

(i)
Firstly, the thing I am trying to achieve is setting up a Webdav share on the VM, which should then be accessible from the host machine, via Firefox.


(ii)
Now on the VM (guest machine), I managed to configure the conf files correctly (I think). I say "correctly", because after a lot of huffs and puffs, I was able to "/etc/init.d/apache2 restart" successfully.


(iii)
On the VM, I disabled the auto-startup of firewall. So, on reboot, "iptables -L" show no configured rules.


(iv)
Also, on Fedora-14 VirtualBox settings, I enabled "Port Forwarding", with

Code:
Name              "Rule 1"
Protocol          "TCP"
Host IP           
Host Port         "8080"
Guest IP
Guest Port        "443"

(v)
Now, when I type "https://127.0.0.1:8080/webdav" in the URLBar of Fedora-14, the bottom-bar shows "Connected to 127.0.0.1..."; however, I do not get the typical webdav layout. Well, I am not even asked for the "certificate acceptance" thing that happens when connecting to a secure-webdav network for the first time.

Note that if I try with "http" instead of "https"; or any other port besides 8080, the bottom-bar just shows "Connecting to 127.0.0.1..."; it's only when it is "https://127.0.0.1:8080/webdav", does it show "Connected to 127.0.0.1". So, I guess there is some form of "acknowledgement" happening; just bad that it's not going the full way :-\


I am again sorry (especially Skaperen) for being unclear the last time :-\

I will be grateful to listening back from you.



Thanks and Regards,
Ajay
 
Old 09-05-2012, 11:24 AM   #6
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,976

Rep: Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623
If you pinged it one way it really did return the ping correctly. Ping is a very poor two way test. It is not a single way test.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
I cannot ping with command 'ping IP' address but can ping with 'ping IP -I eth0' sanketmlad Linux - Networking 2 07-15-2011 05:32 AM
Ping not working elishac Linux - Networking 5 06-16-2011 04:23 AM
ping not working rhythmking Linux - Networking 10 01-18-2006 11:20 PM
LAN/ADSL Router ping working but DNS ping fails R N Ghosh Linux - Networking 1 01-13-2006 07:44 AM
Ping not working??? talkinggoat Linux - Networking 1 01-02-2004 01:15 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 12:49 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration