LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 07-25-2012, 04:57 PM   #1
lolnameless
LQ Newbie
 
Registered: Jan 2012
Location: Hong Kong
Distribution: Slackware
Posts: 18

Rep: Reputation: Disabled
[Request]rewrite rc.inet with iproute2?


i have no complaint on net-tool but iproute2 is soo easily understandable, relative speaking, net-tool is ambiguous

thanks
 
Old 07-25-2012, 05:29 PM   #2
GazL
Senior Member
 
Registered: May 2008
Posts: 3,678

Rep: Reputation: 1136Reputation: 1136Reputation: 1136Reputation: 1136Reputation: 1136Reputation: 1136Reputation: 1136Reputation: 1136Reputation: 1136
I always liked the OpenBSD /etc/hostname.<iface> approach myself.
 
Old 07-26-2012, 05:53 AM   #3
wildwizard
Member
 
Registered: Apr 2009
Location: Oz
Distribution: slackware64-14.0
Posts: 838

Rep: Reputation: 257Reputation: 257Reputation: 257
The problem is that iproute2 uses CIDR notation when you give it an IP address and the current setup uses IP + netmask.

Seems easy enough but it means you also need to fix netconfig as well.

And the question when you fix netconfig is do we switch user input to CIDR or do we keep the input the same and convert it.

Of course all of this actually achieves nothing great other than been able to say we're keeping up with the Jones' so getting Pat to even consider it without giving him both rc.inet1 and netconfig is extremely remote.
 
Old 08-04-2015, 03:34 PM   #4
dad_
Member
 
Registered: Aug 2009
Location: St. Petersburg, Russia
Distribution: Slackware 14.1/current(x86_64/EFI), gentoo, debian, puppy, ubuntu
Posts: 45

Rep: Reputation: 2
Sorry for posting to this old thread, but could you recommend the best way of using iproute2 to configure second ip on the same interface(eth0) at boot? There's no point in creating 2nd interface eth0:0(I actually don't need it, only ip). All the slackware rc.inet is still built around old network utils, so I have to directly modify rc.inet1 script and not use any .conf files?
 
Old 08-05-2015, 10:16 AM   #5
ReaperX7
LQ Guru
 
Registered: Jul 2011
Location: California
Distribution: FreeBSD 11.0-Current Slackware64-Current
Posts: 5,106
Blog Entries: 15

Rep: Reputation: 1509Reputation: 1509Reputation: 1509Reputation: 1509Reputation: 1509Reputation: 1509Reputation: 1509Reputation: 1509Reputation: 1509Reputation: 1509Reputation: 1509
I think inetutils has its own inetd server that can be used with iproute2. Actually CIDR is supposed to be a bit more better with subnetting needs than just simple subnet masks, because you can do more with CIDR.

Last edited by ReaperX7; 08-05-2015 at 10:49 AM.
 
Old 08-05-2015, 11:01 AM   #6
gezley
Member
 
Registered: Sep 2009
Location: Ireland
Distribution: Slackware-64, Crux-64, NetBSD-64
Posts: 771

Rep: Reputation: 478Reputation: 478Reputation: 478Reputation: 478Reputation: 478
Quote:
Originally Posted by dad_ View Post
Sorry for posting to this old thread, but could you recommend the best way of using iproute2 to configure second ip on the same interface(eth0) at boot? There's no point in creating 2nd interface eth0:0(I actually don't need it, only ip). All the slackware rc.inet is still built around old network utils, so I have to directly modify rc.inet1 script and not use any .conf files?
ip address add 192.168.40.100/24 dev eth0
ip address add 192.168.40.101/24 dev eth0
ip address show eth0

Edit: sorry, it just dawned on me you want this set at boot.

Last edited by gezley; 08-05-2015 at 11:03 AM.
 
Old 08-06-2015, 07:47 AM   #7
dad_
Member
 
Registered: Aug 2009
Location: St. Petersburg, Russia
Distribution: Slackware 14.1/current(x86_64/EFI), gentoo, debian, puppy, ubuntu
Posts: 45

