Skip to content

Commit

Permalink
custom: default lan ip start from 192.168.95.x
Browse files Browse the repository at this point in the history
  • Loading branch information
openwrtdiy committed Jul 19, 2023
1 parent 2e07833 commit 446d320
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions package/base-files/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions package/base-files/files/bin/config_generate
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions package/base-files/image-config.in
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 446d320

Please sign in to comment.