LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 07-22-2011, 11:55 PM   #1
splinux
Member
 
Registered: Jun 2011
Location: Sri Lanka
Distribution: centos,redhat,ubuntu
Posts: 90

Rep: Reputation: Disabled
Basic Network Problem .. cant ping, cant access internet..


I have two PCs. Default gateway 192.168.1.1

Virtual Box is installed on PC B

one PC A centos 192.168.1.2
one PC B Windows ( 192.168.1.3) and Centos(Inside the virtual box) 192.168.1.10.

after that i changed PC A ip as 192.168.1.10 then
i got the ip conflict message. it said cant assign that ip So i didnt change that ip


From the Cent OS (virtual box )
i could nt able ping to 192.168.1.1
or 192.168.1.2 or anyweb.


if i am able ping to 127.0.0.1 from Centos( Virtual box)


and i can use the internet from that windows OS..


how can i solve this issue ?

Last edited by splinux; 07-26-2011 at 07:45 AM.
 
Old 07-23-2011, 12:09 AM   #2
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
Did you change PC A's IP to 192.168.1.10 or not?

Do you have any other devices on the network that may be using 192.168.1.10?

Is the virtual machine's network adapter type set to Bridged?
 
Old 07-23-2011, 12:17 AM   #3
splinux
Member
 
Registered: Jun 2011
Location: Sri Lanka
Distribution: centos,redhat,ubuntu
Posts: 90

Original Poster
Rep: Reputation: Disabled
192.168.1.19 not using any other devices


in the virtual box that is in bridge mode..



/etc/resolv.conf
nameserver 192.168.1.1

Last edited by splinux; 07-23-2011 at 12:20 AM.
 
Old 07-23-2011, 12:39 AM   #4
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
Do I correctly understand:
  1. PC A CentOS 192.168.1.2
  2. PC B Windows 192.168.1.3 VirtualBox host with VM configured with bridged network adapter running CentOS 192.168.1.10
  3. Gateway 192.168.1.1
  4. 192.168.1.10 definitely not being used by any network devices except the VM guest.
  5. CentOS (guest, not PC A) cannot ping 192.168.1.1 (gateway) 192.168.1.2 (PC A) or any (!) Internet address such as 75.126.162.205 (LQ)

Can
  1. PC A ping PC 192.168.1.3?
  2. PC A ping 192.168.1.10?
  3. PC B ping PC 192.168.1.2?
  4. PC B ping 192.168.1.10?
Ping tests may not be reliable from VirtualBox hosts, I vaguely recall they did not work on early versions, maybe only when pinging the host. Just tried pinging host under VirtualBox 3.2.12 and it did work.

As everything is being done by address, resolv.conf is not relevant.

Are you using the same netmask on all systems? Conventionally 255.255.255.0 for 192.168.x.x addresses.
 
Old 07-23-2011, 12:46 AM   #5
splinux
Member
 
Registered: Jun 2011
Location: Sri Lanka
Distribution: centos,redhat,ubuntu
Posts: 90

Original Poster
Rep: Reputation: Disabled
if i type the

route add default gw 192.168.1.1

i am getting one error
SIOCAADDRT File Exists..

please refer the link


http://www.voodish.co.uk/articles/si...rk-ip-address/
 
Old 07-23-2011, 04:34 PM   #6
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,939

Rep: Reputation: 3619Reputation: 3619Reputation: 3619Reputation: 3619Reputation: 3619Reputation: 3619Reputation: 3619Reputation: 3619Reputation: 3619Reputation: 3619Reputation: 3619
I never use bridged, I use nat and it usually just works.
 
Old 07-24-2011, 11:04 AM   #7
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
It would help if you answered questions asked and if you said which system you ran the route add on.
 
Old 07-24-2011, 12:08 PM   #8
splinux
Member
 
Registered: Jun 2011
Location: Sri Lanka
Distribution: centos,redhat,ubuntu
Posts: 90

