Static IP for NAS

Hi,

I'm having an issue setting a static IP for an external hard drive (NAS).

On LuCI I set the following:

But yet, the device will still get a leased address:

And I get the following message in the log:
Sat Sep 18 14:29:24 2021 daemon.warn dnsmasq-dhcp[1507]: not giving name DiskStation.lan to the DHCP lease of 192.168.1.168 because the name exists in /tmp/hosts/dhcp.cfg02411c with address 192.168.2.162

Version & Router:
LuCI Master (git-17.259.19938-f36f198) / LEDE ASUS RT-AC58U r173-27e3c68

Do you have VLANs configured on your router? It appears that the Diskstation is physically connected to the 192.168.1.0/24 network. If you have a 192.168.2.0/24 network, you need to make sure that the host is physically connected to the appropriate network (or if it is VLAN aware, that it is set for the correct VLAN ID).

Please copy the output of the following commands and post it here using the "Preformatted text </> " button:
grafik
Remember to redact passwords, MAC addresses and any public IP addresses you may have:

cat /etc/config/network
cat /etc/config/dhcp
cat /etc/config/firewall

Meanwhile, you are running a VERY old version of LEDE/OpenWrt. You should seriously consider upgrading to the latest (21.02) which is supported on your router. There are a lot of bug fixes and security improvements -- LEDE is no longer considered secure.

Do you have VLANs configured on your router? I don't think so.
192.168.2.0/24 network I don't quite understand what this means, I'm very beginner w.r.t networking. Can I just set it to a 192.168.1.xxx address? I think I tried that in the past and it didn't work either.

you are running a VERY old version of LEDE/OpenWrt Ok, thanks for advising, I will need to browse some threads on how to upgrade.

root@LEDE:~# cat /etc/config/network

config interface 'loopback'
        option ifname 'lo'
        option proto 'static'
        option ipaddr '127.0.0.1'
        option netmask '255.0.0.0'

config globals 'globals'
        option ula_prefix 'fddf:52f9:0a4b::/48'

config interface 'lan'
        option type 'bridge'
        option ifname 'eth0.1'
        option proto 'static'
        option ipaddr '192.168.1.1'
        option netmask '255.255.255.0'
        option ip6assign '60'

config device 'lan_dev'
        option name 'eth0.1'
        option macaddr '[redact]'

config interface 'wan'
        option _orig_ifname 'eth0.2'
        option _orig_bridge 'false'
        option ifname 'eth0.10'
        option proto 'pppoe'
        option username '[redact]'
        option ipv6 'auto'
        option password '[redact]'

config device 'wan_dev'
        option name 'eth0.2'
        option macaddr '[redact]'

config switch
        option name 'switch0'
        option reset '1'
        option enable_vlan '1'

config switch_vlan
        option device 'switch0'
        option vlan '3'
        option vid '10'
        option ports '0t 5t'

config switch_vlan
        option device 'switch0'
        option vlan '4'
        option vid '1'
        option ports '0t 1 2 3 4'

root@LEDE:~# cat /etc/config/dchp
cat: can't open '/etc/config/dchp': No such file or directory

root@LEDE:~# cat /etc/config/firewall

config defaults
        option syn_flood '1'
        option input 'ACCEPT'
        option output 'ACCEPT'
        option forward 'REJECT'

config zone
        option name 'lan'
        option input 'ACCEPT'
        option output 'ACCEPT'
        option forward 'ACCEPT'
        option network 'lan'

config zone
        option name 'wan'
        option input 'REJECT'
        option output 'ACCEPT'
        option forward 'REJECT'
        option masq '1'
        option mtu_fix '1'
        option network 'wan wan6 2degrees'

config forwarding
        option src 'lan'
        option dest 'wan'

config rule
        option name 'Allow-DHCP-Renew'
        option src 'wan'
        option proto 'udp'
        option dest_port '68'
        option target 'ACCEPT'
        option family 'ipv4'

