can't reach default gateway

Issues related to configuring your network
Post Reply
fxtoruan@bit.net.id
Posts: 27
Joined: 2015/02/14 06:53:18

can't reach default gateway

Post by fxtoruan@bit.net.id » 2015/07/05 08:25:43

hello guys,
i ‘ve been using my Centos 6 for some time and with connection. It’s a dual booting with Win7. Win7 connect by cable, and Centos by wifi. Somehow, lately Centos failed to connect to the web. I can ping to myself, but seems to be unable to reach the DG ie 192.168.1.1 . Please tell me what’s wrong. Following is the configuration. Many thanks.

# cat /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=fx.toruan
GATEWAY=192.168.1.1

# cat /etc/sysconfig/network-scripts/ifcfg-wlan0
DEVICE=wlan0
HWADDR=78:54:2e:ea:4d:24
NM_CONTROLLED="yes"
ONBOOT=yes # Interface enabled
BOOTPROTO="static" # Assigning in static mode
IPADDR=192.168.1.46 # IP address
NETMASK=255.255.255.0 # Subnet mask
GATEWAY=192.168.1.1 # Default Gateway
DNS1=209.244.0.4
DNS2=8.8.8.8
IPV6INIT=no

# service network status
Configured devices:
lo Ariq_kabel ifcfg-Auto_Toruan's_Speedy ifcfg-wlan0 wlan0
Currently active devices:
lo Ariq_kabel wlan0

#ifconfig
Ariq_kabel Link encap:Ethernet HWaddr 94:DE:80:96:36:32
inet addr:192.168.1.105 Bcast:192.168.1.255 Mask:255.255.255.0
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)

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:65536 Metric:1
RX packets:2253 errors:0 dropped:0 overruns:0 frame:0
TX packets:2253 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:244092 (238.3 KiB) TX bytes:244092 (238.3 KiB)

wlan0 Link encap:Ethernet HWaddr 78:54:2E:EA:4D:24
inet addr:192.168.1.46 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::7a54:2eff:feea:4d24/64 Scope:Link
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:2966 errors:0 dropped:0 overruns:0 frame:0
TX packets:329 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:905418 (884.1 KiB) TX bytes:46238 (45.1 KiB)

#cat /etc/resolv.conf
# Generated by NetworkManager
search toruan


# No nameservers found; try putting DNS servers into your
# ifcfg files in /etc/sysconfig/network-scripts like so:
#
# DNS1=xxx.xxx.xxx.xxx
# DNS2=xxx.xxx.xxx.xxx
# DOMAIN=lab.foo.com bar.foo.com
nameserver 209.244.0.4
nameserver 8.8.8.8
nameserver 8.8.4.4

# ip route show
192.168.1.0/24 dev Ariq_kabel proto kernel scope link src 192.168.1.105
192.168.1.0/24 dev wlan0 proto kernel scope link src 192.168.1.46
169.254.0.0/16 dev Ariq_kabel scope link metric 1002
169.254.0.0/16 dev wlan0 scope link metric 1003
default via 192.168.1.1 dev Ariq_kabel

User avatar
TrevorH
Site Admin
Posts: 33219
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: can't reach default gateway

Post by TrevorH » 2015/07/05 10:08:28

You've got two interfaces on the same subnet and it looks like it's using Ariq_kabel to try to talk to everything and failing. What is that?
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

fxtoruan@bit.net.id
Posts: 27
Joined: 2015/02/14 06:53:18

Re: can't reach default gateway

Post by fxtoruan@bit.net.id » 2015/07/06 06:57:50

I think i don't have 2 interface. I just have 1 interface, but can boot under win and under centos. Following is the configuration under win.

# ipconfig /all

Windows IP Configuration

Host Name . . . . . . . . . . . . : fx-toruan
Primary Dns Suffix . . . . . . . :
Node Type . . . . . . . . . . . . : Hybrid
IP Routing Enabled. . . . . . . . : No
WINS Proxy Enabled. . . . . . . . : No

