SUMMARY: different netmasks w/ two interfaces

From: Mark Natoli (mnatoli@npac.syr.edu)
Date: Thu Sep 30 1999 - 10:20:55 CDT


SOLUTION:
  I could not find one, other than my original workaround.

ORIGINAL QUESTION:
  I have an Ultra-2 with a FDDI interface and Fast Ethernet interface.
This machine is attached to two separate networks but no routing is done.
All is fine when both cards exist using the same netmask. But when I want
to change the hme0 netmask from 255.255.255.0 to 255.255.255.224 without
changing the mask of the nf0 interface I find this impossible using only
the /etc/inet/netmasks.

/etc/inet/netmasks
  131.230.19.0 255.255.255.224
  131.230.0.0 255.255.255.0

where the hme0 is 131.230.19.2
and the nf0 is 131.230.8.2

  I have also tried including 131.230.8.0 255.255.255.0 in the netmasks
file as well as most logical combinations/orders that I could think.

  This is not sufficient. In order to work around this problem I have to
edit /etc/init/inetinit and inetsvc.
  In inetinit I run ifconfig with the correct mask for hme and then
ifconfig up.
 Then in inetsvc I make this change:

From:
/usr/sbin/ifconfig -auD netmask + broadcast +
To:
/usr/sbin/ifconfig -auD #netmask + broadcast +

  This works but is a big workaround for a simple problem. Any help?

ANSWERS:
Roger Caron said:
> try 255.255.224.0

Martin Oksnevad said:
> Have you edited /etc/nsswitch.conf ?
>
> #netmasks: nis [NOTFOUND=return] files
> netmasks: files
>
> If you edit the local /etc/netmasks you must make sure the machine
> uses the local file and not a NIS/NIS+ network wide value.

John D Groenveld said:
> As I recall, variable length subneting does not work at least with
> Solaris 2.5.1. Supposedly fixed with 7 and maybe 2.6.
> 131.230 is a class b network, so you can only apply one netmask to
> it.

Marco Greene said:
> Try the following:
> /etc/inet/netmasks
> 131.230.19 255.255.255.224
> 131.230.8 255.255.255.0
>
> If that doesn't work write a script to change the netmask using
> ifconfig.

Karl Sprules said:
> Is this Solaris 2.5.1? If so the shell script that interprets
> /etc/inet/netmasks does not have sufficient intelligence to handle two
> different masks on same base network. We have the same problem and used
> a solution very similar to your's. I believe the problem is fixed in
> 2.6

Mark Neill said:
> I believe the 131.*.*.* address is, by default, a class B address (I
> don't have my Stevens book here right now). If that is the case, you
> need your netmasks file to look like:
>
> /etc/inet/netmasks
> 131.230.0.0 255.255.255.0
> 131.230.19.0/24 255.255.255.224
>
> The /24 specifies the class C network mapping. And specifying the
> larger network first, then remapping the smaller portion, should
> probably fix things.

Thanks to everyone who replied.
-Mark

Mark Natoli
Systems and Network Administrator
Northeast Parallel Architectures Center, Syracuse University
mnatoli@npac.syr.edu



This archive was generated by hypermail 2.1.2 : Fri Sep 28 2001 - 23:13:26 CDT