22 February 2014

Netmask doesn't make sense with host route, SIOCADDRT: No such process,

I had this weird situation that no where in hell I could make my new VM get connected to the network.

It was a new machine just installed with RHEL 6.5, the VM settings were all good, it has connected to the right Virtual Network which it suppose to connect to in VM settings, the other VMs residing on the same Esxi host are all good and settings are all same, and I was like gazillion times checked every bloody settings.

The IP that I had received from our beloved network team was like below:

IP       : 10.8.230.64
Netmask  : /26 (255.255.255.192)
Gateway  : 10.8.230.1

I have assigned this bloody IP  to eth0, the result of ifconfig was same as other VMs but not exactly the same:

# ifconfig
eth0      Link encap:Ethernet  HWaddr 00:50:56:B7:4A:60
          inet addr:10.8.230.7  Bcast:10.8.230.127  Mask:255.255.255.192
          inet6 addr: fe80::250:56ff:feb7:4a60/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:25 errors:0 dropped:0 overruns:0 frame:0
          TX packets:10 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:2316339922 (2.1 GiB)  TX bytes:5178740184 (4.8 GiB)

in other VMs:

# ifconfig
eth0      Link encap:Ethernet  HWaddr 00:50:56:B7:4A:60
          inet addr:10.8.230.7  Bcast:10.8.230.63  Mask:255.255.255.192
          inet6 addr: fe80::250:56ff:feb7:4a60/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:20325009 errors:0 dropped:0 overruns:0 frame:0
          TX packets:21530575 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:2316514207 (2.1 GiB)  TX bytes:5178978642 (4.8 GiB)


And I was wondering how come network card comes up with different Broadcast while the settings of both VMs are the same.


Another issue was that default gateway was't set:

# netstat -rn
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
10.8.230.0      0.0.0.0         255.255.255.192 U         0 0          0 eth0
169.254.0.0     0.0.0.0         255.255.0.0     U         0 0          0 eth0

and when I tried to set the default gateway manually, I receive this error:

# route add default gw 10.8.230.1 eth0
SIOCADDRT: No such process

and when I tried to estate the obvious and first add the route to the gateway, error was:

# route add 10.8.230.1/26 dev eth0
route: netmask 0000003f  doesn't make sense with host route

and I'm like whattt on earth?! I even couldn't ping the default gw which makes me check the VM network settings from VMware side like 10 times!


Finally after all usual checks, I needed to check the obvious! I put the network team given IP and its netmask to an IP calculator, guess what?! Following is the result of the IP calculator:


Address:   10.8.230.7            00001010.00001000.11100110.00 000111
Netmask:   255.255.255.192 = 26  11111111.11111111.11111111.11 000000
Wildcard:  0.0.0.63              00000000.00000000.00000000.00 111111
=>
Network:   10.8.230.0/26         00001010.00001000.11100110.00 000000 (Class A)
Broadcast: 10.8.230.63           00001010.00001000.11100110.00 111111
HostMin:   10.8.230.1            00001010.00001000.11100110.00 000001
HostMax:   10.8.230.62           00001010.00001000.11100110.00 111110
Hosts/Net: 62                    (Private Internet)


You got it?! The given IP is out of the bloody range based on its netmask! 
IP range 10.8.230.0 with mask /26 (255.255.255.192) has max of 10.8.230.62 and my IP was: 10.8.230.64, fantastic!


Gawd! Sometimes really need to check the obvious and not just simply rely on your network team!





8 comments:

  1. Hello there! Nice post! Please inform us when all could see a follow up! web design agency

    ReplyDelete
  2. First, let’s kill off a genuine fabrication: You can not use a reverse cellular phone number lookup for totally free anywhere, anytime. product designer

    ReplyDelete
  3. You’ll notice several contrasting points from New york Weight reduction eating plan and every one one may be useful. The first point will probably be authentic relinquishing on this excessive. lose weight ui/ux

    ReplyDelete
  4. Hey! Do you know if they make any plugins to help with SEO? I’m trying to get my blog to rank for some targeted keywords but I’m not seeing very good results. If you know of any please share. Thanks! ipad psd

    ReplyDelete
  5. Thanks for sharing excellent informations. Your web-site is very cool. I'm impressed by the details that you have on this web site. It reveals how nicely you perceive this subject. Bookmarked this web page, will come back for extra articles. You, my pal, ROCK! I found simply the information I already searched all over the place and simply couldn't come across. What a perfect web-site. macbook mockups

    ReplyDelete
  6. Great info many thanks sharing and reaching us your subscriber list. free phone mockup

    ReplyDelete
  7. I can’t remember the last time I enjoyed an article as much as this one. You have gone beyond my expectations on this topic and I agree with your points. You’ve done well with this. webflow design agency

    ReplyDelete
  8. Excellent blog right here! Also your site a lot up very fast! What web host are you the use of? Can I am getting your associate link to your host? I want my site loaded up as quickly as yours lol top website development company

    ReplyDelete