Assign Static IP to kiosk
Forum rules
Porteus Kiosk section of the forum is unmaintained now. Its kept in a 'read only' mode for archival purposes.
Please use the kiosk contact page for directing your queries: https://porteus-kiosk.org/contact.html
Porteus Kiosk section of the forum is unmaintained now. Its kept in a 'read only' mode for archival purposes.
Please use the kiosk contact page for directing your queries: https://porteus-kiosk.org/contact.html
-
- Black ninja
- Posts: 51
- Joined: 21 Mar 2014, 14:02
- Distribution: porteus 3.7 kiosk
- Location: Chattanooga
Assign Static IP to kiosk
Could someone point me in the right direction as to what file I need to modify to assign a static IP address as well as a unique hostname to each of my kiosks? Because of all the customizations I have done I don't want to use the Wizard.
I tried creating an rc.inet1.conf file and placing it in the rootcopy/etc/rc.d directory with the following information but it did not work:
# Config information for eth0:
IPADDR[0]="192.168.23.130"
NETMASK[0]="255.255.255.0"
USE_DHCP[0]=""
DHCP_HOSTNAME[0]="Testkiosk"
Thanks in advance
I tried creating an rc.inet1.conf file and placing it in the rootcopy/etc/rc.d directory with the following information but it did not work:
# Config information for eth0:
IPADDR[0]="192.168.23.130"
NETMASK[0]="255.255.255.0"
USE_DHCP[0]=""
DHCP_HOSTNAME[0]="Testkiosk"
Thanks in advance
- fanthom
- Moderator Team
- Posts: 5667
- Joined: 28 Dec 2010, 02:42
- Distribution: Porteus Kiosk
- Location: Poland
- Contact:
Re: Assign Static IP to kiosk
Hi Raul,
kiosk wont understand this config and you must do everything in commands. please add this code to /etc/rc.d/rc.local (make it executable) so it will run as last:
kiosk wont understand this config and you must do everything in commands. please add this code to /etc/rc.d/rc.local (make it executable) so it will run as last:
Code: Select all
#!/bin/sh
killall dhcpcd 2>/dev/null
ifconfig eth0 192.168.23.130 netmask 255.255.255.0
route add default gw gateway_IP eth0 #change gateway_IP to your gateway
hostname Testkiosk
Please add [Solved] to your thread title if the solution was found.
-
- Black ninja
- Posts: 51
- Joined: 21 Mar 2014, 14:02
- Distribution: porteus 3.7 kiosk
- Location: Chattanooga
Re: Assign Static IP to kiosk
Thanks fanthom
As usual excellent instructions. I tested this and the IP address part worked great however the Hostname didn't take as it is still using the default "porteus" hostname.
Do you have any ideas as to why it is not recognizing that hostname?
Thanks
As usual excellent instructions. I tested this and the IP address part worked great however the Hostname didn't take as it is still using the default "porteus" hostname.
Do you have any ideas as to why it is not recognizing that hostname?
Thanks
- fanthom
- Moderator Team
- Posts: 5667
- Joined: 28 Dec 2010, 02:42
- Distribution: Porteus Kiosk
- Location: Poland
- Contact:
Re: Assign Static IP to kiosk
it works for me:
i have logged through ssh, ran 'hostname test' command and hostname changed from 'porteus' to 'test' immediately.
please make sure you have 'hostname some_name' and not 'Hostname some_name' in your rc.local.
i have logged through ssh, ran 'hostname test' command and hostname changed from 'porteus' to 'test' immediately.
please make sure you have 'hostname some_name' and not 'Hostname some_name' in your rc.local.
Please add [Solved] to your thread title if the solution was found.
-
- Black ninja
- Posts: 51
- Joined: 21 Mar 2014, 14:02
- Distribution: porteus 3.7 kiosk
- Location: Chattanooga
Re: Assign Static IP to kiosk
ok so I am a little confused.... I created a custom ISO using the wizard and installed in on a machine. I tried looking at the rc.local file to see how it was using the hostname provided during the wizard but there is no rc.local.
Would it use different files when using the Wizard?
I also tried creating an ISO from the Wizard and then modifying it with my NTP customization and local HTML files but when I mount the ISO I don't see the porteus directory I was expecting. I do see boot, docs, make_iso.sh, xzm. On version 3.0 I would see boot and porteus when mounting the ISO so work with it.
Is version 3.1 somehow different from 3.0 as far as what the ISO contains?
Sorry if this is a stupid question, I just didn't expect to see this when mounting the ISO
Thanks
Would it use different files when using the Wizard?
I also tried creating an ISO from the Wizard and then modifying it with my NTP customization and local HTML files but when I mount the ISO I don't see the porteus directory I was expecting. I do see boot, docs, make_iso.sh, xzm. On version 3.0 I would see boot and porteus when mounting the ISO so work with it.
Is version 3.1 somehow different from 3.0 as far as what the ISO contains?
Sorry if this is a stupid question, I just didn't expect to see this when mounting the ISO
Thanks
-
- Black ninja
- Posts: 51
- Joined: 21 Mar 2014, 14:02
- Distribution: porteus 3.7 kiosk
- Location: Chattanooga
Re: Assign Static IP to kiosk
Fanthom I just saw your last post... I'll install that image once again and double check... I have been trying different versions to see if I could figure it out.
I'll post again as soon as I've tested.
Thanks
I'll post again as soon as I've tested.
Thanks
- fanthom
- Moderator Team
- Posts: 5667
- Joined: 28 Dec 2010, 02:42
- Distribution: Porteus Kiosk
- Location: Poland
- Contact:
Re: Assign Static IP to kiosk
you have to create one. i'll add a blank rc.local to next release so people will know where to put their custom commands.I tried looking at the rc.local file to see how it was using the hostname provided during the wizard but there is no rc.local.
thanks
yes - kiosk 3.1 is a major upgrade over 3.0 and you should have a look on the changelog i posted:Is version 3.1 somehow different from 3.0 as far as what the ISO contains?
http://porteus-kiosk.org/changelog-releases.html
please mind especially this part:
(no more /rootcopy).- Kiosk ISO content was simplified with three folders only: /boot, /docs and /xzm.
- PXE boot does not support /rootcopy functionality so this folder was removed. From now on all files must be kept in the xzm modules.
Please add [Solved] to your thread title if the solution was found.
-
- Black ninja
- Posts: 51
- Joined: 21 Mar 2014, 14:02
- Distribution: porteus 3.7 kiosk
- Location: Chattanooga
Re: Assign Static IP to kiosk
Thanks for the reply.... Sorry I admit I hadn't read what the changes were and I guess I should've started there.
I guess I'll read over the documentation when I get a chance to familiarize myself with all the changes.
Thanks Again
This explains a lot... I kept thinking I had done something wrong with my ISOrh102801 wrote:- Kiosk ISO content was simplified with three folders only: /boot, /docs and /xzm.- PXE boot does not support /rootcopy functionality so this folder was removed. From now on all files must be kept in the xzm modules.
I guess I'll read over the documentation when I get a chance to familiarize myself with all the changes.
Thanks Again
-
- Black ninja
- Posts: 51
- Joined: 21 Mar 2014, 14:02
- Distribution: porteus 3.7 kiosk
- Location: Chattanooga
Re: Assign Static IP to kiosk
I am not sure if we are on the same page.... I can run hostname TestKiosk on my system from ssh as well and it will change the name right away but I was expecting the name to be what I have on rc.local. See below for my system's config:fanthom wrote:it works for me:
i have logged through ssh, ran 'hostname test' command and hostname changed from 'porteus' to 'test' immediately.
please make sure you have 'hostname some_name' and not 'Hostname some_name' in your rc.local.
root@porteus:~# cat /etc/rc/d/rc.local
#!/bin/sh
ifconfig lo up
ntpdate pool.ntp.org
sh /etc/rc.d/rc.ntpd start
killall dhcpd 2>/dev/null
ifconfig eth0 192.168.23.130 netmask 255.255.255.0
route add default gw 192.168.23.1 eth0
hostname TestKiosk
I expected the system to show root@TestKiosk based on the entries above. If I manually change the hosname like you described earlier:
root@porteus:~# hostname TestKiosk
root@TestKiosk:~#
This is expected behaviour however this is a manual change from SSH and is not persistant as rebooting the machine will bring it back to root@porteus:~#
Does this make sense? I am not sure if I am conyeing my thoughts in the right way. My thought is that by entering the line hostname TestKiosk in the rc.local, the system would take that name on bootup however it is coming up as porteus:
root@porteus:~# hostname
porteus
Changing it manually from an ssh session won't be a persistent change and the system will default back to porteus on reboot.
I hope this makes sense
Thanks
- fanthom
- Moderator Team
- Posts: 5667
- Joined: 28 Dec 2010, 02:42
- Distribution: Porteus Kiosk
- Location: Poland
- Contact:
Re: Assign Static IP to kiosk
yes - it makes sense
i wanted to check if changing hostname is working ok when done manually. you have a correct command in rc.local but a mistake in 'killing dhcpcd' line.
please use this:
also - please login through ssh and run 'ps' to make sure that dhcpcd is really killed.
i wanted to check if changing hostname is working ok when done manually. you have a correct command in rc.local but a mistake in 'killing dhcpcd' line.
please use this:
Code: Select all
killall dhcpcd 2>/dev/null
Please add [Solved] to your thread title if the solution was found.
-
- Black ninja
- Posts: 51
- Joined: 21 Mar 2014, 14:02
- Distribution: porteus 3.7 kiosk
- Location: Chattanooga
Re: Assign Static IP to kiosk
duh... Me and my typing skills
I have tried correcting the line and recreated the ISO but now the system is not booting..... I will try creating the ISO again and will let you know how it goes.
Thanks again for all your help
I have tried correcting the line and recreated the ISO but now the system is not booting..... I will try creating the ISO again and will let you know how it goes.
Thanks again for all your help
-
- Black ninja
- Posts: 51
- Joined: 21 Mar 2014, 14:02
- Distribution: porteus 3.7 kiosk
- Location: Chattanooga
Re: Assign Static IP to kiosk
Ok, so I finally got around to working on this again. I corrected my typo and created a new ISO, installed it and when I boot the system, my homepage tells me cannot connect to the server. I figured out this is due to the fact that we killed dhcpcd and I have not defined a DNS server anywhere so I can't resolve webpages by name, they work if I use IP address. Would I define a DNS server on rc.local as well?
The other thing is even after correcting the typo on my rc.local entries, the hostname I defined is still not being used. Do you have any other ideas on this?
root@porteus:~# cat /etc/rc.d/rc.local
#!/bin/sh
ifconfig lo up
ntpdate pool.ntp.org
sh /etc/rc.d/rc.ntpd start
killall dhcpcd 2>/dev/null
ifconfig eth0 192.168.23.130 netmask 255.255.255.0
route add default gw 192.168.23.1 eth0
hostname TestKiosk
I think I might dedicate my weekend on trying to figure out how to port my ntp customizations to the new 3.1 kiosk (I am going to miss rootcopy) since I can use the wizard to create an image for any of the devices I have and would get rid of this problem easily although I still don't understand why it is not using the hostname at all.
Thanks
The other thing is even after correcting the typo on my rc.local entries, the hostname I defined is still not being used. Do you have any other ideas on this?
root@porteus:~# cat /etc/rc.d/rc.local
#!/bin/sh
ifconfig lo up
ntpdate pool.ntp.org
sh /etc/rc.d/rc.ntpd start
killall dhcpcd 2>/dev/null
ifconfig eth0 192.168.23.130 netmask 255.255.255.0
route add default gw 192.168.23.1 eth0
hostname TestKiosk
I think I might dedicate my weekend on trying to figure out how to port my ntp customizations to the new 3.1 kiosk (I am going to miss rootcopy) since I can use the wizard to create an image for any of the devices I have and would get rid of this problem easily although I still don't understand why it is not using the hostname at all.
Thanks
- fanthom
- Moderator Team
- Posts: 5667
- Joined: 28 Dec 2010, 02:42
- Distribution: Porteus Kiosk
- Location: Poland
- Contact:
Re: Assign Static IP to kiosk
yes - please add this code at the begining of rc.local:Would I define a DNS server on rc.local as well?
Code: Select all
echo 'nameserver 8.8.4.4' > /etc/resolv.conf
i think it's still dhcpcd playing role so we could add some sleep before running 'hostname xxx' but it will be better to not start dhcpcd at all. please edit /etc/rc.d/rc.M and comment out these lines:even after correcting the typo on my rc.local entries, the hostname I defined is still not being used. Do you have any other ideas on this?
Code: Select all
# Initialize the networking hardware:
for x in `ls /sys/class/net | egrep -v 'sip|lo'`; do
dhcpcd -L -t 0 $x >/dev/null 2>&1 &
done
it must work now
Please add [Solved] to your thread title if the solution was found.
-
- Black ninja
- Posts: 51
- Joined: 21 Mar 2014, 14:02
- Distribution: porteus 3.7 kiosk
- Location: Chattanooga
Re: Assign Static IP to kiosk
Thanks for the instructions. I looked at the rc.M file on my test system and this is what it has for the line you mentioned:
# Initialize the networking hardware:
[ -x /etc/rc.d/rc.inet1 ] && . /etc/rc.d/rc.inet1
Also I found this line:
# Set hostname:
hostname porteus
Could the hostname not be changed in this file instead?
Thanks
# Initialize the networking hardware:
[ -x /etc/rc.d/rc.inet1 ] && . /etc/rc.d/rc.inet1
Also I found this line:
# Set hostname:
hostname porteus
Could the hostname not be changed in this file instead?
Thanks
- fanthom
- Moderator Team
- Posts: 5667
- Joined: 28 Dec 2010, 02:42
- Distribution: Porteus Kiosk
- Location: Poland
- Contact:
Re: Assign Static IP to kiosk
probably it could. please do it and check (feel free to experiment with kiosk a bit).Could the hostname not be changed in this file instead?
Please add [Solved] to your thread title if the solution was found.