Network card/config question. Ports independent? Debian.

Post Reply
smag
Posts: 5
Joined: Tue Jan 12, 2021 12:31 am
languages_spoken: english
Has thanked: 0
Been thanked: 0
Contact:

Network card/config question. Ports independent? Debian.

Post by smag »

I am new to the topic of Odroid and also new to Debian. I purchased a H2+ and have set it up with a 1TB m2 card and 2x16 gig sodimms. After a few false starts I finally got Debian 10 installed.

Currently I am having an issue with the network which I don't understand. I am not a network person so that doesn't help.

My two network ports show up as enp2s0 and enp3s0. The ports are above the usb2 and usb3 ports respectively. When both are plugged in at boot, both IP addresses respond. When enp3s0 is unplugged , enp2s0 continues to function as expected and both IP addresses respond. When this is reversed with enp2s0 unplugged and enp3s0 plugged in, neither port works regardless of whether I configure the ports as static or dynamic. Putting both cables back in recovers the position. It seems like enp2s0 is primary and required for both to work.

I can boot with just enp3s0 plugged in and this works but enp2s0 does not come up when plugged in after boot.

Is this the expected scenario?
If not, is it due to an incorrect entry in "interfaces" or something quite different.

Any help appreciated.

Thanks

misaz
Posts: 81
Joined: Sat Jul 27, 2019 3:58 am
languages_spoken: english, czech
ODROIDs: H2+
Has thanked: 7 times
Been thanked: 15 times
Contact:

Re: Network card/config question. Ports independent? Debian.

Post by misaz »

Both are totaly independent. Paste your /etc/networking/interfaces, and output of following commands:

Code: Select all

ip a
ip l

smag
Posts: 5
Joined: Tue Jan 12, 2021 12:31 am
languages_spoken: english
Has thanked: 0
Been thanked: 0
Contact:

Re: Network card/config question. Ports independent? Debian.

Post by smag »

Output as requested below.

Summary of testing. When both cables are plugged in, both IP addresses work as expected.
When one cable is plugged in, the port with the oldest dhcp address (enp3s0 in the output) will respond to a ping.
Switch the cable to the port with newer dhcp address, and there is no response.

The gateway is generated by default.

ip a output

--------------++++++++++++---------------
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
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: enp2s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
link/ether 00:1e:06:45:54:b6 brd ff:ff:ff:ff:ff:ff
inet xx.xx.xx.114/24 brd xx.xx.xx.255 scope global dynamic enp2s0
valid_lft 42208sec preferred_lft 42208sec
inet6 fe80::21e:6ff:fe45:54b6/64 scope link
valid_lft forever preferred_lft forever

3: enp3s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
link/ether 00:1e:06:45:54:b7 brd ff:ff:ff:ff:ff:ff
inet xx.xx.xx.115/24 brd xx.xx.xx.255 scope global dynamic enp3s0
valid_lft 42206sec preferred_lft 42206sec
inet6 fe80::21e:6ff:fe45:54b7/64 scope link
valid_lft forever preferred_lft forever
--------------++++++++++++---------------



ip l output

--------------++++++++++++---------------
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: enp2s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DEFAULT group default qlen 1000
link/ether 00:1e:06:45:54:b6 brd ff:ff:ff:ff:ff:ff
3: enp3s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DEFAULT group default qlen 1000
link/ether 00:1e:06:45:54:b7 brd ff:ff:ff:ff:ff:ff
--------------++++++++++++---------------


Thanks.
Any explanations appreciated.


/etc/network/interfaces

--------------++++++++++++---------------
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