Rep: Reputation: 2
Quote:
Originally Posted by gezley View Post
ip address add 192.168.40.100/24 dev eth0
ip address add 192.168.40.101/24 dev eth0
ip address show eth0

Edit: sorry, it just dawned on me you want this set at boot.
Yeah, I need a bunch of ip commands(a bit more complicated than that - I also want to set up a bridge), but to get this at boot I have to directly put 'em into rc.inetX(X = 1 or 2?) script(s) in /etc because all .conf is built around old ifconfig utility. This has a downside of having to merge my modified script files on any slackware package updates touching these files.

PS: This has nothing to do with inetd, I actually don't need one at all, I just need 2nd ip address.

Last edited by dad_; 08-06-2015 at 07:53 AM.
 
Old 08-06-2015, 07:20 PM   #8
wildwizard
Member
 
Registered: Apr 2009
Location: Oz
Distribution: slackware64-14.0
Posts: 838

Rep: Reputation: 257Reputation: 257Reputation: 257
Quote:
Originally Posted by ReaperX7 View Post
I think inetutils has its own inetd server that can be used with iproute2. Actually CIDR is supposed to be a bit more better with subnetting needs than just simple subnet masks, because you can do more with CIDR.
Your confusing the concept of "CIDR notation" and "CIDR"

When CIDR came out it replaced the old class based subnets which were simply (A) 255.0.0.0, (B) 255.255.0.0, (C) 255.255.255.0 pretty easy to understand and simple to handle as there was only 3 of them.

Now with CIDR your subnet mask can be pretty much anything which made reading them slightly harder, them some clever sod came up with a new way of writing it based on the number of bits in the subnet mask.

eg the old way :- (Note that this is out of order and hard to spot that it is out of order)
255.255.255.0
255.255.252.0
255.255.254.0
255.255.224.0
255.255.248.0

The new way (You only have to read 2 digits making it mush easier to read)
/24
/22
/23
/19
/21

NB If you go further into the Class based subnets you'll find that each subnet was only to be used with certain address ranges which restricted things even further.
 
1 members found this post helpful.
Old 08-07-2015, 02:30 AM   #9
ReaperX7
LQ Guru
 
Registered: Jul 2011
Location: California
Distribution: FreeBSD 11.0-Current Slackware64-Current
Posts: 5,106
Blog Entries: 15

Rep: Reputation: 1509Reputation: 1509Reputation: 1509Reputation: 1509Reputation: 1509Reputation: 1509Reputation: 1509Reputation: 1509Reputation: 1509Reputation: 1509Reputation: 1509
Yes, that's describing CIDR blocks, right?
 
Old 08-07-2015, 03:28 AM   #10
wildwizard
Member
 
Registered: Apr 2009
Location: Oz
Distribution: slackware64-14.0
Posts: 838

Rep: Reputation: 257Reputation: 257Reputation: 257
If your referring to someone saying they want a "/24 block" then yes and the previous equivalent was them asking for a "Class C block"
 
Old 08-07-2015, 09:10 PM   #11
AlexSlack
LQ Newbie
 
Registered: Jul 2012
Location: El Salvador
Distribution: Slackware-current
Posts: 13

Rep: Reputation: Disabled
Quote:
Originally Posted by dad_ View Post
Yeah, I need a bunch of ip commands(a bit more complicated than that - I also want to set up a bridge), but to get this at boot I have to directly put 'em into rc.inetX(X = 1 or 2?) script(s) in /etc because all .conf is built around old ifconfig utility. This has a downside of having to merge my modified script files on any slackware package updates touching these files.

PS: This has nothing to do with inetd, I actually don't need one at all, I just need 2nd ip address.
To have more than one IP address in not needed to modify the scripts, I have a server working with 3 addresses, so I setup the server with one IP on rc.inet1.conf on eth0 and then add the rest from rc.local with something like this:

Code:
/sbin/ip add add 10.10.0.1/24 brd 10.10.0.255 dev eth0
/sbin/ip add add 10.20.0.1/24 brd 10.20.0.255 dev eth0
...
 
