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 05-13-2020, 05:15 PM   #1
Skaperen
Senior Member
 
Registered: May 2009
Location: center of singularity
Distribution: Xubuntu, Ubuntu, Slackware, Amazon Linux, OpenBSD, LFS (on Sparc_32 and i386)
Posts: 2,693
Blog Entries: 31

Rep: Reputation: 176Reputation: 176
configuring a whole /24 on one interface


is there a way to configure an interface to use (respond to ARP requests) all 256 IP addresses of a /24 that has been assigned to my server? i would otherwise have to configure 255 individual alias interfaces with each IP.
 
Old 05-14-2020, 02:25 PM   #2
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
Code:
for addr in {1..254}
do ip a add 192.168.1.${addr}/24 dev eth1
done
Didn't try it though.

Last edited by berndbausch; 05-14-2020 at 02:26 PM.
 
Old 05-14-2020, 02:30 PM   #3
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: Fedora
Posts: 4,162

Rep: Reputation: 1268Reputation: 1268Reputation: 1268Reputation: 1268Reputation: 1268Reputation: 1268Reputation: 1268Reputation: 1268Reputation: 1268
Quote:
Originally Posted by berndbausch View Post
Code:
for addr in {1..254}
do ip a add 192.168.1.${addr}/24 dev eth1
done
Didn't try it though.
Probably a good idea to remove your gateway IP from that list.
 
Old 05-14-2020, 02:57 PM   #4
jefro
Moderator
 
Registered: Mar 2008
Posts: 22,023

Rep: Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632
Static arp entry comes to mind but I've never tried that exactly. Seems like a very bad idea.
 
Old 05-15-2020, 06:47 PM   #5
Skaperen
Senior Member
 
Registered: May 2009
Location: center of singularity
Distribution: Xubuntu, Ubuntu, Slackware, Amazon Linux, OpenBSD, LFS (on Sparc_32 and i386)
Posts: 2,693

Original Poster
Blog Entries: 31

Rep: Reputation: 176Reputation: 176
the network mask is larger like /10. i just get a whole /24 out of it. the gateway is not within my /24. i have no intention to configure lots of individual IPs. BTDT. the system did not crash but networking was slower. i just have 2 IPs configured there, now, with 1 of them NATted to a public IP.
 
Old 05-15-2020, 08:24 PM   #6
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
Quote:
Originally Posted by Skaperen View Post
i have no intention to configure lots of individual IPs.
and in the original posting:
Quote:
configure an interface to use (respond to ARP requests) all 256 IP addresses of a /24
I am afraid your two requirements are incompatible.
 
Old 05-16-2020, 02:43 PM   #7
Skaperen
Senior Member
 
Registered: May 2009
Location: center of singularity
Distribution: Xubuntu, Ubuntu, Slackware, Amazon Linux, OpenBSD, LFS (on Sparc_32 and i386)
Posts: 2,693

Original Poster
Blog Entries: 31

Rep: Reputation: 176Reputation: 176
Quote:
Originally Posted by berndbausch View Post
I am afraid your two requirements are incompatible.
read my original question.

instead of 256 individual IPs (/32 each) configured i am wanting to configure just one, 100.77.58.0/24.
 
  


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
Encryption of the whole disk vs. a partition filling the whole disk taylorkh Linux - Security 5 09-19-2016 11:03 AM
[SOLVED] Auto configuring a whole subnet with Expect script? Tarikc Programming 5 03-23-2012 04:52 PM
can i used web interface to reboot or restart my whole system nikhidet1 Programming 5 02-08-2012 04:21 AM
Configuring sendmail to handle addresses but not the whole domain TheGorf Linux - Server 1 03-23-2011 07:31 AM
Will bringing down the loopback interface make the whole server to go down? siranjeevi Linux - Networking 5 12-14-2010 02:03 PM

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

All times are GMT -5. The time now is 04:59 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