Wireless LAN adapter Wireless Network Connection 2:

Media State . . . . . . . . . . . : Media disconnected
Connection-specific DNS Suffix . :
Description . . . . . . . . . . . : Microsoft Virtual WiFi Miniport Adapter
Physical Address. . . . . . . . . : 78-54-2E-EA-4D-25
DHCP Enabled. . . . . . . . . . . : Yes
Autoconfiguration Enabled . . . . : Yes

Wireless LAN adapter Wireless Network Connection:

Connection-specific DNS Suffix . :
Description . . . . . . . . . . . : D-Link DWA-525 Wireless N 150 Desktop Adapter(rev.A2)
Physical Address. . . . . . . . . : 78-54-2E-EA-4D-24
DHCP Enabled. . . . . . . . . . . : Yes
Autoconfiguration Enabled . . . . : Yes
Link-local IPv6 Address . . . . . : fe80::1461:aa72:3ace:647e%10(Preferred)
IPv4 Address. . . . . . . . . . . : 192.168.1.46(Preferred)
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Lease Obtained. . . . . . . . . . : Monday, July 06, 2015 12:59:03 PM
Lease Expires . . . . . . . . . . : Monday, July 06, 2015 1:59:03 PM
Default Gateway . . . . . . . . . : 192.168.1.1
DHCP Server . . . . . . . . . . . : 192.168.1.1
DHCPv6 IAID . . . . . . . . . . . : 242766894
DHCPv6 Client DUID. . . . . . . . : 00-01-00-01-1B-61-7D-79-78-54-2E-EA-4D-24
DNS Servers . . . . . . . . . . . : 192.168.1.1
NetBIOS over Tcpip. . . . . . . . : Enabled

# route print
===========================================================================
Interface List
16...78 54 2e ea 4d 25 ......Microsoft Virtual WiFi Miniport Adapter
10...78 54 2e ea 4d 24 ......D-Link DWA-525 Wireless N 150 Desktop Adapter(rev.A2)
1...........................Software Loopback Interface 1
===========================================================================

IPv4 Route Table
===========================================================================
Active Routes:
Network Destination Netmask Gateway Interface Metric
0.0.0.0 0.0.0.0 192.168.1.1 192.168.1.46 25
127.0.0.0 255.0.0.0 On-link 127.0.0.1 306
127.0.0.1 255.255.255.255 On-link 127.0.0.1 306
127.255.255.255 255.255.255.255 On-link 127.0.0.1 306
192.168.1.0 255.255.255.0 On-link 192.168.1.46 281
192.168.1.46 255.255.255.255 On-link 192.168.1.46 281
192.168.1.255 255.255.255.255 On-link 192.168.1.46 281
224.0.0.0 240.0.0.0 On-link 127.0.0.1 306
224.0.0.0 240.0.0.0 On-link 192.168.1.46 281
255.255.255.255 255.255.255.255 On-link 127.0.0.1 306
255.255.255.255 255.255.255.255 On-link 192.168.1.46 281
===========================================================================
Persistent Routes:
None

IPv6 Route Table
===========================================================================
Active Routes:
If Metric Network Destination Gateway
1 306 ::1/128 On-link
10 281 fe80::/64 On-link
10 281 fe80::1461:aa72:3ace:647e/128
On-link
1 306 ff00::/8 On-link
10 281 ff00::/8 On-link
===========================================================================
Persistent Routes:
None

# ping 192.168.1.105 -n 1

Pinging 192.168.1.105 with 32 bytes of data:
Reply from 192.168.1.46: Destination host unreachable.

Ping statistics for 192.168.1.105:
Packets: Sent = 1, Received = 1, Lost = 0 (0% loss),


Under Win, i can ping to 192.168.1.46, 192.168.1.1, and out to the world. But, can't ping to 192.168.1.105 ( as above ).
Under Centos, i can ping to 192.168.1.46 only. But, can't reach 192.168.1.1. (192.168.1.105 is also DHU)

