Static IP Address
-
No matter what I've tried, I can NOT set a static IP address.
After remounting / rw.
/etc/network/interfaces:
auto lo
iface lo inet loopbackallow-hotplug eth0
iface eth0 inet static
address 192.168.2.XX
netmask 255.255.255.0
gateway 192.168.2.1reboot - DHCP address..
Been at this for hours, where oh where is dhcp configured??? -
@xstrex Have you followed https://github.com/recalbox/recalbox-os/wiki/Manual-IP-settings-(EN) ?
-
@Substring I have followed them to the T, even copied and pasted the config found there, but updated it for my network settings. The ifup eth0 && ifdown eth0 works, and gives me the correct IP address. But if I reboot, I'm back at the dynamic IP, no matter what I've tried.
-
@xstrex can't check for niw, but part of the config could be in /var. Have you looked around there ?
-
For everyone who needs static IP address (for Port Forwarding/Netplay):
Recalbox should be on and connected to the same modem/network as your PC. Tested on Windows 10:
Go to Command Prompt (On Keyboard press Win Key+R, type: cmd and enter)
Type the following commands:ping recalbox
(You'll get your recalbox's IP address) In this case, 192.168.1.16 as example:then type:
ssh root@192.168.1.16 (enter)
Answer 'yes' to all the questions, it will ask for your recalbox's root password, type recalboxroot as password.Type:
connmanctl services and note what is returned, for example:
*AO Wired ethernet_b827eb6462be_cableThen type:
cd (enter)
and then type:
nano custom.sh (enter)Type the following text in nano editor:
#!/bin/bash
/usr/bin/connmanctl config ethernet_b827eb6462be_cable --ipv4 manual 192.168.1.16 255.255.255.0 192.168.1.1
mount -o remount,rw /
echo "nameserver 208.67.222.222" >> /etc/resolv.conf
echo "nameserver 208.67.220.220" >> /etc/resolv.confPlease note that in our example custom.sh file:
192.168.1.16: Your recalbox's IP address that'll be static.
255.255.255.0: Your Subnet Mask
192.168.1.1: Your modem/router IP address.Replace ethernet_*** by the value you've got previously and the IP address you want to give. You might wish to replace the DNS server IPs of the OpenDNS project, with the DNS servers (if any) provided by your own ISP.
Then quit from nano text editor by Ctrl X, answer the saving question by typing Y and then finally Enter.
After quiting nano and back to terminal shell, type the command:
chmod +x custom.sh
to make it executable, then:
reboot
to restart your Recalbox.Finally, go to your modem/router Port Forwarding page, forward the port numbered 55435 (both TCP/UDP) to your Recalbox's IP address.
Successfully tested on Recalbox 6.0.
Let me know in case if you have any problem. -
@tekkenism Hello, I tried the method that you posted and after I rebooted recalbox it went back to dynamic IP. I don't know what can be wrong with it.
Regards
-
Most home internet box and routers have everything you need:
Regarding port forwarding, most devices have PAT/NAT option taking a hostname or an IP. Just configure your target machine using its hostname: RECALBOX
Then, if you still need static IP addresses, most devices allow to reserve and assign IPs to devices identified by their MAC addresses. IMHO it's the cleaner way to assign static IP in a home network.
If it's still not enough, pick up an IP address outside the range of your DHCP, and fill in the required fields in recalbox.conf:
wifi.ip=manual ip address wifi.gateway=new gateway wifi.netmask=new netmask