[CentOS] USB to Ethernet problem

Tue Mar 18 10:35:49 UTC 2014
Giri Prasad <g_pr23 at yahoo.com>

On 18/03/14 19:49, Giri Prasad wrote:

>> Now, after assigning a static IPV4 address, this eth1 is pinging to the default gateway 192.168.1.1. But eth1 is not pinging/connecting to the external internet. Can someone please provide some answers.
>>
>>

>Can you ping an IP Address - such as 8.8.8.8?

>If you can, then most likely a DNS config issue!  Since you mention you 
had to assign an IP Address manually, the file /etc/resolv.conf may not 
have the necessary DNS info to resolve Internet names!


No, I am not able to ping to an external ip like 8.8.8.8. Following are the details:

#cat /etc/resolv.conf 
# Generated by NetworkManager
search cruzesoft.com
nameserver 192.168.1.1


# 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


#cat /etc/sysconfig/network
NETWORKING=yes
NETWORKING_IPV6=no
HOSTNAME=gpcentospc1.cruzesoft.com
GATEWAY=192.168.1.1

# ifconfig
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:12 errors:0 dropped:0 overruns:0 frame:0
          TX packets:12 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:720 (720.0 b)  TX bytes:720 (720.0 b)

# insmod asix.ko

# ifconfig
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:12 errors:0 dropped:0 overruns:0 frame:0
          TX packets:12 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:720 (720.0 b)  TX bytes:720 (720.0 b)

# ping 192.168.1.1
connect: Network is unreachable

#ifconfig eth1 192.168.1.20 netmask 255.255.255.0 broadcast 192.168.1.255

#ifconfig
eth1      Link encap:Ethernet  HWaddr 00:00:00:00:00:01  
          inet addr:192.168.1.20  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::200:ff:fe00:1/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1 errors:0 dropped:0 overruns:0 frame:0
          TX packets:3 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:64 (64.0 b)  TX bytes:250 (250.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:12 errors:0 dropped:0 overruns:0 frame:0
          TX packets:12 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:720 (720.0 b)  TX bytes:720 (720.0 b)


 #ping 192.168.1.1
PING 192.168.1.1 (192.168.1.1) 56(84) bytes of data.
64 bytes from 192.168.1.1: icmp_seq=1 ttl=254 time=3.89 ms
64 bytes from 192.168.1.1: icmp_seq=2 ttl=254 time=1.89 ms
64 bytes from 192.168.1.1: icmp_seq=3 ttl=254 time=1.80 ms
64 bytes from 192.168.1.1: icmp_seq=4 ttl=254 time=1.94 ms
^C
--- 192.168.1.1 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3432ms
rtt min/avg/max/mdev = 1.800/2.383/3.897/0.875 ms

 
# ping google.com
connect: Network is unreachable


# ping google.com
connect: Network is unreachable


# route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.1.0     *               255.255.255.0   U     0      0        0 eth1

# ping 8.8.8.8
connect: Network is unreachable


# route add default gw 192.168.1.1

# route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         192.168.1.1     0.0.0.0         UG    0      0        0 eth1
192.168.1.0     *               255.255.255.0   U     0      0        0 eth1



# ping 192.168.1.1
PING 192.168.1.1 (192.168.1.1) 56(84) bytes of data.
64 bytes from 192.168.1.1: icmp_seq=1 ttl=254 time=1.94 ms
64 bytes from 192.168.1.1: icmp_seq=2 ttl=254 time=1.91 ms
64 bytes from 192.168.1.1: icmp_seq=3 ttl=254 time=1.88 ms
64 bytes from 192.168.1.1: icmp_seq=4 ttl=254 time=1.94 ms
^C
--- 192.168.1.1 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3365ms
rtt min/avg/max/mdev = 1.884/1.922/1.945/0.024 ms


# ping google.com
PING google.com (74.125.236.195) 56(84) bytes of data.
^C
--- google.com ping statistics ---
14 packets transmitted, 0 received, 100% packet loss, time 13833ms



# ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
^C
--- 8.8.8.8 ping statistics ---
18 packets transmitted, 0 received, 100% packet loss, time 17372ms



# ls /etc/sysconfig/network-scripts/ifcfg-*
/etc/sysconfig/network-scripts/ifcfg-lo



# dmesg | tail -10
[   93.800319] asix 1-1.1:1.0: usb_probe_interface - got id
[   93.800335] ASIX USB Ethernet Adapter:v4.12.0 18:32:04 Mar 18 2014
[   93.800335]     http://www.asix.com.tw
[   94.427358] eth%d: status ep1in, 8 bytes period 11
[   94.427749] eth0: register 'asix' at usb-0000:00:1a.0-1.1, ASIX AX88772B USB 2.0 Ethernet, 00:00:00:00:00:01
[   94.429348] usbcore: registered new interface driver asix
[  173.849024] usb 1-1.1: link qh128-0001/ffff880214aa7100 start 3 [1/0 us]
[  173.849069] eth1: rxqlen 0 --> 5
[  173.886479] eth1: ax88772b - Link status is: 0
[  174.014618] eth1: ax88772b - Link status is: 1
[root at gpcentospc1 AX88772C_772B_772A_760_772_178_LINUX_DRIVER_v4.12.0_Source]#