2

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.

3 Answers3

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
  • 3,463
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)

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
zx485
  • 2,337
Dagelf
  • 1,060