Unable to get USB ethernet to work

I plugged an ethernet cable in and did:

sudo dhclient eth2

That worked and it showed the connection. I was connected and got an ipaddress:


#This shows eth2 as 192.168.1.172
/sbin/ifconfig

But when I ping or use a browser, I get no internet connection (or unknown host).

What do i need to do to get this working?

openSUSE 42.1
KDE
Lenovo X1 Carbon 4th gen
Anker USB-to-Ethernet

Hi
Check the contents of /etc/resolv.conf it’s either not updated or populated, or check that you have a default gateway.

Why not use wicked or NetworkManager?

How do i do it in Network manager?

The USB-connected network device will show up with a network device node. NM has a connection editor that should then allow you to configure it.

Refer to the Leap documentation…
https://doc.opensuse.org/documentation/leap/reference/html/book.opensuse.reference/cha.nm.html#sec.nm.configure

I originally tried using that but couldn’t get it to work either

Can you show it was defined in /etc/NetworkManager/system-connections/? That might help others advise further.

Also, the following…

nmcli d
nmcli g
DEVICE  TYPE      STATE        CONNECTION    
eth2    ethernet  connected    Test Ethernet  
wlan0   wifi      connected    Main-Wifi      
eth0    ethernet  unavailable  --            
lo      loopback  unmanaged    --         

STATE      CONNECTIVITY  WIFI-HW  WIFI     WWAN-HW  WWAN     
connected  full          enabled  enabled  enabled  enabled

[QUOTE=6tr6tr;2794392]

DEVICE  TYPE      STATE        CONNECTION    
eth2    ethernet  connected    Test Ethernet  
wlan0   wifi      connected    Main-Wifi      
eth0    ethernet  unavailable  --            
lo      loopback  unmanaged    --         

So, I see that eth2 is connected. Are you using DHCP or static IP addressing? It would be useful to see the following when connected by this device

ip add
ip route
grep "name" /etc/resolv.conf

You can use the following to see which connection is active

nmci c

and it would be useful to see the actual connection configuration (the active one) which is located in the /etc/NetworkManager/system-connections/ directory.


#ip add
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: wlan0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN group default qlen 1000
    link/ether 44:d3:18:7d:34:48 brd ff:ff:ff:ff:ff:ff
3: eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast state DOWN group default qlen 1000
    link/ether 54:e3:71:9f:d5:68 brd ff:ff:ff:ff:ff:ff
4: eth2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 01:e0:1f:7b:05:e3 brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.171/24 brd 192.168.1.255 scope global eth2
       valid_lft forever preferred_lft forever
    inet6 fe80::2e0:1eff:fe7a:5d4/64 scope link 
       valid_lft forever preferred_lft forever


#ip route
default via 192.168.1.23 dev eth2  proto static  metric 100 
192.168.1.0/24 dev eth2  proto kernel  scope link  src 192.168.1.171  metric 100


#grep "name" /etc/resolv.conf (was empty)




#nmci c
If 'nmci' is not a typo you can use command-not-found to lookup the package that contains it, like this:
    cnf nmci

[quote="“deano_ferrari,post:8,topic:121212”]

THANK YOU! Somehow, the ip was being hard coded. When I switched it to dhcp, it now works!

Glad to have been of help! See, it’s simple. :slight_smile:

BTW, that last command should have been ‘nmcli c’.