Thursday, February 27, 2014

How to fix network subnet mask aka netmask issue on solaris

Here I am explaining what I encounter network issues in my environment
about network subnet mask aka netmask. I have faced issue with network subnet mask while reboot the server.

Pre-Request:
I. Take ifconfig -a and netstat -rn output prior to reboot the server
II. Collect Explorer output if you missed to take above outputs

This info will help you to refer netmask values.
Netmask Quick Reference:
Dotted Decimal ValueHex Value
255.0.0.0FF000000
255.255.0.0FFFF0000
255.255.255.0FFFFFF00
255.255.255.128FFFFFF80
255.255.255.192FFFFFFC0
255.255.255.224FFFFFFE0
255.255.255.240FFFFFFF0
255.255.255.248FFFFFFF8
255.255.255.252 *FFFFFFFC *


Netmask Netmask (binary)CIDR Notes
255.255.255.25511111111.11111111.11111111.11111111/32Host (single addr)
255.255.255.25411111111.11111111.11111111.11111110/31Unuseable
255.255.255.25211111111.11111111.11111111.11111100/302 useable
255.255.255.24811111111.11111111.11111111.11111000/296 useable
255.255.255.24011111111.11111111.11111111.11110000/2814 useable
255.255.255.22411111111.11111111.11111111.11100000/2730 useable
255.255.255.19211111111.11111111.11111111.11000000/2662 useable
255.255.255.12811111111.11111111.11111111.10000000/25126 useable
255.255.255.011111111.11111111.11111111.00000000/24"Class C" 254 useable
255.255.254.011111111.11111111.11111110.00000000/232 Class C's
255.255.252.011111111.11111111.11111100.00000000/224 Class C's
255.255.248.011111111.11111111.11111000.00000000/218 Class C's
255.255.240.011111111.11111111.11110000.00000000/2016 Class C's
255.255.224.011111111.11111111.11100000.00000000/1932 Class C's
255.255.192.011111111.11111111.11000000.00000000/1864 Class C's
255.255.128.011111111.11111111.10000000.00000000/17128 Class C's
255.255.0.011111111.11111111.00000000.00000000/16"Class B"
255.254.0.011111111.11111110.00000000.00000000/152 Class B's
255.252.0.011111111.11111100.00000000.00000000/144 Class B's
255.248.0.011111111.11111000.00000000.00000000/138 Class B's
255.240.0.011111111.11110000.00000000.00000000/1216 Class B's
255.224.0.011111111.11100000.00000000.00000000/1132 Class B's
255.192.0.011111111.11000000.00000000.00000000/1064 Class B's
255.128.0.011111111.10000000.00000000.00000000/9128 Class B's
255.0.0.011111111.00000000.00000000.00000000/8"Class A"
254.0.0.011111110.00000000.00000000.00000000/7
252.0.0.011111100.00000000.00000000.00000000/6
248.0.0.011111000.00000000.00000000.00000000/5
240.0.0.011110000.00000000.00000000.00000000/4
224.0.0.011100000.00000000.00000000.00000000/3
192.0.0.011000000.00000000.00000000.00000000/2
128.0.0.010000000.00000000.00000000.00000000/1
0.0.0.000000000.00000000.00000000.00000000/0IP space
0.0.0.0 00000000.00000000.00000000.00000000 /0 IP space
Before reboot the server my configuration was like this referred in explorer file:
[root@tpt01 ~]#ifconfig aggr420001
aggr420001: flags=201000843 mtu 1500 index 65
        inet 192.168.10.37 netmask ffffff00 broadcast 192.168.10.255
        ether 0:14:4f:87:50:b4
[root@tpt01 ~]#ifconfig aggr430001
aggr430001: flags=201000843 mtu 1500 index 65
        inet 192.168.10.39 netmask ffffff00 broadcast 192.168.10.255
        ether 0:14:4f:87:50:b4
[root@tpt01 ~]#ifconfig aggr440001
aggr440001: flags=201000843 mtu 1500 index 65
        inet 192.168.10.53 netmask ffffff00 broadcast 192.168.10.255
        ether 0:14:4f:87:50:b4
[root@tpt01 ~]#ifconfig aggr490001
aggr490001: flags=201000843 mtu 1500 index 65
        inet 192.168.10.61 netmask ffffff00 broadcast 192.168.10.255
        ether 0:14:4f:47:f9:14
[root@tpt01 ~]#ifconfig aggr520001
aggr520001: flags=201000843 mtu 1500 index 65
        inet 192.168.10.71 netmask ffffff00 broadcast 192.168.10.255
        ether 0:14:4f:47:f9:14
[root@tpt01 ~]#ifconfig aggr474001
aggr474001: flags=201000843 mtu 1500 index 65
        inet 192.168.10.89 netmask ffffff00 broadcast 192.168.10.255
        ether 0:14:4f:87:60:b4
[root@tpt01 ~]#reboot
When I rebooted, I can see one of my NIC (aggr474001) failed to plumb as well as after reboot my network configuration is showing wrong for couple of NIC's.
Here I gave only issue part of screenshot to understand.
Sun Fire T200, No Keyboard
Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.
OpenBoot 4.30.4.d, 32640 MB memory available, Serial #71578664.
Ethernet address 0:14:5f:77:f9:a0, Host ID: 8447f300.