config rule
        option name 'Allow-Ping'
        option src 'wan'
        option proto 'icmp'
        option icmp_type 'echo-request'
        option family 'ipv4'
        option target 'ACCEPT'

config rule
        option name 'Allow-IGMP'
        option src 'wan'
        option proto 'igmp'
        option family 'ipv4'
        option target 'ACCEPT'

config rule
        option name 'Allow-DHCPv6'
        option src 'wan'
        option proto 'udp'
        option src_ip 'fc00::/6'
        option dest_ip 'fc00::/6'
        option dest_port '546'
        option family 'ipv6'
        option target 'ACCEPT'

config rule
        option name 'Allow-MLD'
        option src 'wan'
        option proto 'icmp'
        option src_ip 'fe80::/10'
        list icmp_type '130/0'
        list icmp_type '131/0'
        list icmp_type '132/0'
        list icmp_type '143/0'
        option family 'ipv6'
        option target 'ACCEPT'

config rule
        option name 'Allow-ICMPv6-Input'
        option src 'wan'
        option proto 'icmp'
        list icmp_type 'echo-request'
        list icmp_type 'echo-reply'
        list icmp_type 'destination-unreachable'
        list icmp_type 'packet-too-big'
        list icmp_type 'time-exceeded'
        list icmp_type 'bad-header'
        list icmp_type 'unknown-header-type'
        list icmp_type 'router-solicitation'
        list icmp_type 'neighbour-solicitation'
        list icmp_type 'router-advertisement'
        list icmp_type 'neighbour-advertisement'
        option limit '1000/sec'
        option family 'ipv6'
        option target 'ACCEPT'

config rule
        option name 'Allow-ICMPv6-Forward'
        option src 'wan'
        option dest '*'
        option proto 'icmp'
        list icmp_type 'echo-request'
        list icmp_type 'echo-reply'
        list icmp_type 'destination-unreachable'
        list icmp_type 'packet-too-big'
        list icmp_type 'time-exceeded'
        list icmp_type 'bad-header'
        list icmp_type 'unknown-header-type'
        option limit '1000/sec'
        option family 'ipv6'
        option target 'ACCEPT'

config rule
        option name 'Allow-IPSec-ESP'
        option src 'wan'
        option dest 'lan'
        option proto 'esp'
        option target 'ACCEPT'

config rule
        option name 'Allow-ISAKMP'
        option src 'wan'
        option dest 'lan'
        option dest_port '500'
        option proto 'udp'
        option target 'ACCEPT'

config include
        option path '/etc/firewall.user'

config include 'miniupnpd'
        option type 'script'
        option path '/usr/share/miniupnpd/firewall.include'
        option family 'any'
        option reload '1'

config rule
        option name 'Filter-Facebook-Watch'
        option proto 'all'
        option src 'lan'
        option src_mac '[redact]'
        option dest 'wan'
        option weekdays 'Mon Tue Wed Thu Fri'
        option start_time '09:00:00'
        option stop_time '20:00:00'
        option target 'DROP'
        option enabled '0'

Yes. in fact, the address you were trying to set (192.168.2.162) is invalid based on your network configuration. You can use 192.168.1.x (where x is between 2 and 254, as long as it doesn't conflict with any of the other devices on the network).

This should solve your problem -- but report back either way.

If you'd like to get more info on the networking jargon I used, I'm happy to provide some links and such, but I don't want to overwhelm you if you were simply looking for a fix.

1 Like

This should solve your problem -- but report back either way. Yes, working perfectly thanks.

If you'd like to get more info on the networking jargon I used, I'm happy to provide some links and such, but I don't want to overwhelm you if you were simply looking for a fix. Yes, I would be interested, I'm a technically oriented person, just not very clued up on networking.

Glad that fixed it. Here's some material on subnets, VLANs, and CIDR notation. These will give you an overview of the conceptual frameworks and technical standards, but are platform independent.

There are OpenWrt specific articles for VLANs and some practical examples/tutorials on creating guest networks and guest wifi networks.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.