Static IP addressess not working

I was wondering if anyone could help me debug the cause of an issue I'm having with static IP addressess.

I set up static IPs in the Luci interface, tied to a specific MAC address, but it appears to have absolutley no effect whatsoever on the IP address allocation.

All I've tried is rebooting devices and router but I'm not sure where to look next to find the source of the problem.

1 Like

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

ubus call system board; \
uci export network; uci export dhcp; uci export firewall; \
"kernel": "4.14.167",
"hostname": "OpenWrt",
"system": "xRX200 rev 1.2",
"model": "BT Home Hub 5A",
"board_name": "bt,homehub-v5a",
"release": {
"distribution": "OpenWrt",
"version": "19.07.1",
"revision": "r10911-c155900f66",
"target": "lantiq/xrx200",
"description": "OpenWrt 19.07.1 r10911-c155900f66"
}
}
package 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 'fdfe:0564:5b8c::/48'

config atm-bridge 'atm'
option vpi '1'
option vci '32'
option encaps 'llc'
option payload 'bridged'
option nameprefix 'dsl'

config dsl 'dsl'
option annex 'b'
option tone 'a'
option ds_snr_offset '0'
option xfer_mode 'ptm'
option line_mode 'vdsl'

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_eth0_1_dev'
option name 'eth0.1'
option macaddr '00:00:00:00:00:00'

config interface 'wan'
option proto 'pppoe'
option ipv6 '1'
option password '********'
option ifname 'dsl0.101'
option username 'dsl001******@broadband.vodafone.co.uk'

config device 'wan_dsl0_dev'
option name 'dsl0'
option macaddr '00:00:00:00:00:00'

config interface 'wan6'
option ifname '@wan'
option proto 'dhcpv6'

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

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

config switch_vlan
option device 'switch0'
option vlan '2'
option ports '5 6t'

package dhcp

config dnsmasq
option domainneeded '1'
option localise_queries '1'
option rebind_protection '1'
option rebind_localhost '1'
option local '/lan/'
option domain 'lan'
option expandhosts '1'
option authoritative '1'
option readethers '1'
option leasefile '/tmp/dhcp.leases'
option localservice '1'

config dhcp 'lan'
option interface 'lan'
option start '100'
option limit '150'
option leasetime '12h'
option dhcpv6 'server'
option ra 'server'

config dhcp 'wan'
option interface 'wan'
option ignore '1'

config odhcpd 'odhcpd'
option maindhcp '0'
option leasefile '/tmp/hosts/odhcpd'
option leasetrigger '/usr/sbin/odhcpd-update'
option loglevel '4'

config domain
option name 'Raspberrypi'
option ip '192.168.1.246'

config host
option name 'raspberrypi'
option dns '1'
option ip '192.168.1.202'
option mac '00:00:00:00:00:00'

config host
option mac '00:00:00:00:00:00'
option ip '192.168.1.201'
option name 'printserver'
option dns '1'

package firewall

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

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

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

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 redirect
option src 'wan'
option name 'FTP'
option target 'DNAT'
option dest_ip '192.168.1.1'
option dest 'lan'
option dest_port '20-21'
option src_dport '20-21'

config redirect
option dest_port '22'
option src 'wan'
option name 'ssh'
option src_dport '22'
option target 'DNAT'
option dest 'lan'
option dest_ip '192.168.1.202'

config redirect
option dest_port '10090-10100'
option src 'wan'
option name 'Active FTP'
option src_dport '10090-10100'
option target 'DNAT'
option dest 'lan'

config redirect
option src 'wan'
option name 'Webserver'
option target 'DNAT'
option dest_ip '192.168.1.1'
option dest 'lan'
option dest_port '443'
option src_dport '443'

config redirect
option dest_port '60000-60010'
option src 'wan'
option name 'Mosh'
option src_dport '60000-60010'
option target 'DNAT'
option dest_ip '192.168.1.202'
option dest 'lan

Are these actually all zeros in your config file, or did you redact the MAC addresses? These need to match exactly with the MAC addresses of the devices themselves.

Meanwhile, you may have also posted your actual username and password for your pppoe connection -- you should edit the post to redact those details. I'm also adding @tmomas who I think can help with the backend to prevent the visibility after the edit.

Enable logging at the DHCP server, then watch the logs when you restart the service and when one of the affected devices boot; see what does the router answers to the devices.

These are the redacted MACs. They do correctly match.

Dammit, was only looking for IPs and MACs as instructed. Missed the un/ps. Now edited

I would also check if there is another device that could be working as DHCP server. Some router, repeater, access point.

1 Like

I am having similar problem with using static IP address on my raspberry Pi 4. I can't save and apply on the luci web interface or on putty terminal. It result in a disconnection error. I will have to revert to dhcp protocol as a result. Please help!!!

What is the current IP? ip -4 addr
What IP/mask/gateway are you trying to use?

Hi,

Found this post and am reactivating it as I have the same problem at the moment. For some reason my DHCP server has gone haywire. Using DHCP for a laptop gives a router address of 10.0.0.4 instead of the default 10.0.0.1.

