Solaris 9 Setting New Subnetmask?
I have 2 enterprise 250s and 1 Ultra10 all running Solaris 9.
Due to recent network changes I have to change the subnet mask on the ethernet interfaces. I change them fine with ifconfig but when the system reboots the subnet mask and broadcast address revert back to what they were before the changes?
Is there somewhere else I have to make changes?
Thanks
[381 byte] By [
Tonz66a] at [2007-11-27 7:36:32]

# 1
/etc/netmasks contains the subnetmask settings.-- Darren
# 2
Thanks for reply,
I checked the /etc/netmasks and there isn't any config, everything is commented out and it looks like this :
# The netmasks file associates Internet Protocol (IP) address
# masks with IP network numbers.
#
#network-number netmask
#
# The term network-number refers to a number obtained from the Internet Network
# Information Center.
#
# Both the network-number and the netmasks are specified in
# "decimal dot" notation, e.g:
#
#128.32.0.0 255.255.255.0
#
One one of my systems took the changes and retained them (Sunfire V100) after reboot. Its /etc/netmasks looks exactly the same?
Tony
# 3
While /etc/netmasks is the usual place for the information, it is possible (but unlikely) that they could be contained in an NIS or LDAP repository, or that you have an explicit netmask statment in your /etc/hostname.<int> file.
If none of those seem to be true, you can do a test like this...
ifconfig <int> unplumb
ifconfig <int> plumb <hostname> netmask + broadcast + up
That should do just about what the startup scripts do, using any information in /etc/netmasks to set it. Since everything in /etc/netmasks is commented out, you're presumably using default netmask settings based on the network address. It would be better to put explicit settings in /etc/netmasks (or wherever your netmasks repository is).
--
Darren
# 4
I agree with Darren on his analysis and can only add one more thing
(it doesn't account for /etc/netmasks being reverted to a commented out file - but)
if you have an incorrect netmask in the file, it will be ignored, and your interface will come up with the default netmask for the IP range as defined by their class (A = 1-126, B=128-191, C=192-254)
This doesn't usually happen when using /24, but /23, /22 etc, it can and does happen frequently by miscalculating the start of the subnet
# 5
I think this is what is happening. We are running a Class B address.
I edited /etc/netmasks and added the interface IP address and subnet mask 255.255.255.128. Rebooted and did ifconfig -a. Subnet mask was back to 255.255.0.0.
So it looks like the interface is using the default subnet mask for the Class of IP address.
Is there anyway to force the subnet mask or should it not matter?
Thanks
# 6
Can you provide the actual data you've placed in the file?-- Darren
# 7
You shouldn't put in the interface address in /etc/netmask, but rather the network the interface is in, aka 192.168.103.0 for an address on the 192.168.103.x network.
I suppose that you could put the netmask in the /etc/hostname.<interface> file, aka:
<hostname> netmask <netmask>
but i haven't tried it, but given how the file is used it should work..
.7/M.
# 8
I tried the /etc/netmasks with just the network number, not the interface number and it worked! Here is what the /etc/netmasks file looks like:
# cat /etc/netmasks
#
# The netmasks file associates Internet Protocol (IP) address
# masks with IP network numbers.
#
#network-number netmask
#
# The term network-number refers to a number obtained from the Internet Network
# Information Center.
#
# Both the network-number and the netmasks are specified in
# "decimal dot" notation, e.g:
#
165.95.58.0255.255.255.128
#128.32.0.0 255.255.255.0
Thanks everyone for your help. I really appreciate it.
Tony