LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   eth0 could not connect internet (https://www.linuxquestions.org/questions/linux-newbie-8/eth0-could-not-connect-internet-934438/)

windstory 03-14-2012 11:28 AM

eth0 could not connect internet
 
3 Attachment(s)
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.

evilputty 03-14-2012 12:40 PM

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

windstory 03-14-2012 10:32 PM

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


windstory 03-14-2012 10:36 PM

1 Attachment(s)
And I checked ipaddress as attached photo.

As you can see, the ip addresses are different between "ifconfig" and "system eth0".

deep27ak 03-14-2012 10:51 PM

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

windstory 03-14-2012 11:37 PM

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)


deep27ak 03-15-2012 12:01 AM

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?

windstory 03-15-2012 12:19 AM

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 ]

deep27ak 03-15-2012 01:10 AM

1 Attachment(s)
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

evilputty 03-15-2012 08:23 AM

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?

windstory 03-15-2012 08:53 PM

1 Attachment(s)
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"

smilemukul 03-16-2012 01:26 AM

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.

windstory 03-16-2012 01:51 AM

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.

deep27ak 03-16-2012 02:07 AM

Quote:

Originally Posted by windstory (Post 4628055)
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

smilemukul 03-16-2012 02:08 AM

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) ?


All times are GMT -5. The time now is 07:52 PM.