source /etc/network/interfaces.d/*

# The loopback network interface
auto lo
iface lo inet loopback


# 1st network port above usb2
allow-hotplug enp2s0
iface enp2s0 inet dhcp

# 2nd network port above usb3
allow-hotplug enp3s0
iface enp3s0 inet dhcp

mad_ady
Posts: 9049
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, C4, N1, N2, H2, Go, Go Advance
Location: Bucharest, Romania
Has thanked: 595 times
Been thanked: 573 times
Contact:

Re: Network card/config question. Ports independent? Debian.

Post by mad_ady »

I'm guessing you have both nics plugged into the same layer 2 lan, right? Unless you're using public ips, excess anonymization hurts the troubleshooting process :)

Show us also the output of ip route show in these cases:
- both cables connected
- first nic disconnected, second connected
- first nic connected, second disconnected

Most likely there's a routing issue, or some stale ARP entries, or using the offline ip somewhere...

smag
Posts: 5
Joined: Tue Jan 12, 2021 12:31 am
languages_spoken: english
Has thanked: 0
Been thanked: 0
Contact:

Re: Network card/config question. Ports independent? Debian.

Post by smag »

Thanks mad_ady,

I expect that routing must have something to do with it. Unfortunately my knowledge of networking does not extend beyond setting ip addresses and using ping. :-)


Correct regarding the lan. I have a simple 8-port switch plugged into my dsl router which supplies the dhcp address. There is a single cable connection between those two. So I am generally using the NAT address from the dsl router.

As requested:

both cables connected

default via 172.16.17.1 dev enp3s0
172.16.17.0/24 dev enp3s0 proto kernel scope link src 172.16.17.34
172.16.17.0/24 dev enp2s0 proto kernel scope link src 172.16.17.35


first nic disconnected, second connected

default via 172.16.17.1 dev enp3s0
172.16.17.0/24 dev enp3s0 proto kernel scope link src 172.16.17.34
172.16.17.0/24 dev enp2s0 proto kernel scope link src 172.16.17.35 linkdown

second nic disconnected, first connected

default via 172.16.17.1 dev enp3s0 linkdown
172.16.17.0/24 dev enp3s0 proto kernel scope link src 172.16.17.34 linkdown
172.16.17.0/24 dev enp2s0 proto kernel scope link src 172.16.17.35


enp2s0 is the first nic.
enp3s0 is the second nic.





The mystery deepens. :-) One curious thing happened. After I had disconnected and reconnected both cables a number of times my ping eventually starting responding to to pings on both addresses via enp2s0 with enp3s0 disconnected. I don't know how many connect/disconnect cycles it took before that happened. When it happened the 2nd ip address began responding after about 15 seconds, not immediately. I repeat the complete test a number of times. Results the same. I cleared the arp entries on the machine I was ping from a couple of times as well.


Ping from a MacOSX 10.13.4.
DSL router is an Askey RTF3505VW
D-Link DGS-1008D


Thanks for any info.


Simon

mad_ady
Posts: 9049
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, C4, N1, N2, H2, Go, Go Advance
Location: Bucharest, Romania
Has thanked: 595 times
Been thanked: 573 times
Contact:

Re: Network card/config question. Ports independent? Debian.

Post by mad_ady »

I find two things odd.
First - there is only one default gateway, not two. Most likely it's a protection issue caused by NetworkManager...
Second - when a link goes down the routes are not deleted immediately, but go through a linkdown state. I haven't seen this before...

I'd try adding metrics for both interfaces, so that one is primary and the other is secondary:

Code: Select all

# 1st network port above usb2
allow-hotplug enp2s0
iface enp2s0 inet dhcp
metric 1

# 2nd network port above usb3
allow-hotplug enp3s0
iface enp3s0 inet dhcp
metric 2
These users thanked the author mad_ady for the post:
odroid (Fri Jan 15, 2021 5:53 pm)

smag
Posts: 5
Joined: Tue Jan 12, 2021 12:31 am
languages_spoken: english
Has thanked: 0
Been thanked: 0
Contact:

Re: Network card/config question. Ports independent? Debian.

Post by smag »

I tested using the interfaces file with the added metric as shown in the example.

That killed the computer's network completely. :lol:
(I put back the "working" config.)

It did not pick up any dhcp address. I tested with a metric on both cards as in the example and then with it on just one card (tried both). I tried rebooting after the changes as well as stopping and starting the network with systemctl.

It is very likely I am missing something totally obvious but as I know so little about the networks I have no way of judging just how ignorant I am. :-)

The background to wanting to get my network under control is that I am going to use this as host for a couple of virtual machines under qemu/kvm.




I had a closer look at my dsl router. It has vlan support but there is no obvious documentation for it. The interface suggests that each of the 4 lan ports can be assigned a single vlan. However, I haven't tried that yet as I need to plan a time slot with the family in case I screw it up and have to reset it. Additionally, the router is not near where I have my Odroid, and the d-link I am connected to is a very simple unmanaged unit. Anyway, that is just thinking out loud and a different issue.

mad_ady
Posts: 9049
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, C4, N1, N2, H2, Go, Go Advance
Location: Bucharest, Romania
Has thanked: 595 times
Been thanked: 573 times
Contact:

Re: Network card/config question. Ports independent? Debian.

Post by mad_ady »

If you're planning to use vlans, then you'll have different address pools, and most likely this won't be an issue anymore.
The router should support "tagged" vlans, but cheap ones don't and just do port isolation, which is not the same thing. They usually have a different vlan for iptv, but the tagging is done on the DSL side. Tagged vlans should pass through an unmanaged switch just fine.

You can do tagged vlans, bonding or bridging with the h2's nics, but you need to plan out in advance what you want to accomplish.

If you can't have vlans, you may be able to create a different layer 3 network on top of the same layer 2 lan, but you'll need to go with static addresses, since dhcp will be confused.

Post Reply

Return to “General Topics”

Who is online

Users browsing this forum: No registered users and 1 guest