LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 12-30-2023, 07:57 AM   #1
Jason.nix
Member
 
Registered: Feb 2023
Posts: 568

Rep: Reputation: 10
Post Linux as a gateway for multiple IP addresses


Hello,
Please consider this guide. If Linux wants to be used as a gateway for several different IP address ranges, then is it possible to set multiple IP addresses on Linux NICs?

Thank you.

Last edited by Jason.nix; 12-30-2023 at 07:58 AM.
 
Old 12-31-2023, 01:28 AM   #2
wpeckham
LQ Guru
 
Registered: Apr 2010
Location: Continental USA
Distribution: Debian, Ubuntu, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, VSIDO, tinycore, Q4OS, Manjaro
Posts: 5,767

Rep: Reputation: 2765Reputation: 2765Reputation: 2765Reputation: 2765Reputation: 2765Reputation: 2765Reputation: 2765Reputation: 2765Reputation: 2765Reputation: 2765Reputation: 2765
Quote:
Originally Posted by Jason.nix View Post
Hello,
Please consider this guide. If Linux wants to be used as a gateway for several different IP address ranges, then is it possible to set multiple IP addresses on Linux NICs?

Thank you.
Actually, it is possible to set multiple IP addresses on Linux NICs regardless of your reason. You do not have to want it to act as a gateway, bridge, or router for that to be an option.
See any of the hundreds like https://ostechnix.com/how-to-assign-...card-in-linux/
 
1 members found this post helpful.
Old 01-01-2024, 07:42 AM   #3
allend
LQ 5k Club
 
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware64-15.0
Posts: 6,383

Rep: Reputation: 2762Reputation: 2762Reputation: 2762Reputation: 2762Reputation: 2762Reputation: 2762Reputation: 2762Reputation: 2762Reputation: 2762Reputation: 2762Reputation: 2762
From the quoted guide in post #1
Quote:
If you have only one interface, you can configure both IP addresses on it. Linux allows you to configure and use multiple IP addresses on the same interface.
Why ask for confirmation of something that has already been read?
 
1 members found this post helpful.
Old 01-02-2024, 12:31 PM   #4
jefro
Moderator
 
Registered: Mar 2008
Posts: 22,020

Rep: Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630
You'd have to have a very old or odd nic that can't support multiple ip addresses. They still exist that can't.
 
Old 01-02-2024, 02:08 PM   #5
wpeckham
LQ Guru
 
Registered: Apr 2010
Location: Continental USA
Distribution: Debian, Ubuntu, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, VSIDO, tinycore, Q4OS, Manjaro
Posts: 5,767

Rep: Reputation: 2765Reputation: 2765Reputation: 2765Reputation: 2765Reputation: 2765Reputation: 2765Reputation: 2765Reputation: 2765Reputation: 2765Reputation: 2765Reputation: 2765
Quote:
Originally Posted by jefro View Post
Bill Gates promises to drop off the richest list.
He recently bought a few tanks of gas and a steak dinner.
That did not age well. Gas prices are WAY down and food prices at restaurants never went up that much.
Oh, and Gates GIVES AWAY more money that it would cost to by many small gas station and small steak house chains!
 
Old 01-02-2024, 02:38 PM   #6
rclark
Member
 
Registered: Jul 2008
Location: Montana USA
Distribution: KUbuntu, Fedora (KDE), PI OS
Posts: 496

Rep: Reputation: 182Reputation: 182
Quote:
...and food prices at restaurants never went up that much.
Not sure where you live, but where it used to be around $20 for both of us, it is now easily $30 and we are not talking about fancy restaurants... Fast food is now over $10 'each'.

I've never found a need for multiple IP addresses. Just one per NIC card to keep networks separate. For example, all my machines have at least two NICs. One for the Internet, and then one for the internal home network. And then bind certain services to just the home network NIC (like NFS, SFTP, SAMBA, etc.) .
 
Old 01-02-2024, 04:14 PM   #7
wpeckham
LQ Guru
 
Registered: Apr 2010
Location: Continental USA
Distribution: Debian, Ubuntu, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, VSIDO, tinycore, Q4OS, Manjaro
Posts: 5,767

Rep: Reputation: 2765Reputation: 2765Reputation: 2765Reputation: 2765Reputation: 2765Reputation: 2765Reputation: 2765Reputation: 2765Reputation: 2765Reputation: 2765Reputation: 2765
Quote:
Originally Posted by rclark View Post
Not sure where you live, but where it used to be around $20 for both of us, it is now easily $30 and we are not talking about fancy restaurants... Fast food is now over $10 'each'.
Sorry to hear that. As I recall Montana and North Dakota have never been the cheapest places to eat out anyway, but I think Gates could afford the $30 without blinking.
Quote:
I've never found a need for multiple IP addresses. Just one per NIC card to keep networks separate. For example, all my machines have at least two NICs. One for the Internet, and then one for the internal home network. And then bind certain services to just the home network NIC (like NFS, SFTP, SAMBA, etc.) .
I started as a NEtwork Admin, Database programmer, and Unix System Administrator in '85 and needed to add more addresses than there were Ethernet interfaces quite often over the years. I was shocked in about 2006 when I needed that on a Linux server and discovered it was EASY! Luckily my next job had management I could talk into purchasing servers with 4 or more Ethernet ports each, and life got easy. Just because one of us has not used the option does not mean others have not found it critical.
 
Old 01-15-2024, 02:33 AM   #8
Jason.nix
Member
 
Registered: Feb 2023
Posts: 568

Original Poster
Rep: Reputation: 10
Hello,
Thank you so much for all replies.
 
  


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
Destination Host Unreachable On Multiple eth and Multiple Gateway sangprabv Linux - Networking 7 05-28-2010 10:51 AM
lm10.0 gateway is set but when I reboot I have to set the gateway rharvey32 Mandriva 8 02-13-2006 01:35 PM
Multiple gateway + Multiple DHCPD abakali Linux - Networking 8 12-14-2005 09:09 AM
Odd problem: Gateway unreachable after certain amount of time (Win XP Gateway) SocialEngineer Linux - Networking 2 08-13-2004 12:54 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 10:15 PM.

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