Original Poster
Rep: Reputation: Disabled
Cent OS ( Inside the virtual box )
if i type here i am getting that message..
 
Old 07-25-2011, 02:19 AM   #9
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
The default gateway is only relevant to get to IP addresses outside the LAN, that is outside 192.168.1.x. As I understand it, CentOS in the VM cannot ping LAN addresses including the default gateway so it is very unlikely that accessing IP addresses outside the LAN will work.

Do I correctly understand:
  1. PC A CentOS 192.168.1.2
  2. PC B Windows 192.168.1.3 VirtualBox host with VM configured with bridged network adapter running CentOS 192.168.1.10
  3. Gateway 192.168.1.1
  4. 192.168.1.10 definitely not being used by any network devices except the VM guest.
  5. CentOS (guest, not PC A) cannot ping 192.168.1.1 (gateway) 192.168.1.2 (PC A) or any (!) Internet address such as 75.126.162.205 (LQ)
Can
  1. PC A ping PC 192.168.1.3?
  2. PC A ping 192.168.1.10?
  3. PC B ping PC 192.168.1.2?
  4. PC B ping 192.168.1.10?
Following jefro's post, have you tried configuring the VM's network adapter to NAT, configuring its OS to use DHCP and trying to access addresses on the Internet? If that works we would know the components are working and could concentrate on configuring bridged with static IP.
 
Old 07-26-2011, 07:48 AM   #10
splinux
Member
 
Registered: Jun 2011
Location: Sri Lanka
Distribution: centos,redhat,ubuntu
Posts: 90

Original Poster
Rep: Reputation: Disabled
PC A can ping to 192.168.1.3 (Windows ) yeah can ping
PC A CANT ping to 192.168.1.10 Cent OS( Virtual Box guest OS )
PC B can ping to 192.168.1.2 yea can ping
PC B windows CANT ping to Cent OS ( virtual box guest OS )
 
Old 07-26-2011, 09:17 AM   #11
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
Quote:
Originally Posted by splinux View Post
PC A can ping to 192.168.1.3 (Windows ) yeah can ping
PC A CANT ping to 192.168.1.10 Cent OS( Virtual Box guest OS )
PC B can ping to 192.168.1.2 yea can ping
PC B windows CANT ping to Cent OS ( virtual box guest OS )
Thanks for confirming.

So CentOS in the VM seems not to be on the LAN.

Getting information on the host ... When CentOS in the VM is running, what is the output when the user running the VM runs these commands on the host (where <machine name> is as listed by VBoxManage list vms)
Code:
VBoxManage list bridgedifs
VBoxManage list vms
VBoxManage showvminfo "<machine name>" | grep '^NIC'
Getting information on the guest ... What is the output from these command run as root on the VM
Code:
ifconfig
cat /etc/sysconfig/network-scripts/ifcfg-eth0
iptables --list
route -n
 
Old 07-27-2011, 09:38 AM   #12
splinux
Member
 
Registered: Jun 2011
Location: Sri Lanka
Distribution: centos,redhat,ubuntu
Posts: 90

Original Poster
Rep: Reputation: Disabled
Thx for every one help.. i have written some NAT rules in the iptables.
but i used this command iptables -F
then all the rules flushed except NAT rules.
after i deleted those rules now it working...
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Connect to Network (can ping router) but can't access the Internet DGrieve Linux - Networking 9 04-02-2014 07:47 AM
Ubuntu 8.04 in mixed Mac & Windows network Internet access but no access to network. traveller7 Linux - Networking 1 01-10-2009 07:53 PM
Can ping network but can't ping any internet ip when I hard set the ip Streme Linux - Wireless Networking 4 04-13-2004 09:18 AM
Can ping LAN but cant access internet. Dirt Linux - Networking 2 08-11-2003 02:45 AM
Vector Linux : Can ping local network, can't access internet JoeLinux Linux - Networking 7 12-25-2002 10:08 AM

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

All times are GMT -5. The time now is 01:25 AM.

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