Hi, I need to upgrade router from stock to openwrt and because I'm doing this remotely, I need to do it right to save a long trip. Router is connected to the network via lan port, so I just need to preset different ip (and disable dhcp, which I can do in package/network/services/dnsmasq/files/dhcp.conf). Default openwrt IP 192.168.1.1 would make IP conflict after fw update.
I found file ./package/base-files/files/bin/config_generate which looks promising, closely this section:
case "$protocol" in
static)
local ipad
case "$1" in
lan) ipad=${ipaddr:-"192.168.1.1"} ;;
*) ipad=${ipaddr:-"192.168.$((addr_offset++)).1"} ;;
esac
netm=${netmask:-"255.255.255.0"}
uci -q batch <<-EOF
set network.$1.proto='static'
set network.$1.ipaddr='$ipad'
set network.$1.netmask='$netm'
set network.$1.ip6assign='60'
EOF
;;
But I never did this before. Can I just replace 192.168.1.1 with something like 192.168.1.111 and opewnrt will boot with this IP by default (also after firstboot)? Or is there another "documented" way of doing this?
Thanks.
Another question: everytime I modify some file like this, do I have to make clean, or make will know it's newer and compile it again?
(Last edited by nozombian on 10 Feb 2018, 17:01)