LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-14-2012, 12:28 PM   #1
windstory
Member
 
Registered: Nov 2008
Posts: 486

Rep: Reputation: 36
eth0 could not connect internet


My box is scientific linux 6.1 x86 on virtualbox. After reinstalling vritualbox, I could not connect internet.


The file "/etc/sysconfig/network-scripts/ifcfg-eth0" is this.


Code:
DEVICE=eth0
BOOTPROTO=dhcp
NM_CONTROLLED=yes
ONBOOT=no
TYPE=Ethernet
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=no
NAME="System eth0"
UUID=5fb06bd0-0bb0-7ffb-45f1-d6edd65f3e03
HWADDR=08:00:27:d3:08:db
PEERDNS=yes
PEERROUTES=yes
DNS2=168.126.63.2
DNS1=168.126.63.1
USERCTL=no
Any helpful comment would be appreciated.

Thanks inadvance.
Attached Thumbnails
Click image for larger version

Name:	20120315_3_virtualbox.jpg
Views:	26
Size:	152.2 KB
ID:	9231   Click image for larger version

Name:	20120315_virtualbox (2).jpg
Views:	20
Size:	125.0 KB
ID:	9232   Click image for larger version

Name:	20120315_virtualbox.jpg
Views:	16
Size:	12.4 KB
ID:	9233  
 
Old 03-14-2012, 01:40 PM   #2
evilputty
LQ Newbie
 
Registered: Mar 2012
Posts: 18

Rep: Reputation: Disabled
have you tried releasing ip address?

Quote:
$ sudo dhclient -r
$ sudo dhclient
you could always try restarting the network service; I have no experience with scientific Linux so you would have to find out the method of doing such.

also ONBOOT=no try changing that to yes

plus make sure the networking service is running.

Try this
Quote:
chkconfig --list network

Last edited by evilputty; 03-14-2012 at 01:48 PM.
 
1 members found this post helpful.
Old 03-14-2012, 11:32 PM   #3
windstory
Member
 
Registered: Nov 2008
Posts: 486

Original Poster
Rep: Reputation: 36
evilputty/

I did as you instructed.

PHP Code:
[root@localhost Documents]# dhclient -r
[root@localhost Documents]# dhclient
[root@localhost Documents]# ifconfig
eth0      Link encap:Ethernet  HWaddr 08:00:27:D3:08:DB  
          inet addr
:192.168.56.101  Bcast:192.168.56.255  Mask:255.255.255.0
          inet6 addr
fe80::a00:27ff:fed3:8db/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU
:1500  Metric:1
          RX packets
:3 errors:0 dropped:0 overruns:0 frame:0
          TX packets
:228 errors:0 dropped:0 overruns:0 carrier:0
          collisions
:0 txqueuelen:1000 
          RX bytes
