From 446d320146514cbdfbda445464e714a23e1c8aba Mon Sep 17 00:00:00 2001 From: openwrtdiy <57249132+openwrtdiy@users.noreply.github.com> Date: Thu, 20 Jul 2023 04:35:03 +0800 Subject: [PATCH] custom: default lan ip start from 192.168.95.x --- package/base-files/Makefile | 6 +++--- package/base-files/files/bin/config_generate | 4 ++-- package/base-files/image-config.in | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/package/base-files/Makefile b/package/base-files/Makefile index 8732f82fb9815e..f428078015f4bc 100644 --- a/package/base-files/Makefile +++ b/package/base-files/Makefile @@ -83,9 +83,9 @@ define ImageConfigOptions echo 'pi_init_cmd=$(if $(CONFIG_TARGET_INIT_CMD),$(CONFIG_TARGET_INIT_CMD),"/sbin/init")' >>$(1)/lib/preinit/00_preinit.conf echo 'pi_init_suppress_stderr="$(CONFIG_TARGET_INIT_SUPPRESS_STDERR)"' >>$(1)/lib/preinit/00_preinit.conf echo 'pi_ifname=$(if $(CONFIG_TARGET_PREINIT_IFNAME),$(CONFIG_TARGET_PREINIT_IFNAME),"")' >>$(1)/lib/preinit/00_preinit.conf - echo 'pi_ip=$(if $(CONFIG_TARGET_PREINIT_IP),$(CONFIG_TARGET_PREINIT_IP),"192.168.1.1")' >>$(1)/lib/preinit/00_preinit.conf + echo 'pi_ip=$(if $(CONFIG_TARGET_PREINIT_IP),$(CONFIG_TARGET_PREINIT_IP),"192.168.95.1")' >>$(1)/lib/preinit/00_preinit.conf echo 'pi_netmask=$(if $(CONFIG_TARGET_PREINIT_NETMASK),$(CONFIG_TARGET_PREINIT_NETMASK),"255.255.255.0")' >>$(1)/lib/preinit/00_preinit.conf - echo 'pi_broadcast=$(if $(CONFIG_TARGET_PREINIT_BROADCAST),$(CONFIG_TARGET_PREINIT_BROADCAST),"192.168.1.255")' >>$(1)/lib/preinit/00_preinit.conf + echo 'pi_broadcast=$(if $(CONFIG_TARGET_PREINIT_BROADCAST),$(CONFIG_TARGET_PREINIT_BROADCAST),"192.168.95.255")' >>$(1)/lib/preinit/00_preinit.conf echo 'pi_preinit_net_messages="$(CONFIG_TARGET_PREINIT_SHOW_NETMSG)"' >>$(1)/lib/preinit/00_preinit.conf echo 'pi_preinit_no_failsafe_netmsg="$(CONFIG_TARGET_PREINIT_SUPPRESS_FAILSAFE_NETMSG)"' >>$(1)/lib/preinit/00_preinit.conf echo 'pi_preinit_no_failsafe="$(CONFIG_TARGET_PREINIT_DISABLE_FAILSAFE)"' >>$(1)/lib/preinit/00_preinit.conf @@ -96,7 +96,7 @@ ifeq ($(CONFIG_TARGET_DEFAULT_LAN_IP_FROM_PREINIT),y) echo 'board_config_update' >>$(1)/etc/board.d/99-lan-ip echo 'json_select network' >>$(1)/etc/board.d/99-lan-ip echo 'json_select lan' >>$(1)/etc/board.d/99-lan-ip - echo 'json_add_string ipaddr $(if $(CONFIG_TARGET_PREINIT_IP),$(CONFIG_TARGET_PREINIT_IP),"192.168.1.1")' >>$(1)/etc/board.d/99-lan-ip + echo 'json_add_string ipaddr $(if $(CONFIG_TARGET_PREINIT_IP),$(CONFIG_TARGET_PREINIT_IP),"192.168.95.1")' >>$(1)/etc/board.d/99-lan-ip echo 'json_add_string netmask $(if $(CONFIG_TARGET_PREINIT_NETMASK),$(CONFIG_TARGET_PREINIT_NETMASK),"255.255.255.0")' >>$(1)/etc/board.d/99-lan-ip echo 'json_select ..' >>$(1)/etc/board.d/99-lan-ip echo 'json_select ..' >>$(1)/etc/board.d/99-lan-ip diff --git a/package/base-files/files/bin/config_generate b/package/base-files/files/bin/config_generate index be21d0079a8a7f..00494b7496fb23 100755 --- a/package/base-files/files/bin/config_generate +++ b/package/base-files/files/bin/config_generate @@ -89,7 +89,7 @@ generate_static_network() { fi } -addr_offset=2 +addr_offset=96 generate_network() { local ports device macaddr protocol type ipaddr netmask vlan local bridge=$2 @@ -162,7 +162,7 @@ generate_network() { static) local ipad case "$1" in - lan) ipad=${ipaddr:-"192.168.1.1"} ;; + lan) ipad=${ipaddr:-"192.168.95.1"} ;; *) ipad=${ipaddr:-"192.168.$((addr_offset++)).1"} ;; esac diff --git a/package/base-files/image-config.in b/package/base-files/image-config.in index 9a728638133756..fa0b3d936fa8f6 100644 --- a/package/base-files/image-config.in +++ b/package/base-files/image-config.in @@ -83,7 +83,7 @@ config TARGET_PREINIT_IFNAME config TARGET_PREINIT_IP string prompt "IP address for preinit network messages" if PREINITOPT - default "192.168.1.1" + default "192.168.95.1" help IP address used to configure interface for preinit network messages, including failsafe messages @@ -99,7 +99,7 @@ config TARGET_PREINIT_NETMASK config TARGET_PREINIT_BROADCAST string prompt "Broadcast address for preinit network messages" if PREINITOPT - default "192.168.1.255" + default "192.168.95.255" help Broadcast address to which to send preinit network messages, as as failsafe messages