In Linux, why can't I access my network after subnetting with a mask of 255.255.255.240?

1

OK, first I have a dual boot system. Linux Mint 18 (Sarah) Cinnamon and Windows 7 SP1. Good thing I did this, because I'm new to Linux.

When I first installed both Windows and Linux, I setup LAN1 as 192.168.1.1/255.255.255.0. I had no problem accessing LAN1 or the Internet from either OS.

Recently I decided to subnet. I changed LAN1 to 192.168.64.80/255.255.255.240. This gave me x.x.x.80 as the gateway, 14 usable IP's as x.x.x.81-x.x.x.94, which is plenty, and x.x.x.95 as broadcast. I then rebooted the router and the new IP's were propagated via DHCP. Windows networking received the DHCP data and I could access LAN1 and the Internet with no problems. Tried the same with Linux and can't access anything on LAN1 or the Internet. Consulting both the network applet on the desktop, and ifconfig via terminal, it was clear that Linux was aware of the new DHCP data. So I'm confused as to why I can't access anything!

Does anyone know the peculiarities of Linux networking, such that I can repair that which obviously requires repair?

Thanks in Advance.

user502336

Posted 2017-03-17T19:00:07.317

Reputation: 11

1"This gave me x.x.x.80 as the gateway," No, that would be incorrect. That is the network address. You cannot use the network address for a host, e.g. gateway. – Ron Maupin – 2017-03-17T19:08:14.270

Surely this is simply a terminology problem. To me the "gateway" is that IP that one would access the web configurator from a PC on the LAN. It's always the first IP of a subnet. – user502336 – 2017-03-17T19:12:47.573

3@user502336 that's correct, but @RonMaupin's comment stands. the first usable host IP on 192.168.64.80/255.255.255.240 is 192.168.64.81. similar to how the first usable host IP on 192.168.1.0/255.255.255.0 is 192.168.1.1. – quixotic – 2017-03-17T19:43:14.657

Answers

4

I think your problem is that you are trying to use the network address as the gateway address, but you cannot do that. A gateway is a host on the network, and it must have a host address. The gateway is the host to which all the other hosts send traffic destined for a different network, but it is still a host on the network, and it must use a host address. The network address is unusable, and it should not appear as the source or destination address in any IPv4 packets.

For your example, 192.168.64.80/28:

Network    = 192.168.64.80
First host = 192.168.64.81
Last host  = 192.168.64.94
Broadcast  = 192.168.64.95

You must choose your gateway address from one of the host addresses. Some people use the first host address as the standard address for the gateway, and some people use the last host address. Some people just choose any host address. It doesn't actually matter since the gateway is a host on the network.

Ron Maupin

Posted 2017-03-17T19:00:07.317

Reputation: 3 130

OK Ron, If I've set up LAN1 incorrectly why is Windows having no problem while Linux is? Is it that Windows is smart enough to overcome my failure somehow, while Linux is not? – user502336 – 2017-03-17T19:24:17.747

1Without more information, it is hard to say, but I have given you how you must use IP addressing to meet the standards. Your gateway should not allow you to set any of its interfaces to the network address, so the gateway may have an incorrect mask configured on the gateway, or there may be something set incorrectly in your DHCP server. You have not provided any configurations of any devices. – Ron Maupin – 2017-03-17T19:31:25.560

OK these terms are straight from the router: – user502336 – 2017-03-17T19:34:10.810

1I see what you say you have the router configured as, but I don't see the actual router configuration in your question. Assuming you have the mask as you claim, and that the router is your gateway, the router should not allow you to set the network address as an address on its interface. If it does, then there is something terribly wrong with it. A network address cannot be used for a host address on a network. – Ron Maupin – 2017-03-17T19:39:30.297

OK these terms are straight from the router: IP Address Assignment: 192.168.64.80; Subnet Mask: 255.255.255.240; DHCP Setting IP Pool Start Address (Optional): 192.168.64.81; Pool Size: 14. Then my switch not the router, is set to receive the first in the pool. In Windows, I can access the routers web configurator via 192.168.64.80 Do you need more or is that enough to see my folly? (Your site timed me out. This is what I wanted to say above.) – user502336 – 2017-03-17T19:43:02.440

@user502336 Seeing the configuration of the Linux machine would help a lot. The output of ifconfig -a and/or route -n would be helpful. – David Schwartz – 2017-03-17T19:45:29.093

1Apparently, your router has some crappy software. You simply cannot use the network address as the address of a host on the network, IPv4 doesn't work that way. You should edit your question to include the router, Windows PC, and Linux PC configurations. – Ron Maupin – 2017-03-17T19:48:36.977

if he's assigned the address 192.68.64.80 to the router, perhaps he's managed to create the network 192.68.64.79/28 instead. – quixotic – 2017-03-17T19:49:36.090

@ David Schwartz: That would require a reboot, as I said I'm on a dual boot system. I'm using the Windows partition now so as to be capable of communicating with you. – user502336 – 2017-03-17T19:49:55.020

Thanks Ron! I'll see what I can do to fix the routers setup, then get back to you. In truth it's been quite a while since I did this kind of thing. I recently had a router that lasted 10 years die, this is the setup on the new one, and it has a very different interface than the old one. – user502336 – 2017-03-17T20:00:02.293

1

Cisco routers have a global configuration command ip subnet-zero which permits the use of the network address as a host. However, not all IP implementations support this by default, as is the case here.

However, later versions of IOS seem to have enabled ip subnet-zero by default, and so, your router is probably not out of its mind by letting you configure it as such.

However, your linux box might not be configured to use subnet zero. There may be a sysctl setting; there may be some additional ifconfig or route flags to set to use subnet zero. However, I'm not running linux and so I can't check to see if any of the googled methods for using subnet zero actually work as intended.

From cisco's website on configuring subnet-zero..

Subnetting with a subnet address of 0 is illegal and strongly discouraged (as stated in RFC 791) because of the confusion that can arise between a network and a subnet that have the same addresses. For example, if network 131.108.0.0 is subnetted as 255.255.255.0, subnet 0 would be written as 131.108.0.0—which is identical to the network address.

You can use the all 0s and all 1s subnet (131.108.255.0), even though it is discouraged. Configuring interfaces for the all 1s subnet is explicitly allowed. However, if you need the entire subnet space for your IP addresses ... (use command in bold-italics, above)

Nevin Williams

Posted 2017-03-17T19:00:07.317

Reputation: 3 725

"Cisco routers have a global configuration command IP subnet-zero which permits the use of the network address as a host." That is not what subnet zero means. Originally you could not use a subnet of all zeroes or all ones as defined by the class networks. Network classes have been deprecated since 1933 by RFCs 1518 and 1519, which defined CIDR (Classless Inter-Domain routing). It has nothing to do with host addresses, only subnet addresses that are all zeroes or all ones. All zeroes or all ones host addresses are still not valid host addresses. – Ron Maupin – 2017-03-19T06:44:25.637

1

Linux has no problem with this. When I've run into problems like this, it was usually one of the following:

  • A default firewall installed on the OS, check with:

    sudo iptables -nvxL
    

    (note the policies too)

  • A typo in the network configuration - on client or server

  • A typo in a configuration command, like ifconfig - it can configure completely bogus addresses, and some implementations don't accept CIDR (/28) notation, you have to type it out, or use the keyword "netmask".
  • Duplicate MAC addresses

    cat /proc/net/arp  
    
  • An IP address in the same range on another network interface

  • Virus infection on a router, check the firmware
  • Network switch with ports that froze, reboot it

Dagelf

Posted 2017-03-17T19:00:07.317

Reputation: 585