LinuxQuestions.org
Visit the LQ Articles and Editorials section
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 01-20-2012, 06:22 AM   #1
cskrishna
LQ Newbie
 
Registered: Jan 2012
Posts: 3

Rep: Reputation: Disabled
/31 subnets support in Linux 2.6.34


Hi,

Does /31 subnet mask support really exist in Linux? FYI, I am using the linux version 2.6.34.

As part of my trails, I have two linux boxes connected back to back. I am able to configure the interface addresses with a /31 netmask viz., 192.168.10.4 and 192.168.10.5 successfully. 'ifconfig' output confirms that. But I am not able to ping the other address from 192.168.10.4 and vice-versa.

So, I just doubt if this is really supported? If yes, Am I missing something?

Thanks in advance for any help in this regard.
 
Old 01-20-2012, 06:39 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1970Reputation: 1970Reputation: 1970Reputation: 1970Reputation: 1970Reputation: 1970Reputation: 1970Reputation: 1970Reputation: 1970Reputation: 1970Reputation: 1970
i've always configured 2 host subnets as /30's then there's no conceptual issue here. I'm actually not sure whether a /31 subnet is meant to work according to RFC's (potentially regardless of reality). Does it work on a /30? (shifting the hosts up by one to fit nicely) Can you see any arps coming or going from a tcpdump?

I would say that if it works, congrats, but don't be at all surprised, or annoyed, if it doesn't. I just skimmed over the RFC from 2000 advocating it, and I don't like the idea of it outside of IP space conservation. Can you not use a /30?

Last edited by acid_kewpie; 01-20-2012 at 06:45 AM.
 
Old 01-20-2012, 08:54 AM   #3
Imarkus88
LQ Newbie
 
Registered: Nov 2010
Posts: 7

Rep: Reputation: 0
an /30 network would probably be a better idea. if possible i would use it instead.
 
Old 01-20-2012, 12:00 PM   #4
cskrishna
LQ Newbie
 
Registered: Jan 2012
Posts: 3

Original Poster
Rep: Reputation: Disabled
Thanks for your response, Chris. That was helpful.
I am in a necessity to work with /31's as part of my project work. It looks like it works with /30's. With /31's, I don't see any ARPs coming out on the wire. When we configure an interface with a /31 address one end of the link is a broadcast address. Is it because of some validations in the linux kernel code concerning the broadcast addresses that is preventing the (ARP/IP) packets to be sent out? If so, do we need to customize the kernel code to achieve this? Has anyone achieved success in making the /31's work?
 
Old 01-20-2012, 02:50 PM   #5
jefro
Guru
 
Registered: Mar 2008
Posts: 12,974

Rep: Reputation: 1649Reputation: 1649Reputation: 1649Reputation: 1649Reputation: 1649Reputation: 1649Reputation: 1649Reputation: 1649Reputation: 1649Reputation: 1649Reputation: 1649
If 30 is two ip addresses and 32 is one address then what is the point of a /31?


http://www.petri.co.il/how-30-and-32...networking.htm

Last edited by jefro; 01-20-2012 at 02:52 PM.
 
Old 01-20-2012, 04:44 PM   #6
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1970Reputation: 1970Reputation: 1970Reputation: 1970Reputation: 1970Reputation: 1970Reputation: 1970Reputation: 1970Reputation: 1970Reputation: 1970Reputation: 1970
Quote:
Originally Posted by jefro View Post
If 30 is two ip addresses and 32 is one address then what is the point of a /31?


http://www.petri.co.il/how-30-and-32...networking.htm
Well there are RFC's to allow /31 on point-to-point connections.


But this is only discussed as specifically for p-t-p so on a normal ethernet interface I wouldn't expect it to work. Maybe you can set up a pppoe link here, that's probably the only way.
 
Old 01-22-2012, 07:35 AM   #7
cskrishna
LQ Newbie
 
Registered: Jan 2012
Posts: 3

Original Poster
Rep: Reputation: Disabled
Thanks, Chris. Let me dig/try it out.
 
Old 03-13-2013, 06:48 AM   #8
ViennaAustria
LQ Newbie
 
Registered: Jun 2011
Location: Vienna, Austria, Europe
Distribution: SuSE since 4.2
Posts: 4

Rep: Reputation: Disabled
Quote:
Originally Posted by cskrishna View Post
Thanks, Chris. Let me dig/try it out.
We're using /31 on all link networks between Cisco routers - directly connected as well as for IP tunnels. It works well and doubles the ammount of available link networks, which is good in respect to IPv4 depletion. So I would be pleased if it works on Linux too. Does anybody have any experience with it?
 
Old 07-02-2013, 10:29 AM   #9
ViennaAustria
LQ Newbie
 
Registered: Jun 2011
Location: Vienna, Austria, Europe
Distribution: SuSE since 4.2
Posts: 4

Rep: Reputation: Disabled
Quote:
Originally Posted by ViennaAustria View Post
Does anybody have any experience with it?
It works well with kernel 2.6.31 on SuSE 11.2:

Code:
sip.unicef.at:/etc/sysconfig/network 17:24# ifconfig tun0
tun0      Link encap:UNSPEC  HWaddr C0-A8-01-02-93-BF-F8-4A-00-00-00-00-00-00-00-00
          inet addr:37.75.142.29  P-t-P:37.75.142.28  Mask:255.255.255.254
          UP POINTOPOINT RUNNING NOARP  MTU:1476  Metric:1
          RX packets:68893 errors:0 dropped:0 overruns:0 frame:0
          TX packets:69733 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:800 (800.0 b)  TX bytes:752 (752.0 b)
 
  


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
connecting two subnets via a linux server vaas45 Linux - Networking 2 03-04-2011 07:41 AM
I need to setup a Linux router for my 2 public subnets drcoco Linux - Networking 4 05-17-2006 09:36 PM
Linux Hostname across Subnets uthe54 Linux - Networking 4 08-28-2005 09:09 PM


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