I need to add an address on the LAN side of a router. It's easiest if I can put it on the existing subnet 192.168.1.0/24 given in config/network
:
config interface 'lan1'
option ifname 'eth1'
option proto 'static'
option ipaddr '192.168.1.1'
option netmask '255.255.255.0'
I can succesfully add a temporary address using
ip addr add 192.168.11.77 dev eth1
which shows up:
# ip addr show eth1
3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP qlen 1000
link/ether 00:0xxxxxxxxxxx brd ff:ff:ff:ff:ff:ff
inet 192.168.1.1/24 brd 192.168.11.255 scope global eth1
valid_lft forever preferred_lft forever
inet 192.168.1.77/32 scope global eth1
valid_lft forever preferred_lft forever
and successfully ping it.
On OpenWRT (how) can it be made permanent via a config file?
I looked at the this example for a non-bridge interface, changing it to use the same subnet:
config interface 'lan1-77'
option ifname 'eth1'
option proto 'static'
option ipaddr '192.168.1.77'
option netmask '255.255.255.0'
however it hung on boot. (Maybe the '-' was illegal?).