What's wrong? How should i change the configuration?

User avatar
TrevorH
Site Admin
Posts: 33219
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: can't reach default gateway

Post by TrevorH » 2015/07/06 07:31:28

What is this then?
#ifconfig
Ariq_kabel Link encap:Ethernet HWaddr 94:DE:80:96:36:32
inet addr:192.168.1.105 Bcast:192.168.1.255 Mask:255.255.255.0
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

fxtoruan@bit.net.id
Posts: 27
Joined: 2015/02/14 06:53:18

Re: can't reach default gateway

Post by fxtoruan@bit.net.id » 2015/07/07 13:21:55

yes, you're right. i forgot the previous configuration when i accessed the web through a provider. so, i just unplugged the lan wire, and use the wifi device, and voila the connection is ok. my present configuration is as follows.

# cat /etc/sysconfig/network
cat /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=fx.toruan

# cat /etc/sysconfig/network-scripts/ifcfg-wlan0
DEVICE=wlan0
HWADDR=78:54:2e:ea:4d:24
NM_CONTROLLED=yes
ONBOOT=yes
BOOTPROTO=none
IPADDR='192.168.1.46 '
NETMASK='255.255.255.0 '
GATEWAY='192.168.1.1 '
DNS1=209.244.0.4
DNS2=8.8.8.8
IPV6INIT=no
TYPE=Wireless
USERCTL=no

# cat /etc/sysconfig/network-scripts/ifcfg-wifi
# Please read /usr/share/doc/initscripts-*/sysconfig.txt
# for the documentation of these parameters.
GATEWAY=192.168.1.1
DNS1=209.244.0.4
DEVICE=wlan0
BOOTPROTO=none
NETMASK=255.255.255.0
DNS2=8.8.8.8
TYPE=Ethernet
HWADDR=78:54:2e:ea:4d:24
IPADDR=192.168.1.46
IPV6INIT=no
ONBOOT=no
USERCTL=no

# service network status
Configured devices:
lo Ariq_kabel ifcfg-Auto_Toruan's_Speedy wifi wlan0
Currently active devices:
lo Ariq_kabel wlan0

# ifconfig
Ariq_kabel Link encap:Ethernet HWaddr 94:DE:80:96:36:32
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)

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:65536 Metric:1
RX packets:203 errors:0 dropped:0 overruns:0 frame:0
TX packets:203 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:17020 (16.6 KiB) TX bytes:17020 (16.6 KiB)

wlan0 Link encap:Ethernet HWaddr 78:54:2E:EA:4D:24
inet addr:192.168.1.47 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::7a54:2eff:feea:4d24/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:2177 errors:0 dropped:0 overruns:0 frame:0
TX packets:474 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:598827 (584.7 KiB) TX bytes:63550 (62.0 KiB)

# cat /etc/resolv.conf
# Generated by NetworkManager
search toruan
nameserver 209.244.0.4
nameserver 8.8.8.8
nameserver 8.8.4.4

# ip route show
192.168.1.0/24 dev wlan0 proto kernel scope link src 192.168.1.47 metric 2
default via 192.168.1.1 dev wlan0 proto static

but, i still don't understand why the ip is now 192.168.1.47 instead of 192.168.1.46 as written in the network script. could you give me some explanation of this? i also find incomprehensible the following message ( when i kick 'service network restart' ) . . .

