LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-26-2023, 03:30 AM   #1
kgb200805
LQ Newbie
 
Registered: Jun 2014
Location: south africa
Posts: 14
Blog Entries: 1

Rep: Reputation: Disabled
Debian 11 (Bullseye) multiple NIC failing to connect to internet


Hi Guys I have 2 network cards on my debian server. How can I configure it so that my main network card (enp3s0) has 2 ip addresses, 10.0.0.10 and 10.0.0.254. and gateway 10.0.0.2 and dns 8.8.8.8. The second adapter (enp5s0) has ip addresses 192.168.0.254 up to 192.168.4.254 and should get internet through 10.0.0.2

my /etc/network/interface is as follows;
#Main
auto enp3s0
iface enp3s0 inet static
address 10.0.0.10/24
gateway 10.0.0.2
dns-nameservers 8.8.8.8

iface enp3s0 inet static
address 10.0.0.254/24
#Adapter2
auto enp5s0
iface enp5s0 inet static
address 192.168.0.254/24

iface enp5s0 inet static
address 192.168.1.254/24

iface enp5s0inet static
address 192.168.2.254/24

iface enp5s0 inet static
address 192.168.3.254/24

iface enp5s0 inet static
address 192.168.4.254/24

now if the main card is connected the 2nd is dead but i can connect to internet
and if both of them are connected and up no internet connection. how can i solve this?

Last edited by kgb200805; 01-26-2023 at 03:52 AM.
 
Old 01-26-2023, 04:08 PM   #2
Ser Olmy
Senior Member
 
Registered: Jan 2012
Distribution: Slackware
Posts: 3,340

Rep: Reputation: Disabled
That's not how gateways work.

A gateway/route is telling the host (not the adapter) how to reach certain non-local IP addresses. If you have two or more routes or gateways pointing to the same network (for instance, a default route pointing to the entire Internet), you've given your system no way to differentiate between the two options.

Practically, what happens is the host (your PC) will attempt to load balance between the two gateways, sending every other packet to a different gateway. The chances of this working is pretty slim, for many reasons.

So you see, when you say "the adapter should get Internet," that doesn't really make sense. The adapter/source IP address is selected after the host has consulted the routing table where the gateway(s) is/are defined.

If redundancy is your goal, adding a second default route with a higher metric could be the way to go.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Need help installing libs To establish initial Internet connection using USB iPhone tethering for Odroid XU Lite running Debian Bullseye Sabotender Debian 19 12-13-2022 11:05 AM
need help tethering iPhone for initial Internet connectivity on Odroid xU Lite running Debian Bullseye Sabotender Debian 0 12-05-2022 06:48 PM
LXer: DebConf20 Debian Conference Kicks Off Today for Debian GNU/Linux 11 “Bullseye” LXer Syndicated Linux News 0 08-23-2020 08:01 PM
LXer: Debian 11 "Bullseye" and Debian 12 "Bookworm" Are Coming After Debian 10 "Buster" LXer Syndicated Linux News 0 04-18-2018 12:26 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:59 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration