I have been trying to set up a static IP and DNS on my Pico Pro Max following the template found in the System Configuration area:
https://wiki.luckfox.com/Luckfox-Pico/L ... -Autostart
(Inserting the IP addresses to what I need.)
What I see in serial debug is udhcpc seems to show up at the end of the boot process and take over and then the static IP doesn't get set and the entry in resolv.conf is wiped out. Also USB0 doesn't seem to get set.
Are there setting changes that need to be made to udhcpc and where are those?
Also, it does not seem to pick up the settings from /etc/network/interfaces.
For my project, I really need a static IP address, but I also need access to DNS.
Setting Static IP address and DNS on Luckfox Pico Pro Max
Hello, you can add the startup script S99usb0staticip in /etc/init.d
add
usb0 ip is already set up in the S50usbdevice and S90usb0config, and you need to make sure that the new scripts run after them.
50 and 90 indicate the execution sequence.
Note: The S99usbstaticip requires the use of chmod a+x to add executable permissions.
To ensure that you can use the network properly, share the network to Remote NDIS based Internet Sharing Device.
add
Code: Select all
ifconfig usb0 xxx.xxx.xxx.xxx netmask xxx.xxx.xxx.xxx
route add default gw xxx.xxx.xxx.xxxd
echo "nameserver 114.114.114.114" > /etc/resolv.conf
50 and 90 indicate the execution sequence.
Note: The S99usbstaticip requires the use of chmod a+x to add executable permissions.
To ensure that you can use the network properly, share the network to Remote NDIS based Internet Sharing Device.
Thank you. I will try that.
With regards to the Static IP on Eth0, do I need to modify the init.d file S40network or create a new file for the Eth0 interface the same as you have described?
With regards to the Static IP on Eth0, do I need to modify the init.d file S40network or create a new file for the Eth0 interface the same as you have described?
You don't need to modify S40network. You can create a new file S99eth0staticip with the eth0 configuration.
add
Code: Select all
ifconfig eth0 xxx.xxx.xxx.xxx netmask xxx.xxx.xxx.xxx
route add default gw xxx.xxx.xxx.xxx
echo "nameserver 114.114.114.114" > /etc/resolv.conf
Yes, I just figured it out! Thanks!