LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 11-23-2016, 06:40 AM   #1
Bashed
Member
 
Registered: Jul 2015
Posts: 133

Rep: Reputation: Disabled
Stuck! How do I route a 20 x /24 subnets in Ubuntu 14?


Trying to bind 20 x /24 subnets in Ubuntu 14 Server (for proxy/VPN) but I'm stuck here. These are diversified /24 subnets.

I tried the below method via script called addips.sh

Code:
for i in $(seq 3 254); do echo "auto em1:$i
iface em1:$i inet static
address xxx.xxx.16.$i                                                                               
netmask 255.255.255.0                                                                      
" >> virthosts; done
But, I noticed that this happened now:

Each /24 subnet it outputted started off at #1 again instead of 255, 256, 257, etc all the way through consecutively for all 20 x /24 subnets

Code:
auto em1:1
auto em1:254

Then again...

auto em1:1
...
How can I properly change this so it does reset at #1? em1 is the NIC Ethernet port (primary) and only port used too.

I also want to make sure these are permanent, they stick after a server reboot.
 
Old 11-23-2016, 07:36 AM   #2
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
Is this not a dupe of https://www.linuxquestions.org/quest...-a-4175594033/ ?

C'mon
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
RHEL/CentOS - Correct persistent ip route on my subnets? gctaylor1 Linux - Networking 2 11-07-2015 10:40 PM
How to route only specific traffic between 2 subnets fender4645 Linux - Networking 3 06-17-2012 06:25 AM
[SOLVED] Route between 2 subnets so device connected to Linux laptop can access Internet veeruk101 Linux - Newbie 9 10-24-2011 03:11 PM
[SOLVED] howto to route 2 subnets between 2 routes sys7em Linux - Networking 1 10-28-2010 02:39 PM
Two shared dhcpd subnets, how do I route the guest subnet to a web page or to squid? cmisip Linux - Networking 3 08-31-2008 10:48 PM

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

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