See my second post with "fallback twopi". That should do what you want; it only uses the profile with the static allocations if it can't find a DHCP server.Killertechno wrote: ↑Tue Apr 17, 2018 3:02 pmAbout templates.... (a bit offtopic), is there a way to keep dynamic and static IP at same time?
I need dynamic to be used in dhcp network while active static IP as default for maintenance.
Re: Static IP address templates for dhcpcd.conf
Re: Static IP address templates for dhcpcd.conf
Similar question to killertechno, I need dhcp to do it's usual thing and have static ip address(es) on different subnet(s) all at the same time.
So the Pi Ethernet is permanently controlling machines using the static addresses/subnets but the router/internet can come and go if and when required. In these situations WiFi is not often available.
This used to be easy (before Jessie/Stretch) but now I can't work it out.
So the Pi Ethernet is permanently controlling machines using the static addresses/subnets but the router/internet can come and go if and when required. In these situations WiFi is not often available.
This used to be easy (before Jessie/Stretch) but now I can't work it out.
-
- Posts: 2
- Joined: Sun Jan 27, 2019 1:39 pm
Re: Static IP address templates for dhcpcd.conf
Is there a way/method to assign a fixed IP address according to the name of the WiFi network that the RPi connects to ??
For example, my home domain is 192.168.1.1 (etc..) and I would like the Pi to get IP address 192.168.1.200
But at my daugher's home (she has the same domain) I would like to Pi to get address 192.168.1.60
PS:
I really like the "arping" facility and intend to use it with the Raspberry Pies I use with my students at the IoT Club at school.
For example, my home domain is 192.168.1.1 (etc..) and I would like the Pi to get IP address 192.168.1.200
But at my daugher's home (she has the same domain) I would like to Pi to get address 192.168.1.60
PS:
I really like the "arping" facility and intend to use it with the Raspberry Pies I use with my students at the IoT Club at school.
Re: Static IP address templates for dhcpcd.conf
There's an 'ssid' option in dhcpcd.conf (see https://www.daemon-systems.org/man/dhcpcd.conf.5.html)dynamicdave wrote: ↑Sun Jan 27, 2019 1:50 pmIs there a way/method to assign a fixed IP address according to the name of the WiFi network that the RPi connects to ??
For example, my home domain is 192.168.1.1 (etc..) and I would like the Pi to get IP address 192.168.1.200
But at my daugher's home (she has the same domain) I would like to Pi to get address 192.168.1.60
See e.g. https://www.raspberrypi.org/forums/view ... 1#p1242033 for an example
-
- Posts: 2
- Joined: Sun Jan 27, 2019 1:39 pm
Re: Static IP address templates for dhcpcd.conf
Thanks @DirkS - I think that will sort out my needs.
-
- Posts: 8
- Joined: Tue Jan 06, 2015 4:34 pm
Re: Static IP address templates for dhcpcd.conf
Did anyone work out how to see the search domain in /etc/dhcpcd.conf?
I tried a guess of the following:
but this did not work, all I get is this:
All I want it this local box to have the same resolv.conf as the one it dishes out to my other machines via dhcpd.conf, i.e. I want its resolv.conf to look like this:
Anyone know how to achieve this with dhcpc?
Thanks in advance.
I tried a guess of the following:
Code: Select all
static domain_search=blah.net
but this did not work, all I get is this:
Code: Select all
# Generated by resolvconf
domain blah.net
nameserver 10.0.0.1
nameserver 10.0.0.2
All I want it this local box to have the same resolv.conf as the one it dishes out to my other machines via dhcpd.conf, i.e. I want its resolv.conf to look like this:
Code: Select all
# Generated by resolvconf
domain blah.net
search blah.net other.net
nameserver 10.0.0.1
nameserver 10.0.0.2
Thanks in advance.
-
- Posts: 8
- Joined: Tue Jan 06, 2015 4:34 pm
Re: Static IP address templates for dhcpcd.conf
I cheated and edited /etc/resolvconf and put in this line:
then I ran resolvconf -u twice then resolvconf -v which said:
and then cat /etc/resolv.conf said:
Code: Select all
search_domains="blah.net other.net"
Code: Select all
SEARCH='blah.net other.net'
Code: Select all
# Generated by resolvconf
domain blah.net
search blah.net other.net
nameserver 10.0.0.1
nameserver 10.0.0.2
-
- Posts: 8
- Joined: Tue Jan 06, 2015 4:34 pm
Re: Static IP address templates for dhcpcd.conf
Actually the following DOES work in /etc/dhcpcd.conf (I stupidly used a comma to separate them at first and it doesn't like that)
Code: Select all
static domain_search=blah.net foobar.net