# service network restart
fgrep: ifcfg-ifcfg-Auto_Toruan's_Speedy: No such file or directory
fgrep: ifcfg-ifcfg-Auto_Toruan's_Speedy: No such file or directory
/etc/init.d/network: line 206: ./ifcfg-ifcfg-Auto_Toruan's_Speedy: No such file or directory
Shutting down interface ifcfg-Auto_Toruan's_Speedy: /etc/sysconfig/network-scripts/ifcfg-Auto_Toruan's_Speedy: line 12: unexpected EOF while looking for matching `"'
/etc/sysconfig/network-scripts/ifcfg-Auto_Toruan's_Speedy: line 19: syntax error: unexpected end of file
/etc/sysconfig/network-scripts/ifcfg-Auto_Toruan's_Speedy: line 12: unexpected EOF while looking for matching `"'
/etc/sysconfig/network-scripts/ifcfg-Auto_Toruan's_Speedy: line 19: syntax error: unexpected end of file
/etc/sysconfig/network-scripts/ifcfg-Auto_Toruan's_Speedy: line 12: unexpected EOF while looking for matching `"'
/etc/sysconfig/network-scripts/ifcfg-Auto_Toruan's_Speedy: line 19: syntax error: unexpected end of file
/etc/sysconfig/network-scripts/ifcfg-Auto_Toruan's_Speedy: line 19: warning: syntax errors in . or eval will cause future versions of the shell to abort as Posix requires
ERROR : [ipv6_test_device_status] Missing parameter 'device' (arg 1)
/etc/sysconfig/network-scripts/ifcfg-Auto_Toruan's_Speedy: line 12: unexpected EOF while looking for matching `"'
/etc/sysconfig/network-scripts/ifcfg-Auto_Toruan's_Speedy: line 19: syntax error: unexpected end of file
/etc/sysconfig/network-scripts/ifcfg-Auto_Toruan's_Speedy: line 19: warning: syntax errors in . or eval will cause future versions of the shell to abort as Posix requires
[ OK ]
Shutting down interface wifi: Device state: 3 (disconnected)
[ OK ]
Shutting down interface wlan0: [ OK ]
Shutting down loopback interface: [ OK ]
Bringing up loopback interface: [ OK ]
fgrep: ifcfg-ifcfg-Auto_Toruan's_Speedy: No such file or directory
fgrep: ifcfg-ifcfg-Auto_Toruan's_Speedy: No such file or directory
fgrep: ifcfg-ifcfg-Auto_Toruan's_Speedy: No such file or directory
egrep: ifcfg-ifcfg-Auto_Toruan's_Speedy: No such file or directory
Bringing up interface ifcfg-Auto_Toruan's_Speedy: /etc/sysconfig/network-scripts/ifcfg-Auto_Toruan's_Speedy: line 12: unexpected EOF while looking for matching `"'
/etc/sysconfig/network-scripts/ifcfg-Auto_Toruan's_Speedy: line 19: syntax error: unexpected end of file
/etc/sysconfig/network-scripts/ifcfg-Auto_Toruan's_Speedy: line 12: unexpected EOF while looking for matching `"'
/etc/sysconfig/network-scripts/ifcfg-Auto_Toruan's_Speedy: line 19: syntax error: unexpected end of file
Device does not seem to be present, delaying initialization.
[FAILED]
Bringing up interface wlan0: Determining if ip address 192.168.1.46 is already in use for device wlan0...

and why i can't delete old files from /etc/sysconfig/network-scripts . . . (i think we need only 2 scripts for 2 devices/interfaces, the others are previous/unused scripts)

ls /etc/sysconfig/network-scripts/
ifcfg-Auto_Toruan's_Speedy ifdown-sit ifup-routes
ifcfg-lo ifdown-tunnel ifup-sit
ifcfg-wifi ifup ifup-tunnel
ifcfg-wlan0 ifup-aliases ifup-wireless
ifdown ifup-bnep init.ipv6-global
ifdown-bnep ifup-eth keys-Auto_Toruan's_Speedy
ifdown-eth ifup-ippp keys-wlan0
ifdown-ippp ifup-ipv6 net.hotplug
ifdown-ipv6 ifup-isdn network-functions
ifdown-isdn ifup-plip network-functions-ipv6
ifdown-post ifup-plusb route-System_eth0
ifdown-ppp ifup-post
ifdown-routes ifup-ppp

Post Reply