I have the internet provider router set to 192 .168 .0.1 with DHCP deactivated. My openwrt router connects as 192.168 .0.10 with an active DHCP reserving addresses in the range 1 to 155 as static and 156 up as dynamic. I then have a deco power line system connected to get wifi around the property (we have 600mm stone walls) which is set to access point (so no DHCP options are shown and I assume are therefore disabled). However, the master Deco unit has the address 10.0.0.4 which is the rogue router number on DHCP allocation.

Recently my openvix satellite receiver obtained two separate and working IP addresses 10.0.0.155 and .153 (it is this issue I am trying to solve as it is interfering with the distribution of TV over my internal network). I have now reset and rebooted and the .153 address has gone but it was then I discovered that a laptop washing server 10.0.0.4 as the router/gateway address and hence getting no internet access.

I was interested in this comment:

as I did not know that an access point could issue DHCP addresses. Is this true? I will convert it back to a router to see if the DHCP server has turned itself on after rebooting but there are there strange behaviours that I do not understand.

Here is the output from arp -a (MaAC addresses redacted;

Last login: Sat Dec 4 00:56:13 on console
gjj@JCP-MacBook-Air ~ % arp -a
? (10.0.0.1) at 00:00:00:00:00:00 on en0 ifscope [ethernet]
? (10.0.0.4) at 00:00:00:00:00:00 on en0 ifscope [ethernet]
? (10.0.0.40) at 00:00:00:00:00:00 on en0 ifscope [ethernet]
? (10.0.0.100) at 00:00:00:00:00:00 on en0 ifscope [ethernet]
? (10.0.0.103) at 00:00:00:00:00:00 on en0 ifscope [ethernet]
? (10.0.0.111) at 00:00:00:00:00:00 on en0 ifscope [ethernet]
? (10.0.0.155) at 00:00:00:00:00:00 on en0 ifscope [ethernet]
? (169.254.58.129) at 00:00:00:00:00:00 on en0 [ethernet]
? (224.0.0.251) at 00:00:00:00:00:00 on en0 ifscope permanent [ethernet]
? (239.255.255.250) at 00:00:00:00:00:00 on en0 ifscope permanent [ethernet]
gjj@JCP-MacBook-Air ~ %

.103 and .111 are items that should not appear as they are not static set by me and dynamic allocation should only be a56 and above so how have they appeared? How do I find out what they are?

Also, they may not be a problem but I do not recognise or understand the last three addresses that are not in my defined ranges (192.168.0.0 and 10.0.0.0).

Can anyone shed some light for me please?

Also this is the output from:

With MAC addresses redacted.

BusyBox v1.30.1 () built-in shell (ash)

  _______                     ________        __
 |       |.-----.-----.-----.|  |  |  |.----.|  |_
 |   -   ||  _  |  -__|     ||  |  |  ||   _||   _|
 |_______||   __|_____|__|__||________||__|  |____|
          |__| W I R E L E S S   F R E E D O M
 -----------------------------------------------------
 OpenWrt 19.07.7, r11306-c4a6851c72
 -----------------------------------------------------
root@OCD:~# ubus call system board; \
> uci export network; uci export dhcp; uci export firewall; \
> 
{
	"kernel": "4.14.221",
	"hostname": "OCD",
	"system": "MediaTek MT7621 ver:1 eco:3",
	"model": "Newifi-D2",
	"board_name": "d-team,newifi-d2",
	"release": {
		"distribution": "OpenWrt",
		"version": "19.07.7",
		"revision": "r11306-c4a6851c72",
		"target": "ramips/mt7621",
		"description": "OpenWrt 19.07.7 r11306-c4a6851c72"
	}
}
package 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 'fd8b:8839:917f::/48'

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

config device 'lan_eth0_1_dev'
	option name 'eth0.1'
	option macaddr '00:00:00:00:00:00'

config interface 'wan'
	option ifname 'eth0.2'
	option proto 'dhcp'

config device 'wan_eth0_2_dev'
	option name 'eth0.2'
	option macaddr '00:00:00:00:00:00'

config interface 'wan6'
	option ifname 'eth0.2'
	option proto 'dhcpv6'

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

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

config switch_vlan
	option device 'switch0'
	option vlan '2'
	option ports '4 6t'

config interface 'KodiVPN'
	option ifname 'tun0'
	option proto 'none'

package dhcp

config dnsmasq
	option domainneeded '1'
	option localise_queries '1'
	option rebind_protection '1'
	option rebind_localhost '1'
	option local '/lan/'
	option domain 'lan'
	option expandhosts '1'
	option authoritative '1'
	option readethers '1'
	option leasefile '/tmp/dhcp.leases'
	option resolvfile '/tmp/resolv.conf.auto'
	option localservice '1'

config dhcp 'lan'
	option interface 'lan'
	option leasetime '12h'
	option dhcpv6 'server'
	option ra 'server'
	option ra_management '1'
	option start '151'
	option limit '48'

config dhcp 'wan'
	option interface 'wan'
	option ignore '1'

config odhcpd 'odhcpd'
	option maindhcp '0'
	option leasefile '/tmp/hosts/odhcpd'
	option leasetrigger '/usr/sbin/odhcpd-update'
	option loglevel '4'

config host
	option mac '00:00:00:00:00:00'
	option dns '1'
	option name 'DecoP9-Upper-Hall'
	option ip '10.0.0.2'
	option leasetime '691200'

config host
	option mac '00:00:00:00:00:00'
	option name 'DecoP7-Kitchen'
	option dns '1'
	option ip '10.0.0.4'
	option leasetime '691200'

config host
	option mac '00:00:00:00:00:00'
	option leasetime '691200'
	option dns '1'
	option name 'DecoP7-Living-Room'
	option ip '10.0.0.5'

config host
	option mac '00:00:00:00:00:00'
	option leasetime '691200'
	option dns '1'
	option name 'DecoP7-Office'
	option ip '10.0.0.6'

config host
	option mac '00:00:00:00:00:00'
	option leasetime '691200'
	option dns '1'
	option name 'Sonos-Bridge'
	option ip '10.0.0.11'

config host
	option mac '00:00:00:00:00:00'
	option leasetime '691200'
	option dns '1'
	option name 'Sonos-Play1-Lounge'
	option ip '10.0.0.12'

config host
	option mac '00:00:00:00:00:00'
	option leasetime '691200'
	option dns '1'
	option name 'Sonos-Play1-Bedroom'
	option ip '10.0.0.13'

config host
	option mac '00:00:00:00:00:00'
	option leasetime '691200'
	option dns '1'
	option name 'Sonos-One-L'
	option ip '10.0.0.14'

config host
	option mac '00:00:00:00:00:00'
	option leasetime '691200'
	option dns '1'
	option name 'Sonos-One-R'
	option ip '10.0.0.15'

config host
	option mac '00:00:00:00:00:00'
	option leasetime '691200'
	option dns '1'
	option name 'Sonos-Connect-Office'
	option ip '10.0.0.16'

config host
	option mac '00:00:00:00:00:00'
	option name 'GJJ-IMAC'
	option dns '1'
	option ip '10.0.0.40'
	option leasetime '691200'

config host
	option mac '00:00:00:00:00:00'
	option dns '1'
	option name 'JCP-SE-2020'
	option ip '10.0.0.45'
	option leasetime '691200'

config host
	option mac '00:00:00:00:00:00'
	option name 'JCP-Macbook-Air'
	option dns '1'
	option ip '10.0.0.50'
	option leasetime '691200'

config host
	option name 'JCP-iPad-Mini'
	option leasetime '691200'
	option dns '1'
	option ip '10.0.0.55'

config host
	option mac '00:00:00:00:00:00'
	option name 'GJJs-iPad-4'
	option dns '1'
	option ip '10.0.0.70'
	option leasetime '691200'

config host
	option mac '00:00:00:00:00:00'
	option name 'Apple-TV'
	option dns '1'
	option ip '10.0.0.75'
	option leasetime '691200'

config host
	option mac '00:00:00:00:00:00'
	option leasetime '691200'
	option dns '1'
	option name 'Raspberry-Pi-Kodi'
	option ip '10.0.0.80'

config host
	option mac '00:00:00:00:00:00'
	option leasetime '691200'
	option dns '1'
	option name 'Hisense-TV'
	option ip '10.0.0.85'

config host
	option mac '00:00:00:00:00:00'
	option leasetime '691200'
	option dns '1'
	option name 'Humax-Freesat'
	option ip '10.0.0.95'

config host
	option mac '00:00:00:00:00:00'
	option dns '1'
	option name 'GJJ-SE-2020'
	option ip '10.0.0.100'
	option leasetime '691200'

config host
	option mac '00:00:00:00:00:00'
	option name 'VBoxTV'
	option dns '1'
	option ip '10.0.0.120'
	option leasetime '691200'

config host
	option mac '00:00:00:00:00:00'
	option name 'GigaBlueUHDUE4K'
	option dns '1'
	option ip '10.0.0.155'

package firewall

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

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

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

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 zone
	option network 'KodiVPN'
	option forward 'REJECT'
	option name 'OpenVPN'
	option output 'ACCEPT'
	option input 'REJECT'
	option masq '1'
	option mtu_fix '1'

config forwarding
	option dest 'OpenVPN'
	option src 'lan'

root@OCD:~# 

You've found your rogue DHCP server.

Sure, if DHCP is not switched off.

Most likely devices that got settings from the Deco.

169.254. is link local address.
224.0. and 239.255 are multicast addresses.
All three are not connected to your issue.

1 Like

Thanks for taking the time trendy. I checked the Deco access point and as a result had to rebuild the entire Deco network! I could not see how it was set but I made sure the DHPC (which they tell me should switch off automatically) is set to a recognisably different subnet so I will know if it does it again.

I don’t really understand link and multicast addresses (and not sure I need to) but thanks for letting me know they are not the issue.

The router has started listing leases properly again so I shall leave it alone.

The network is back working fine but the original issue is still with me but that is for another forum.

Geoff

1 Like