Boot device: disk  File and args: 
NOTICE: nxge1: xcvr addr:0x0c - link is up 1000 Mbps full duplex
NOTICE: nxge3: xcvr addr:0x0a - link is up 1000 Mbps full duplex
NOTICE: nxge0: xcvr addr:0x0d - link is up 1000 Mbps full duplex
NOTICE: nxge2: xcvr addr:0x0b - link is up 1000 Mbps full duplex
NOTICE: nxge1: xcvr addr:0x0c - link is up 1000 Mbps full duplex
Failed to plumb IPv4 interface(s): 474001
Hostname: tpt01
How to identify wrong netmask values:
[root@tpt01 ~]# ifconfig -a | egrep -i "ff000000|ffff0000"
        inet 127.0.0.1 netmask ff000000 
        inet 192.168.10.37 netmask ff000000 broadcast 192.255.255.255
        inet 192.168.10.39 netmask ff000000 broadcast 192.255.255.255
        inet 192.168.10.53 netmask ff000000 broadcast 192.255.255.255
        inet 192.168.10.61 netmask ffff0000 broadcast 192.168.255.255
        inet 192.168.10.71 netmask ffff0000 broadcast 192.168.255.255
[root@tpt01 ~]#
To fix the above issues, I have done these are the steps:
Check whether all the configuration entries are ok and make sure there is no duplicate or wrong entry verifying by below configuration files.
I.e  for aggr420001 netmask entry is missing and aggr490001 everything is right but it took wrong netmask as well as duplicate file for 474001.
Let me explain how I fixed these issues.

Current status:
[root@tpt01 ~]# cat /etc/hostname.aggr420001
tpt01-420
[root@tpt01 ~]# cat /etc/hosts | grep -i tpt01-420
192.168.10.37    tpt01-420
[root@tpt01 ~]# cat /etc/hosts | grep -i 192.168.10.37
192.168.10.37    tpt01-420
[root@tpt01 ~]# cat /etc/netmasks | grep -i 192.168.10.37
[root@tpt01 ~]# cat /etc/hostname.aggr490001
tpt01-490
[root@tpt01 ~]# cat /etc/hosts | grep -i tpt01-490
192.168.10.61    tpt01-490
[root@tpt01 ~]# cat /etc/hosts | grep -i 192.168.10.61
192.168.10.61    tpt01-490
[root@tpt01 ~]# cat /etc/netmasks | grep -i 192.168.10.61
192.168.10.61 255.255.255.0
[root@tpt01 ~]# ls -ltr /etc/hostname.*|grep -i 474001
-rw-r--r--   1 root     root          13 Jul 28  2012 /etc/hostname.474001
-rw-r--r--   1 root     root          15 Feb 25 14:45 /etc/hostname.aggr474001
[root@tpt01 ~]#
To fix the issue added netmask entry in /etc/netmasks file:
[root@tpt01 ~]# cat /etc/hostname.aggr420001
tpt01-420
[root@tpt01 ~]# cat /etc/hosts | grep -i tpt01-420
192.168.10.37    tpt01-420
[root@tpt01 ~]# cat /etc/hosts | grep -i 192.168.10.37
192.168.10.37    tpt01-420
[root@tpt01 ~]# cat /etc/netmasks | grep -i 192.168.10.37
192.168.10.37 255.255.255.0
[root@tpt01 ~]#
To fix the issue added IP address with Classless Inter-Domain Routing (CIDR) in /etc/hostname.aggr490001 instead of host-aggr name:
[root@tpt01 ~]# cat /etc/hostname.aggr490001
192.168.10.61/24
[root@tpt01 ~]# cat /etc/hosts | grep -i tpt01-490
192.168.10.61    tpt01-490
[root@tpt01 ~]# cat /etc/hosts | grep -i 192.168.10.61
192.168.10.61    tpt01-490
[root@tpt01 ~]# cat /etc/netmasks | grep -i 192.168.10.61
192.168.10.61 255.255.255.0
[root@tpt01 ~]#
There are two entry as per the above output so deleted /etc/hostname.474001 file because as per my resent explorer output showed in above the file should be hostname.aggr474001 since it is VLAN aggr IP.
[root@tpt01 ~]# rm /etc/hostname.474001
[root@tpt01 ~]# ls -ltr /etc/hostname.*|grep -i 474001
-rw-r--r--   1 root     root          15 Feb 25 14:45 /etc/hostname.aggr474001
[root@tpt01 ~]#
After taken all the above steps it got fixed, we have rebooted and checked same, below is the after reboot output screenshots.
[root@tpt01 ~]#reboot
Sun Fire T200, No Keyboard
Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.
OpenBoot 4.30.4.d, 32640 MB memory available, Serial #71578664.
Ethernet address 0:14:5f:77:f9:a0, Host ID: 8447f300.

Boot device: disk  File and args: 
NOTICE: nxge1: xcvr addr:0x0c - link is up 1000 Mbps full duplex
NOTICE: nxge3: xcvr addr:0x0a - link is up 1000 Mbps full duplex
NOTICE: nxge0: xcvr addr:0x0d - link is up 1000 Mbps full duplex
NOTICE: nxge2: xcvr addr:0x0b - link is up 1000 Mbps full duplex
NOTICE: nxge1: xcvr addr:0x0c - link is up 1000 Mbps full duplex
Hostname: tpt01
[root@tpt01 ~]# ifconfig -a | egrep -i "192.168.10.37|192.168.10.39|192.168.10.53|192.168.10.61|192.168.10.71"
        inet 192.168.10.37 netmask ffffff00 broadcast 192.168.10.255
        inet 192.168.10.39 netmask ffffff00 broadcast 192.168.10.255
        inet 192.168.10.53 netmask ffffff00 broadcast 192.168.10.255
        inet 192.168.10.61 netmask ffffff00 broadcast 192.168.10.255
        inet 192.168.10.71 netmask ffffff00 broadcast 192.168.10.255
[root@tpt01 ~]#
--> Same like above steps done for all the five IP's. Hope this article will help you when you encounter these type of issue. 

Thanks for reading this post.

0 comments:

Post a Comment