:1423 (1.3 KiB)  TX bytes:19376 (18.9 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
:287 errors:0 dropped:0 overruns:0 frame:0
          TX packets
:287 errors:0 dropped:0 overruns:0 carrier:0
          collisions
:0 txqueuelen:
          RX bytes
:86664 (84.6 KiB)  TX bytes:86664 (84.6 KiB)

[
root@localhost Documents]# chkconfig --list network 
network            0:off    1:off    2:on    3:on    4:on    5:on    6:off 
And changed ip address from 192.168.0.4 to 192.168.56.101.

Please make ip address 192.168.0.4. So I tried to edit "/etc/sysconfig/network-scripts/ifcfg-eth0" as this.

Code:
DEVICE=eth0
BOOTPROTO=none
ONBOOT=yes
TYPE=Ethernet
IPV4_FAILURE_FATAL=no
IPV6INIT=no
NAME="System eth0"
UUID=5fb06bd0-0bb0-7ffb-45f1-d6edd65f3e03
DNS2=168.126.63.2
DNS1=168.126.63.1
USERCTL=no
BOOTPROTO=static
BROADCAST=192.168.0.255
IPADDR=192.168.0.4
NETMASK=255.255.255.0
NETWORK=192.168.0.0
GATEWAY=192.168.0.1
HWADDR=08:00:27:D3:08:DB
PREFIX=24
DEFROUTE=yes
 
Old 03-14-2012, 11:36 PM   #4
windstory
Member
 
Registered: Nov 2008
Posts: 486

Original Poster
Rep: Reputation: 36
And I checked ipaddress as attached photo.

As you can see, the ip addresses are different between "ifconfig" and "system eth0".
Attached Thumbnails
Click image for larger version

Name:	20120315_6_vm_eth0.jpg
Views:	16
Size:	117.3 KB
ID:	9239  

Last edited by windstory; 03-14-2012 at 11:38 PM.
 
Old 03-14-2012, 11:51 PM   #5
deep27ak
Senior Member
 
Registered: Aug 2011
Location: Bangalore, India
Distribution: rhel 5x,6.0,6.2, centOS 5x,6.0,6.2
Posts: 1,194
Blog Entries: 4

Rep: Reputation: 221Reputation: 221Reputation: 221
have you restarted the network after making changes in the eth0 file?

check the type of network connection between virtual machine and your host machine
If you are trying to get ip from dhcp then it should be bridged connection
 
1 members found this post helpful.
Old 03-15-2012, 12:37 AM   #6
windstory
Member
 
Registered: Nov 2008
Posts: 486

Original Poster
Rep: Reputation: 36
deep27ak/

I restart computer with vm. And I've changed to bridged connection. But still same states.

Now ipconfig and connection information of system eth0 is same ip, but still browse any internet site.

After "dhclient -r" and "dhclient" commands, "inet addr" was disappeared.


Code:
[root@localhost Documents]# dhclient -r
[root@localhost Documents]# dhclient
[root@localhost Documents]# ifconfig
eth0      Link encap:Ethernet  HWaddr 08:00:27:D3:08:DB  
          inet6 addr: fe80::a00:27ff:fed3:8db/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:268 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 b)  TX bytes:16599 (16.2 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:266 errors:0 dropped:0 overruns:0 frame:0
          TX packets:266 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:22168 (21.6 KiB)  TX bytes:22168 (21.6 KiB)

Last edited by windstory; 03-15-2012 at 12:39 AM.
 
Old 03-15-2012, 01:01 AM   #7
deep27ak
Senior Member
 
Registered: Aug 2011
Location: Bangalore, India
Distribution: rhel 5x,6.0,6.2, centOS 5x,6.0,6.2
Posts: 1,194
Blog Entries: 4

Rep: Reputation: 221Reputation: 221Reputation: 221
Instead of dhcp why don't you try giving a static IP address

can you ping to the host IP?
what is the IP range of your host and what is the dhcp range you have assigned to dhcp server?
Are you sure your dhcp server is working properly?
 
Old 03-15-2012, 01:19 AM   #8
windstory
Member
 
Registered: Nov 2008
Posts: 486

Original Poster
Rep: Reputation: 36
deep27ak/

The result of ping is here.

Quote:
[root@localhost Documents]# ping 192.168.0.2
PING 192.168.0.2 (192.168.0.2) 56(84) bytes of data.
From 192.168.0.4 icmp_seq=2 Destination Host Unreachable
From 192.168.0.4 icmp_seq=3 Destination Host Unreachable
From 192.168.0.4 icmp_seq=4 Destination Host Unreachable
From 192.168.0.4 icmp_seq=6 Destination Host Unreachable
From 192.168.0.4 icmp_seq=7 Destination Host Unreachable
The dhcp range of host is "192.168.0.2 ~ 192.168.0.254", and about "what is the dhcp range you have assigned to dhcp server" I could not know.

About dhcpd,
Quote:
[root@localhost Documents]# service dhcpd restart
Shutting down dhcpd: [ OK ]
Starting dhcpd: [ OK ]
 
Old 03-15-2012, 02:10 AM   #9
deep27ak
Senior Member
 
Registered: Aug 2011
Location: Bangalore, India
Distribution: rhel 5x,6.0,6.2, centOS 5x,6.0,6.2
Posts: 1,194
Blog Entries: 4

Rep: Reputation: 221Reputation: 221Reputation: 221
so it seems you are not even connected to your local network

check your virtual box network setting is it same as the one I have attached?
and as I said try with a static IP in eth0 file

and one thing which surprises me is you have used bootproto 2 times in your config file?
Code:
DEVICE=eth0
BOOTPROTO=none
ONBOOT=yes
TYPE=Ethernet
IPV4_FAILURE_FATAL=no
IPV6INIT=no
NAME="System eth0"
UUID=5fb06bd0-0bb0-7ffb-45f1-d6edd65f3e03
DNS2=168.126.63.2
DNS1=168.126.63.1
USERCTL=no
BOOTPROTO=static
BROADCAST=192.168.0.255
IPADDR=192.168.0.4
NETMASK=255.255.255.0
NETWORK=192.168.0.0
GATEWAY=192.168.0.1
HWADDR=08:00:27:D3:08:DB
PREFIX=24
DEFROUTE=yes
take a backup of current eth0 file and remove one bootproto

Code:
bootproto=none
IPADDR=(give any static IP)
and if you are using dhcp server for your eth0 then the bootproto should be dhcp
Attached Thumbnails
Click image for larger version

Name:	network.jpg
Views:	7
Size:	66.6 KB
ID:	9240  

Last edited by deep27ak; 03-15-2012 at 02:13 AM.
 
Old 03-15-2012, 09:23 AM   #10
evilputty
LQ Newbie
 
Registered: Mar 2012
Posts: 18

Rep: Reputation: Disabled
please do
Code:
ipconfig /all
on your host machine and post the information here.

Also, why did you need to reinstall virtualbox in the first place? Maybe a little more information about the host will help us out.

also how many network interfaces are on your virtual machine?
 
1 members found this post helpful.
Old 03-15-2012, 09:53 PM   #11
windstory
Member
 
Registered: Nov 2008
Posts: 486

Original Poster
Rep: Reputation: 36
1. The resut of "ipconfig /all".

Quote:
C: \ Users \ Administrator> ipconfig / all

Windows IP Configuration

Host name. . . . . . . . : WIN-BHF9RKQMPUS
The primary DNS suffix. . . . . . . :
Node types. . . . . . . . . : Hybrid
IP routing is enabled. . . . . . . : No
Using WINS proxy. . . . . . : No

Ethernet adapter Local Area Connection 2:

Connection-specific DNS Suffix. . . . :
Description. . . . . . . . . . . . : Marvell Yukon 88E8056 PCI-E Gigabit Ethernet Co
ntroller # 2
Physical address. . . . . . . . : E0-CB-4E-92-76-75
Using DHCP. . . . . . . . . : Yes
Use automatic configuration. . . . . . . : Yes
IPv4 address. . . . . . . . . : 192.168.0.2 (the default setting)
Subnet mask. . . . . . . : 255.255.255.0
Lease start date. . . . . . . : March 16, 2012 10:12:36 AM
The lease expiration date. . . . . . . : March 26, 2012 10:12:36 AM
Default gateway. . . . . . : 192.168.0.1
DHCP server. . . . . . . . . : 192.168.0.1
DNS server. . . . . . . . . . : 168.126.63.1
168.126.63.2
Over Tcpip NetBIOS. . . . : Use

Ethernet adapter Local Area Connection:

Media status. . . . . . . . : Media Disconnected
Connection-specific DNS Suffix. . . . :
Description. . . . . . . . . . . . : Marvell Yukon 88E8056 PCI-E Gigabit Ethernet Co
ntroller
Physical address. . . . . . . . : E0-CB-4E-92-7D-CE
Using DHCP. . . . . . . . . : Yes
Use automatic configuration. . . . . . . : Yes

Ethernet adapter, VirtualBox Host-Only Network:

Connection-specific DNS Suffix. . . . :
Description. . . . . . . . . . . . : VirtualBox Host-Only Ethernet Adapter
Physical address. . . . . . . . : 08-00-27-00-FC-EA
Using DHCP. . . . . . . . . : No
Use automatic configuration. . . . . . . : Yes
Link-local IPv6 address. . . . : Fe80 :: e1dc: 59e6: b0cf: 36df% 19 (default setting)
IPv4 address. . . . . . . . . : 192.168.56.1 (the default setting)
Subnet mask. . . . . . . : 255.255.255.0
Default gateway. . . . . . :
DHCPv6 IAID. . . . . . . . : 520618023
DHCPv6 Client DUID. . . : 00-01-00-01-16-50-0F-0E-E0-CB-4E-92-76-75
DNS server. . . . . . . . . . : Fec0: 0:0: ffff :: 1% 1
fec0: 0:0: ffff :: 2% 1
fec0: 0:0: ffff :: 3% 1
Over Tcpip NetBIOS. . . . : Use

Tunnel adapter isatap. {1C29A021-D5C6-4539-96A9-815128DE91D4}:

Media status. . . . . . . . : Media Disconnected
Connection-specific DNS Suffix. . . . :
Description. . . . . . . . . . . . : Microsoft ISATAP Adapter # 3
Physical address. . . . . . . . : 00-00-00-00-00-00-00-E0
Using DHCP. . . . . . . . . : No
Use automatic configuration. . . . . . . : Yes

Tunnel adapter isatap. {3C33DE68-2130-4354-B5F5-FFF2FC019490}:

Media status. . . . . . . . : Media Disconnected
Connection-specific DNS Suffix. . . . :
Description. . . . . . . . . . . . : Microsoft ISATAP Adapter # 2
Physical address. . . . . . . . : 00-00-00-00-00-00-00-E0
Using DHCP. . . . . . . . . : No
Use automatic configuration. . . . . . . : Yes

Tunnel adapter Local Area Connection * 12:

Connection-specific DNS Suffix. . . . :
Description. . . . . . . . . . . . : Teredo Tunneling Pseudo-Interface
Physical address. . . . . . . . : 00-00-00-00-00-00-00-E0
Using DHCP. . . . . . . . . : No
Use automatic configuration. . . . . . . : Yes
IPv6 address. . . . . . . . . : 2001:0:4137:9 e76: 2c75: 3e52: 8668: c234 (default setting)

Link-local IPv6 address. . . . : Fe80 :: 2c75: 3e52: 8668: c234% 13 (default setting)
Default gateway. . . . . . :::
Over Tcpip NetBIOS. . . . : Disabled

Tunnel adapter isatap. {2063792A-48FF-4919-B95F-1C65DFF2B20B}:

Media status. . . . . . . . : Media Disconnected
Connection-specific DNS Suffix. . . . :
Description. . . . . . . . . . . . : Microsoft ISATAP Adapter
Physical address. . . . . . . . : 00-00-00-00-00-00-00-E0
Using DHCP. . . . . . . . . : No
Use automatic configuration. . . . . . . : Yes
2. About reinstallation, I thought the reinstallation of virualbox will fix this network problem. But not worked.

3. There is one network interfaces on scientific linux VM.

4. And the attached photo is file list of "/etc/sysconfig/network-scripts"
Attached Thumbnails
Click image for larger version

Name:	20120316_1_sl_netwrkadapters.jpg
Views:	8
Size:	123.0 KB
ID:	9249  

Last edited by windstory; 03-15-2012 at 10:52 PM.
 
Old 03-16-2012, 02:26 AM   #12
smilemukul
Member
 
Registered: Jun 2009
Distribution: Redhat,CentOS,Ubuntu,Puppet
Posts: 292

Rep: Reputation: 34
If you are making static ip address then the following steps should be involved as,

1. ipconfig eth0 <x.x.x.x> netmask <x.x.x.x> up
2. edit /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
BOOTPROTO=none
ONBOOT=yes
TYPE=Ethernet
BOOTPROTO=static
IPADDR=<static ip address>
NETMASK=<netmask address>
GATEWAY=<Gateway ip address>
HWADDR=<Lan hardware address>
3. Check your proxy server setting if any
4. Restart the network as service network restart
5. also, chkconfig --level 2345 network on
6. check, ifconfig eth0

If you are making dhcp ip address then the following steps should be involved as,
1. edit /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
BOOTPROTO=none
ONBOOT=yes
BOOTPROTO=dhcp
TYPE=Ethernet
HWADDR=<Lan hardware address>
2. Restart the network as service network restart
3. Also, chkconfig --level 2345 network on
4. run, dhclient
5. check, ifconfig eth0

Now check your internet connection.
 
1 members found this post helpful.
Old 03-16-2012, 02:51 AM   #13
windstory
Member
 
Registered: Nov 2008
Posts: 486

Original Poster
Rep: Reputation: 36
smilemukul/ I followed second tip, but the result of ping is this.

Quote:
[root@localhost Documents]# ping 192.168.0.1
PING 192.168.0.1 (192.168.0.1) 56(84) bytes of data.
From 192.168.0.102 icmp_seq=2 Destination Host Unreachable
From 192.168.0.102 icmp_seq=3 Destination Host Unreachable
"192.168.0.1" is gateway.
 
Old 03-16-2012, 03:07 AM   #14
deep27ak
Senior Member
 
Registered: Aug 2011
Location: Bangalore, India
Distribution: rhel 5x,6.0,6.2, centOS 5x,6.0,6.2
Posts: 1,194
Blog Entries: 4

Rep: Reputation: 221Reputation: 221Reputation: 221
Quote:
Originally Posted by windstory View Post
smilemukul/ I followed second tip, but the result of ping is this.



"192.168.0.1" is gateway.
I don't get the point of using bootproto twice. I am not sure if it is used twice in scientific linux but in RHEL it goes like this

Code:
#vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
ONBOOT=yes
BOOTPROTO=dhcp
TYPE=Ethernet
HWADDR
Code:
#vi /etc/sysconfig/network
NETWORKING=yes
Code:
#service network restart
 
1 members found this post helpful.
Old 03-16-2012, 03:08 AM   #15
smilemukul
Member
 
Registered: Jun 2009
Distribution: Redhat,CentOS,Ubuntu,Puppet
Posts: 292

Rep: Reputation: 34
Can you paste the output of /etc/sysconfig/network-scripts/ifcfg-eth0 & ifconfig eth0

also to which interface "192.168.0.102" ip is allocated ? & you are trying to ping from which machine (windows or linux) ?
 
1 members found this post helpful.
  


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
trouble with eth0, cant connect to internet evgeni22 Linux - Networking 1 01-20-2010 03:01 PM
Can't connect to the internet no eth0 interface. okos Linux - Software 2 05-15-2008 05:11 PM
Cannot connect to internet,(DSL) eth0 not found Neoltlink Slackware 8 01-29-2006 04:45 PM
Can't connect to internet - eth0 not recognized guyfromcanada Fedora 14 10-04-2004 11:30 PM
eth0 seems to stop when I connect to the Internet kyutums Linux - Networking 4 06-19-2003 06:38 AM


All times are GMT -5. The time now is 12:50 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration