Page 1 of 2

Static IP on Toon for external control

Posted: Fri Feb 22, 2019 9:58 pm
by said0066
Hi,

How do I give my rooted Toon a static IP address? It now has a dynamic IP address.

Also, after I have done this, how do I portforward the correct port in my router for external control out of my home network? In my home network I have x11vnc control on port 5900 on my android Phone.

I have a ASUS AC87U.

Thanks in advance.

Re: Static IP on Toon for external control

Posted: Fri Feb 22, 2019 10:15 pm
by marcelr
You don't really need a static IP. All you want is probably that your DHCP server assigns the same IP address to your toon every time it connects to your router.
Checkout "Enable Manual Assignment" in your DHCP server settings to do this, and "Port Forwarding" in the WAN settings to forward the port for VNC to your toon.

Re: Static IP on Toon for external control

Posted: Sun Feb 24, 2019 4:45 pm
by richardklasens
Hi all.

I want to do the same, because (for the time beeing,) i'm stuck with a Huawei 4g (b525-23a) Mobile internet Router.
I dont have Ziggo or a Fiber-connected internet possiblity for now. no cables leading to my house :(

Point is, that with my Huawei 4g Modem i can't force the modem to assign a fixed IP to my Toon.
The only option for now is setting a fixed IP in my Toon.
Somebody knows how to do that?

FW 5.0.4
Rooted with full automatic Script by MartenJacobs.

Thanks!

Re: Static IP on Toon for external control

Posted: Sun Feb 24, 2019 6:20 pm
by TheHogNL
Static IP on the toon itself (not recommended, but ok if you really want it):

/qmf/config/config_hcb_netcon.xml

Change for the interface you want to set static ip (eth0 or wlan0):

Code: Select all

    <configtype>dhcp</configtype>
to

Code: Select all

    <configtype>static</configtype>
and add

Code: Select all

    <static_ipaddress>192.168.178.65</static_ipaddress>
    <static_netmask>255.255.255.0</static_netmask>
    <static_gateway>192.168.178.1</static_gateway>
    <static_nameserver>192.168.178.1</static_nameserver>
Be sure you keep this config within the <interfaceSettings> for the interface you want to set the static ip for. Then reboot.

Note: /etc/network/interfaces will then be change to contain this IP adres. But never change the IP adres there as this is overwritten by hcb_netcon, a internal toon process.

Re: Static IP on Toon for external control

Posted: Sun Feb 24, 2019 6:51 pm
by marcelr
... and make sure to make NO mistakes in typing.

If the software cannot set the static IP because of a typo, you will have to open up your toon again ...

Re: Static IP on Toon for external control

Posted: Mon Feb 25, 2019 7:06 pm
by richardklasens
marcelr wrote:... and make sure to make NO mistakes in typing.

If the software cannot set the static IP because of a typo, you will have to open up your toon again ...
I can also connect thru the wired ethernetport, if i Made a misstake?

Re: Static IP on Toon for external control

Posted: Mon Feb 25, 2019 7:18 pm
by TheHogNL
Only if your mistake doesn't also affect the ethernetport config :-)

Re: Static IP on Toon for external control

Posted: Mon Feb 25, 2019 7:39 pm
by richardklasens
In that case.. do not try to make a mistake :lol:

Re: Static IP on Toon for external control

Posted: Mon Feb 25, 2019 7:43 pm
by TheHogNL
But yeah, you could always connect on the serial port again if you break it. Just try it. Making failures will only help you get better skills 8)

Re: Static IP on Toon for external control

Posted: Thu Feb 28, 2019 2:12 am
by richardklasens
Thnx for the info! Worked like a charm! :D

Re: Static IP on Toon for external control

Posted: Sun Jul 28, 2019 12:19 am
by hellwich
Worked like a charm, but how to add a second static nameserver?

Re: Static IP on Toon for external control

Posted: Sun Jul 28, 2019 9:09 am
by TheHogNL
hellwich wrote:Worked like a charm, but how to add a second static nameserver?
If you think your really need this, create this file "/etc/udhcpc.d/90custom"
(change the ns to your own secondary NS)

Code: Select all

ns="8.8.8.8"
if ! grep -q $ns /etc/resolv.conf
then
        echo "$0: Adding secondary DNS $ns"
        echo "nameserver $ns" >> /etc/resolv.conf
fi
Change it to allow to execute with:

Code: Select all

chmod +x /etc/udhcpc.d/90custom
And your are done.

edit: this only works for DHCP received addresses. For static you should put this script in a file in /etc/rc5.d/S99custom (and also set chmod +x)

Re: Static IP on Toon for external control

Posted: Sun Jul 28, 2019 10:48 am
by hellwich
I've added the script in the specified location, but it seems it is not picked up at boot. Maybe because the udhcpc.d daemon doesn't start on boot (because of the static IP address)?

When I start the 90custom script manually then it is successfully executed and the 2nd DNS server is added to /etc/resolv.conf. Also when I start "udhcpc" it is also successfully executed (2nd DNS server is added to /etc/resolv.con).

Re: Static IP on Toon for external control

Posted: Sun Jul 28, 2019 2:55 pm
by TheHogNL
hellwich wrote:I've added the script in the specified location, but it seems it is not picked up at boot. Maybe because the udhcpc.d daemon doesn't start on boot (because of the static IP address)?.
Owh.. damn you are right :-)

Re: Static IP on Toon for external control

Posted: Sun Jul 28, 2019 4:13 pm
by hellwich
Is there maybe any other easy way to start the script at boot? :)