OpenWrt Forum Archive

Topic: netmask weirdness

The content of this topic has been archived on 28 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

I have a weird problem:

I can't get the wrt to accept a nonstandard netmask.

I have an interface with a /27 netmask:

vlan0     Link encap:Ethernet  HWaddr 00:0F:66:HI:DD:EN 
          inet addr:10.97.1.6  Bcast:10.255.255.255  Mask:255.255.255.224

(I deleted the bridge originally present, but the same happens when aliassing the br0 interface).

But judging from the arp requests it broadcasts (or doesn't, depending on the situation), it seems to think it's on a /8 network.

For example, with that 10.97.1.6/27 it tries to adress for instance 10.0.1.1 directly on the interface, instead of going trough the default route.

The routing table looks ok too:

Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
10.97.1.0       0.0.0.0         255.255.255.224 U     0      0        0 vlan0
0.0.0.0         10.97.1.1       0.0.0.0         UG    0      0        0 vlan0

This is only my first day of playing with openwrt, so  maybe I'm missing something important, but I don't see why it behaves like this...  :shock:


EDIT: the device acts like it's on a /8, not /16 like I originally wrote

:oops: Oops :oops:

After trying again, it works. I have no idea what I did wrong, but it appears to be a user error :oops:

I had the same problem when changing IP addresses by hand (to 10.60.x.x/28 addresses) - I also found the WRT was sending arp requests for IPs it should not.

After setting the correct IPs in the nvram it all worked fine, so I assumed the boot scripts did something different, but I just checked and they run /sbin/ifup which calls ifconfig, so I don't know what the problem is either.

I have been playing with admcfg and there is an arp related bug here
although what is described there is different from what you and I are seeing.

- Matt

The discussion might have continued from here.