Using muitiple network adapters on a single node

Issues related to configuring your network
Post Reply
johndabomb44
Posts: 10
Joined: 2020/03/17 14:20:44

Using muitiple network adapters on a single node

Post by johndabomb44 » 2020/09/08 18:29:39

Hello!


I have two adapters on a single CentOS 7 node.

NIC 1: Can access the internet
NIC 2: Cannot access the internet


Now, when I enable both of these interfaces, I cannot access the internet. Yet if I activate NIC 1 (or rather disable NIC 2), I can then re-access the internet.

It SEEMS as if when I have both NICs active that the system decides to use NIC 2 as a default (if that's even possible or a thing). Is there a way to set NIC 1 as the default NIC to use when both are active?

User avatar
TrevorH
Forum Moderator
Posts: 29491
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Using muitiple network adapters on a single node

Post by TrevorH » 2020/09/08 20:06:22

You need to make sure that you do not have GATEWAY= in both /etc/sysconfig/network-scripts/ifcfg-* files, only in the one you want to be the gateway to everything else.
CentOS 6 will die in November 2020 - migrate sooner rather than later!
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 is dead, do not use it.
Full time Geek, part time moderator. Use the FAQ Luke

johndabomb44
Posts: 10
Joined: 2020/03/17 14:20:44

Re: Using muitiple network adapters on a single node

Post by johndabomb44 » 2020/09/08 20:37:14

TrevorH wrote:
2020/09/08 20:06:22
You need to make sure that you do not have GATEWAY= in both /etc/sysconfig/network-scripts/ifcfg-* files, only in the one you want to be the gateway to everything else.

I checked on that. it was not the fix unfortunately.

What info would you need for further assistance?

User avatar
jlehtone
Posts: 3044
Joined: 2007/12/11 08:17:33
Location: Finland

Re: Using muitiple network adapters on a single node

Post by jlehtone » 2020/09/08 21:17:02

Perhaps, for starters:

Code: Select all

nmcli d s
nmcli c s
ip ro
Plain nmcli does tell quite a lot too.

johndabomb44
Posts: 10
Joined: 2020/03/17 14:20:44

Re: Using muitiple network adapters on a single node

Post by johndabomb44 » 2020/09/08 21:24:14

jlehtone wrote:
2020/09/08 21:17:02
Perhaps, for starters:

Code: Select all

nmcli d s
nmcli c s
ip ro
Plain nmcli does tell quite a lot too.

Output:

[root@is01 test]# nmcli d s
DEVICE TYPE STATE CONNECTION
enp0s3 ethernet connected enp0s3
enp0s8 ethernet connected enp0s8
virbr0 bridge connected virbr0
lo loopback unmanaged --
virbr0-nic tun unmanaged --
[root@is01 test]# nmcli cs
Error: argument 'cs' not understood. Try passing --help instead.
[root@is01 test]# nmcli c s
NAME UUID TYPE DEVICE
enp0s3 953eddc1-02ed-45c8-9b84-091b4c776512 ethernet enp0s3
enp0s8 4fb410cf-656d-33c7-978d-fdf2564ccb9e ethernet enp0s8
virbr0 0e27372a-01b5-4274-9a38-635a73b66508 bridge virbr0
[root@is01 test]# ip ro
default via 172.16.1.1 dev enp0s3 proto static metric 100
172.16.1.0/24 dev enp0s3 proto kernel scope link src 172.16.1.3 metric 100
192.168.1.0/24 dev enp0s8 proto kernel scope link src 192.168.1.3 metric 101
192.168.122.0/24 dev virbr0 proto kernel scope link src 192.168.122.1

[root@is01 test]# nmcli
enp0s3: connected to enp0s3
"Intel 82540EM"
ethernet (e1000), 08:00:27:4D:40:76, hw, mtu 1500
ip4 default
inet4 172.16.1.3/24
route4 172.16.1.0/24
route4 0.0.0.0/0
inet6 fe80::53d3:d21a:30fa:3970/64
route6 fe80::/64
route6 ff00::/8

enp0s8: connected to enp0s8
"Intel 82540EM"
ethernet (e1000), 08:00:27:EB:36:42, hw, mtu 1500
inet4 192.168.1.3/24
route4 192.168.1.0/24
inet6 fe80::80c4:32e7:1a8a:b90/64
route6 fe80::/64
route6 ff00::/8

virbr0: connected to virbr0
"virbr0"
bridge, 52:54:00:87:87:D3, sw, mtu 1500
inet4 192.168.122.1/24
route4 192.168.122.0/24

lo: unmanaged
"lo"
loopback (unknown), 00:00:00:00:00:00, sw, mtu 65536

virbr0-nic: unmanaged
"virbr0-nic"
tun, 52:54:00:87:87:D3, sw, mtu 1500

DNS configuration:
servers: 192.168.1.2
interface: enp0s3

servers: 192.168.1.2
interface: enp0s8

User avatar
jlehtone
Posts: 3044
Joined: 2007/12/11 08:17:33
Location: Finland

Re: Using muitiple network adapters on a single node

Post by jlehtone » 2020/09/09 07:36:04

You have NICs enp0s3 and enp0s8. Which of them is NIC 1?

Is this output from the state, when you can access net?

The configuration of each "connection" (NIC) can be seen with:

Code: Select all

nmcli -f ipv4 c s enp0s3
nmcli -f ipv4 c s enp0s8

johndabomb44
Posts: 10
Joined: 2020/03/17 14:20:44

Re: Using muitiple network adapters on a single node

Post by johndabomb44 » 2020/09/09 13:55:06

jlehtone wrote:
2020/09/09 07:36:04
You have NICs enp0s3 and enp0s8. Which of them is NIC 1?

Is this output from the state, when you can access net?

The configuration of each "connection" (NIC) can be seen with:

Code: Select all

nmcli -f ipv4 c s enp0s3
nmcli -f ipv4 c s enp0s8

NIC1 = enp0s3
NIC2 = enp0s8

First output was from the state when both were active (could not reach the internet)


New output:

[root@is01 test]# nmcli -f ipv4 c s enp0s3
ipv4.method: manual
ipv4.dns: 192.168.1.2
ipv4.dns-search: --
ipv4.dns-options: ""
ipv4.dns-priority: 0
ipv4.addresses: 172.16.1.3/24
ipv4.gateway: 172.16.1.1
ipv4.routes: --
ipv4.route-metric: -1
ipv4.route-table: 0 (unspec)
ipv4.routing-rules: --
ipv4.ignore-auto-routes: no
ipv4.ignore-auto-dns: no
ipv4.dhcp-client-id: --
ipv4.dhcp-timeout: 0 (default)
ipv4.dhcp-send-hostname: yes
ipv4.dhcp-hostname: --
ipv4.dhcp-fqdn: --
ipv4.never-default: no
ipv4.may-fail: yes
ipv4.dad-timeout: -1 (default)
[root@is01 test]#
[root@is01 test]#
[root@is01 test]# nmcli -f ipv4 c s enp0s8
ipv4.method: manual
ipv4.dns: 192.168.1.2
ipv4.dns-search: --
ipv4.dns-options: ""
ipv4.dns-priority: 0
ipv4.addresses: 192.168.1.3/24
ipv4.gateway: --
ipv4.routes: --
ipv4.route-metric: -1
ipv4.route-table: 0 (unspec)
ipv4.routing-rules: --
ipv4.ignore-auto-routes: yes
ipv4.ignore-auto-dns: yes
ipv4.dhcp-client-id: --
ipv4.dhcp-timeout: 0 (default)
ipv4.dhcp-send-hostname: yes
ipv4.dhcp-hostname: --
ipv4.dhcp-fqdn: --
ipv4.never-default: yes
ipv4.may-fail: yes
ipv4.dad-timeout: -1 (default)

User avatar
jlehtone
Posts: 3044
Joined: 2007/12/11 08:17:33
Location: Finland

Re: Using muitiple network adapters on a single node

Post by jlehtone » 2020/09/09 15:42:13

I see one potential issue, but that does not quite match your description.
When NIC2 (enp0s8) is disabled the machine is not directly connected to subnet that contains 192.168.1.2.
That is the DNS server. The system might still function, if the 172.16.1.1 can route DNS queries to 192.168.1.2.

There is no point for both connections to set ipv4.dns, particularly with same value.

Possible, partial explanation: when enp0s8 is up the 192.168.1.2 is a link-local neighbour.
If it does not answer queries from 192.168.1.3, then your name resolution fails.

Is the "192.168.1.2" behind 172.16.1.1 even the same DNS server as the link-local 192.168.1.2?

Does the "can't reach" mean "can't resolve names" or really no link?
Can you, say ping 8.8.8.8, when you "can't reach" anything?

Why is the name server (apparently) in a subnet that has no connection to internet?


You use manual config. That is quite static. It has its pros, but a well managed DHCP is very convenient too.

johndabomb44
Posts: 10
Joined: 2020/03/17 14:20:44

Re: Using muitiple network adapters on a single node

Post by johndabomb44 » 2020/09/09 16:17:52

jlehtone wrote:
2020/09/09 15:42:13
I see one potential issue, but that does not quite match your description.
When NIC2 (enp0s8) is disabled the machine is not directly connected to subnet that contains 192.168.1.2.
That is the DNS server. The system might still function, if the 172.16.1.1 can route DNS queries to 192.168.1.2.

There is no point for both connections to set ipv4.dns, particularly with same value.

Possible, partial explanation: when enp0s8 is up the 192.168.1.2 is a link-local neighbour.
If it does not answer queries from 192.168.1.3, then your name resolution fails.

Is the "192.168.1.2" behind 172.16.1.1 even the same DNS server as the link-local 192.168.1.2?

Does the "can't reach" mean "can't resolve names" or really no link?
Can you, say ping 8.8.8.8, when you "can't reach" anything?

Why is the name server (apparently) in a subnet that has no connection to internet?


You use manual config. That is quite static. It has its pros, but a well managed DHCP is very convenient too.

Your post gave me another idea which is to use a network unrelated to the working network (172.16.1.X) and the DNS network (192.168.1.X).

I changed enp0s8 to a 10.0.0.X network and all of a sudden it started working. I think this has to do with a router/routing issue somewhere else in the network architecture and I don't need to worry about that since the secondary NIC isn't supposed to answer anything outside of the DFGW nor is the secondary node since it only has to be connected to the node in question.

Thank you so much for your help! I've learned a bit about network troubleshooting commands and I will remember this!!!

Post Reply

Return to “CentOS 7 - Networking Support”