[SOLVED] USB ethernet card not working

[SOLVED] USB ethernet card not working

Postby asimov-solensan » Mar 11th, '18, 11:06

Hello,

Y bought one of those ethernet+usb hub devices for my laptop.

The card seems to be correctly detected by the system. It gets a DHCP address from my firewall and all but the it's as if had no network at all. Can't get even to the gateway. Only can see localhost.

The wifi is already set off an the only configured device is this card, here is the ifconfig output:
Code: Select all
[root@charcoal asimov]# ifconfig
enp0s20f0u4u4: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.16.244  netmask 255.255.255.0  broadcast 192.168.16.255
        inet6 fe80::2e0:4cff:fe30:eed2  prefixlen 64  scopeid 0x20<link>
        ether 00:e0:4c:30:ee:d2  txqueuelen 1000  (Ethernet)
        RX packets 13  bytes 2220 (2.1 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 22  bytes 2870 (2.8 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

enp1s0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        ether 00:16:96:e7:04:7e  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 17168  bytes 1140822 (1.0 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 17168  bytes 1140822 (1.0 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

wlp2s0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        ether 62:d0:f0:b9:b0:32  txqueuelen 1000  (Ethernet)
        RX packets 4171848  bytes 6297730104 (5.8 GiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 1077273  bytes 103281969 (98.4 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

[root@charcoal asimov]#


Ignore enp1s0 this is the built in interface and I won't use it because is only 100Mbps.

Routes and all are ok:

Code: Select all
[root@charcoal asimov]# ip route
default via 192.168.16.1 dev enp0s20f0u4u4 proto static metric 100
192.168.16.0/24 dev enp0s20f0u4u4 proto kernel scope link src 192.168.16.244 metric 100
[root@charcoal asimov]#


Can't ping anywhere but localhost:

Code: Select all
[root@charcoal asimov]# ping 192.168.16.1
PING 192.168.16.1 (192.168.16.1) 56(84) bytes of data.
From 192.168.16.244 icmp_seq=1 Destination Host Unreachable
ping: sendmsg: Operación no permitida
From 192.168.16.244 icmp_seq=2 Destination Host Unreachable
ping: sendmsg: Operación no permitida
^C
--- 192.168.16.1 ping statistics ---
2 packets transmitted, 0 received, +2 errors, 100% packet loss, time 1018ms

[root@charcoal asimov]#


When using built in wifi or cable everything works to the firewall and beyond:

Code: Select all
[root@charcoal asimov]# ping 192.168.16.1
PING 192.168.16.1 (192.168.16.1) 56(84) bytes of data.
64 bytes from 192.168.16.1: icmp_seq=1 ttl=64 time=2.06 ms
64 bytes from 192.168.16.1: icmp_seq=2 ttl=64 time=2.11 ms
^C
--- 192.168.16.1 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1001ms
rtt min/avg/max/mdev = 2.061/2.089/2.117/0.028 ms
[root@charcoal asimov]#


I have tested the device in other computers and worked pretty well. But on both of my mageia6 machines fails miserably. I'm using NetworkManager by the way, maybe ot has something to do, but since I can't use my VPN with mga_applet I'm stuck with it.

Any advice is welcome.
Last edited by asimov-solensan on Mar 14th, '18, 11:10, edited 1 time in total.
asimov-solensan
 
Posts: 64
Joined: Sep 15th, '12, 21:43

Re: USB ethernet card not working

Postby jiml8 » Mar 11th, '18, 21:20

What does your arp table say?

As root, run the command "arp -a" and post the results. (without the quotes, of course)

If you are switching back and forth between this USB device and wifi, maybe your arp table is wrong.
jiml8
 
Posts: 1253
Joined: Jul 7th, '13, 18:09

Re: USB ethernet card not working

Postby asimov-solensan » Mar 13th, '18, 10:45

Can't test now, at least on my laptop. But I don't think the problem was there.

It seems that after rebooting the computer with the card attached it began to work. Now I can connect and disconnect and it works always.

Since the error was an operation not permitted I did a bit of research and seemed to be related to iptables, and indeed, shorewall is creating rules per device. And it seems to me that it creates the rules on the boot process. I bet that if I connect this card through a hub or something and the name changes It won't work again. It may be that rules created on boot are permanent, no matter if the card is still present on future boots.

Right now I have got an older desktop that I remember having the same problem with a wifi usb card and never solved it. I can test this same card on that computer and see what happens, that way I can confirm that indeed this was the case.
asimov-solensan
 
Posts: 64
Joined: Sep 15th, '12, 21:43

Re: USB ethernet card not working

Postby jiml8 » Mar 13th, '18, 18:06

Rules created on boot are certainly permanent.

I personally stopped using shorewall; it is very complicated and I find many of its behaviors to be obscure. I just wrote my own firewall using iptables, and I invoke it as a systemd service on startup. Easier for me to understand, and easy enough for me to modify at need.

Glad you got it working.
jiml8
 
Posts: 1253
Joined: Jul 7th, '13, 18:09

Re: USB ethernet card not working

Postby asimov-solensan » Mar 14th, '18, 11:00

I checked on my desktop and was exactly as I suspected.
I connect the USB card and got a new device

Code: Select all
enp0s2f1u7u4: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        ether 00:e0:4c:30:ee:d2  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0


This device got no rules.

Code: Select all
[root@black asimov]# iptables -L |grep enp0s2f1u7u4
[root@black asimov]#                         


It gets address and all but can't access network.

Now I reboot with the card connected. And this time new rules appear.
Code: Select all
[root@black asimov]# iptables -L |grep enp0s2f1u7u4
enp0s2f1u7u4_in  all  --  anywhere             anywhere           
enp0s2f1u7u4_fwd  all  --  anywhere             anywhere           
enp0s2f1u7u4_out  all  --  anywhere             anywhere           
Chain enp0s2f1u7u4_fwd (1 references)
Chain enp0s2f1u7u4_in (1 references)
Chain enp0s2f1u7u4_out (1 references)
[root@black asimov]#                                   


I reboot with the card disconnected and rules are still there. If I connect the card it will work as it happened with my laptop.

Then if I use a different USB port i get a new device name.
Code: Select all
enp0s2f1u8u4: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.16.240  netmask 255.255.255.0  broadcast 192.168.16.255
        inet6 fe80::2e0:4cff:fe30:eed2  prefixlen 64  scopeid 0x20<link>
        ether 00:e0:4c:30:ee:d2  txqueuelen 1000  (Ethernet)
        RX packets 3  bytes 744 (744.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 9  bytes 1590 (1.5 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0


And same story again.

I solved the problem but this deserves a bug because it's not what a user expects, specially when using wireless cards which may be a more common case. I will open it later.

I agree with you, I can't understand shorewall just by looking at the iptables output. But this kind of things is happening with all linux ecosystem. Can't know exactly way, maybe I'm getting old and can't catch with the changes.
But the thing is that everyday I see new features and my feeling is that they only hide things under the hood, don't know others but nowadays I feel using linux (and I talk about a few distros) as I feel using windows. A lot of things are happening and I don't have a way to know what's going on and how to change it. Now it seems I need to reboot my computer to install a USB card? This doesn't feel like the OS I have been using for the last 15 years.
asimov-solensan
 
Posts: 64
Joined: Sep 15th, '12, 21:43

Re: [SOLVED] USB ethernet card not working

Postby jiml8 » Mar 15th, '18, 20:27

One word.

Systemd. :twisted:

:x
jiml8
 
Posts: 1253
Joined: Jul 7th, '13, 18:09

Re: [SOLVED] USB ethernet card not working

Postby jiml8 » Mar 15th, '18, 20:33

You also could modify your rules to have a default "pass all" as the last rule. Then, when you plug in the USB device and it finds no rule, it winds up at the end of the list and the default rule allows it to work.

Of course, there are implications to this that you need to consider carefully.

You might also fiddle with udev so that you give the specific device a known interface name when it is connected, then set up rules for that device whether or not it is connected. This would probably wind up being a systemd service, but you would run it on every startup and it would take care of this device.
jiml8
 
Posts: 1253
Joined: Jul 7th, '13, 18:09

Re: [SOLVED] USB ethernet card not working

Postby asimov-solensan » Mar 16th, '18, 13:04

jiml8 wrote:One word.

Systemd. :twisted:

:x


I try to understand why systemd has been so widely adopted, and I try and try to think that we are just on a transition time and I just must adapt and forget old habits. And I just can't, every time I must fiddle with systemd and its consequences I end up angry and frustrated. Last experience was with netplan and systemd-resolved on an ubuntu test machine. How did they messed so much a task that was as simple as editing two files? Lately I just feel lost and not on the mood to expend so much time digging in this kind of things. My feelings can be summarized as: Come on linux, you used to be cool.

Thanks for the suggestion about creating a new rule. I might think about it but the "workaround" is enough for the moment.
asimov-solensan
 
Posts: 64
Joined: Sep 15th, '12, 21:43


Return to Networking

Who is online

Users browsing this forum: No registered users and 1 guest

cron