Old 08-08-2015, 05:14 PM   #12
ReaperX7
LQ Guru
 
Registered: Jul 2011
Location: California
Distribution: FreeBSD 11.0-Current Slackware64-Current
Posts: 5,106
Blog Entries: 15

Rep: Reputation: 1509Reputation: 1509Reputation: 1509Reputation: 1509Reputation: 1509Reputation: 1509Reputation: 1509Reputation: 1509Reputation: 1509Reputation: 1509Reputation: 1509
Yes, and using CIDR allows you to do supernetting too.

For anyone not knowing what supernetting is: https://en.wikipedia.org/wiki/Supernetwork
 
Old 08-10-2015, 08:41 AM   #13
GazL
Senior Member
 
Registered: May 2008
Posts: 3,678

Rep: Reputation: 1136Reputation: 1136Reputation: 1136Reputation: 1136Reputation: 1136Reputation: 1136Reputation: 1136Reputation: 1136Reputation: 1136
Quote:
Originally Posted by dad_ View Post
Yeah, I need a bunch of ip commands(a bit more complicated than that - I also want to set up a bridge), but to get this at boot I have to directly put 'em into rc.inetX(X = 1 or 2?) script(s) in /etc because all .conf is built around old ifconfig utility. This has a downside of having to merge my modified script files on any slackware package updates touching these files.
Any updates will be install as rc.inet1.new so unless you move the '.new' file into place yourself then it shouldn't get unknowingly clobbered. I've been running a custom rc.inet1 for a long while now, and it's not a problem to do so. If the stock one doesn't lend itself to what you want to do, then I wouldn't hesitate to suggest you do likewise.
 
Old 08-11-2015, 05:22 AM   #14
dad_
Member
 
Registered: Aug 2009
Location: St. Petersburg, Russia
Distribution: Slackware 14.1/current(x86_64/EFI), gentoo, debian, puppy, ubuntu
Posts: 45

Rep: Reputation: 2
Quote:
Originally Posted by GazL View Post
Any updates will be install as rc.inet1.new so unless you move the '.new' file into place yourself then it shouldn't get unknowingly clobbered.
Yes, but this may require merging your version with .new if you are using at least some part of supplied rc.inet1 - your (old) modified version may not work after slackware update. Maybe we could add some rc.inet3 or smth to not touch standard rc files at all?
 
Old 08-11-2015, 05:47 AM   #15
GazL
Senior Member
 
Registered: May 2008
Posts: 3,678

Rep: Reputation: 1136Reputation: 1136Reputation: 1136Reputation: 1136Reputation: 1136Reputation: 1136Reputation: 1136Reputation: 1136Reputation: 1136
True, but if you replace rc.inet1 with your own, there's no need to use rc.inet1.conf either, and merging isn't a concern.

The reason I replaced rc.inet1 was I found both rc.inet1 + rc.inet1.conf overly complicated and long winded (at least, for my needs anyway). As I said at the top of this thread I much preferred the OpenBSD approach, so I wrote myself a rc.inet1 that uses OpenBSD style config files.
e.g.
Code:
root:~# cat /etc/hostname.eth0 
inet 192.168.0.2
!route add default gw 192.168.0.1
root:~# cat /etc/hostname.lo
inet 127.0.0.1
root:~#

Last edited by GazL; 08-11-2015 at 05:49 AM.
 
  


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
Bad Request Your browser sent a request that this server could not understand. vishnukumar Linux - Server 2 08-13-2009 12:56 AM
inet<---eth1[LinuxBox_1]eth0<---e0[LinuxBox_2] : LinuxBox_2 hv no inet connection? Andrea_44 Linux - Networking 5 10-25-2006 08:18 PM
uninstall iproute2 wahaha Linux - Software 1 09-06-2006 06:45 PM
Help with iproute2 warwolf Linux - Networking 1 05-13-2005 09:25 AM
iproute2 rounting sqn Linux - Networking 1 06-14-2004 02:26 PM


All times are GMT -5. The time now is 04:26 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration