Re: [Dorset] DHCPCD.conf configuration for static addresses in a Raspberry Pi

2018-10-13 Thread PeterMerchant via dorset

On 13/10/18 17:07, Terry Coles wrote:

Forward to the list this time instead of to Peter!  Doh!

BTW, in the example that I posted below you also have to change the IP
Addresses to suit your setup of course.

On Saturday, 13 October 2018 16:49:09 BST Terry Coles wrote:

On Saturday, 13 October 2018 16:33:03 BST PeterMerchant via dorset wrote:

This appears to be the most recent posting that I could find:

https://lb.raspberrypi.org/forums/viewtopic.php?t=205276

  ^
...


2. This is the second time that I have seen that the interface name is
redefined into something containing the MAC address rather than eth0 etc
that we are used to.

3 I have re-read this one and it looks like in the last section I can
disable DHCP and revert to the mode of operation that I am used to. It's
two years old though.
https://raspberrypi.stackexchange.com/questions/37920/how-do-i-set-up-netw
or king-wifi-static-ip-address

I'll give it a whirl, but it does mean that I have to get it working in
order to ssh into it and change the files.

I'm slightly confused.  Why do you want to revert to the old way to set a
static IP addressI That way you'll have to do it every time Raspbian is
updated.  The instructions in the link that I highlighted above worked fine
for me.

Here is the code that you need to put into dhcpd.conf:

interface eth0  # Change this to whatever your Ethernet portname
is
static ip_address=192.168.0.103/24
static routers=192.168.0.1
static domain_name_servers=192.168.0.1 1.1.1.1 1.0.0.1

interface wlan0 # Change this to whatever your WiFi portname is
static ip_address=192.168.0.103/24
static routers=192.168.0.1
static domain_name_servers=192.168.0.1 1.1.1.1 1.0.0.1

and this is what I have:
# Example static IP configuration:
interface eth0
static ip_address=192.168.1.9/27
static routers=192.168.1.1
static domain_name_servers=192.168.1.1 8.8.8.8

interface wlan0
static address=192.168.1.8/27
static routers=192.168.1.1
static domain_name_servers=192.168.1.1

and when I connect to the Pi [on address 21]
pi@raspberrypi:~ $ ifconfig
eth0: flags=4099  mtu 1500
    ether b8:27:eb:b2:f7:c8  txqueuelen 1000  (Ethernet)
    RX packets 0  bytes 0 (0.0 B)
    RX errors 0  dropped 0  overruns 0  frame 0
    TX packets 0  bytes 0 (0.0 B)
    TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73  mtu 65536
    inet 127.0.0.1  netmask 255.0.0.0
    inet6 ::1  prefixlen 128  scopeid 0x10
    loop  txqueuelen 1000  (Local Loopback)
    RX packets 0  bytes 0 (0.0 B)
    RX errors 0  dropped 0  overruns 0  frame 0
    TX packets 0  bytes 0 (0.0 B)
    TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

wlan0: flags=4163  mtu 1500
    inet 192.168.1.21  netmask 255.255.255.224  broadcast 192.168.1.31
    inet6 fe80::2c9:aeca:54e4:fa59  prefixlen 64  scopeid 0x20
    ether 00:0c:43:00:cc:2d  txqueuelen 1000  (Ethernet)
    RX packets 246  bytes 29738 (29.0 KiB)
    RX errors 0  dropped 0  overruns 0  frame 0
    TX packets 119  bytes 17189 (16.7 KiB)
    TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

So it is not setting my static .8

I'll have another look at your link to see if there is anything else I 
should set:


Meanwhile:
pi@raspberrypi:/etc $ cat dhcpcd.conf
# A sample configuration for dhcpcd.
# See dhcpcd.conf(5) for details.

# Allow users of this group to interact with dhcpcd via the control socket.
#controlgroup wheel

# Inform the DHCP server of our hostname for DDNS.
hostname

# Use the hardware address of the interface for the Client ID.
clientid
# or
# Use the same DUID + IAID as set in DHCPv6 for DHCPv4 ClientID as per 
RFC4361.

# Some non-RFC compliant DHCP servers do not reply with this set.
# In this case, comment out duid and enable clientid above.
#duid

# Persist interface configuration when dhcpcd exits.
persistent

# Rapid commit support.
# Safe to enable by default because it requires the equivalent option set
# on the server to actually work.
option rapid_commit

# A list of options to request from the DHCP server.
option domain_name_servers, domain_name, domain_search, host_name
option classless_static_routes
# Most distributions have NTP support.
option ntp_servers
# Respect the network MTU. This is applied to DHCP routes.
option interface_mtu

# A ServerID is required by RFC2131.
require dhcp_server_identifier

# Generate Stable Private IPv6 Addresses instead of hardware based ones
slaac private

# Example static IP configuration:
interface eth0
static ip_address=192.168.1.9/27
static routers=192.168.1.1
static domain_name_servers=192.168.1.1 8.8.8.8

interface wlan0
static address=192.168.1.8/27
static routers=192.168.1.1
static domain_name_servers=192.168.1.1

# It is possible to fall back to a static IP if DHCP fails:
# define static profile
#profile static_eth0
#static ip_address=192.168.1.23/24
#static routers=192.168.1.1

Re: [Dorset] DHCPCD.conf configuration for static addresses in a Raspberry Pi

2018-10-13 Thread Terry Coles
Forward to the list this time instead of to Peter!  Doh!

BTW, in the example that I posted below you also have to change the IP 
Addresses to suit your setup of course.

On Saturday, 13 October 2018 16:49:09 BST Terry Coles wrote:
> On Saturday, 13 October 2018 16:33:03 BST PeterMerchant via dorset wrote:
> > > This appears to be the most recent posting that I could find:
> > > 
> > > https://lb.raspberrypi.org/forums/viewtopic.php?t=205276
> 
>  ^
> ...
> 
> > 2. This is the second time that I have seen that the interface name is
> > redefined into something containing the MAC address rather than eth0 etc
> > that we are used to.
> > 
> > 3 I have re-read this one and it looks like in the last section I can
> > disable DHCP and revert to the mode of operation that I am used to. It's
> > two years old though.
> > https://raspberrypi.stackexchange.com/questions/37920/how-do-i-set-up-netw
> > or king-wifi-static-ip-address
> > 
> > I'll give it a whirl, but it does mean that I have to get it working in
> > order to ssh into it and change the files.
> 
> I'm slightly confused.  Why do you want to revert to the old way to set a
> static IP addressI That way you'll have to do it every time Raspbian is
> updated.  The instructions in the link that I highlighted above worked fine
> for me.
> 
> Here is the code that you need to put into dhcpd.conf:
> 
> interface eth0# Change this to whatever your Ethernet portname
> is
> static ip_address=192.168.0.103/24
> static routers=192.168.0.1
> static domain_name_servers=192.168.0.1 1.1.1.1 1.0.0.1
> 
> interface wlan0   # Change this to whatever your WiFi portname is
> static ip_address=192.168.0.103/24
> static routers=192.168.0.1
> static domain_name_servers=192.168.0.1 1.1.1.1 1.0.0.1


-- 



Terry Coles



--
Next meeting at *new* venue:  Bournemouth, Tuesday, 2018-11-06 20:00
Check if you're replying to the list or the author
Meetings, mailing list, IRC, ...  http://dorset.lug.org.uk/
New thread, don't hijack:  mailto:dorset@mailman.lug.org.uk

Re: [Dorset] DHCPCD.conf configuration for static addresses in a Raspberry Pi

2018-10-13 Thread PeterMerchant via dorset

On 13/10/18 07:41, Terry Coles wrote:

On Friday, 12 October 2018 21:21:16 BST PeterMerchant via dorset wrote:

Does anyone know anything about how to configure this for a static
address for my Raspberry Pi?

With the latest version of Raspbian [Stretch] They have changed the way
that the network  is configured. In the old system I used to paste in my
two standard files [Interfaces & wpa_supplicant.conf] and away it went.

...


Any  ideas welcome. The R-Pi forums haven't been much use.

Have you seen this one:

https://lb.raspberrypi.org/forums/viewtopic.php?t=192314

The default names for the interfaces changed with Stretch so re-using an old
set of files won't work.

I had to do it fairly recently (definitely with Stretch) and I had to make the
static IP Address declaration in dhcp.conf, if I recall.  I can't remember
what else I changed, but I used the instructions that I found on the Internet.

I note that the Tutorials at 'ModMyPi' are now years out of date and still use
the interfaces file to set the IP Address.

This appears to be the most recent posting that I could find:

https://lb.raspberrypi.org/forums/viewtopic.php?t=205276


1. Most tutorials are now out of date, it seems.

2. This is the second time that I have seen that the interface name is 
redefined into something containing the MAC address rather than eth0 etc 
that we are used to.


3 I have re-read this one and it looks like in the last section I can 
disable DHCP and revert to the mode of operation that I am used to. It's 
two years old though. 
https://raspberrypi.stackexchange.com/questions/37920/how-do-i-set-up-networking-wifi-static-ip-address


I'll give it a whirl, but it does mean that I have to get it working in 
order to ssh into it and change the files.


Till then...

Peter


--
Next meeting at *new* venue:  Bournemouth, Tuesday, 2018-11-06 20:00
Check if you're replying to the list or the author
Meetings, mailing list, IRC, ...  http://dorset.lug.org.uk/
New thread, don't hijack:  mailto:dorset@mailman.lug.org.uk

Re: [Dorset] DHCPCD.conf configuration for static addresses in a Raspberry Pi

2018-10-13 Thread Terry Coles
On Friday, 12 October 2018 21:21:16 BST PeterMerchant via dorset wrote:
> Does anyone know anything about how to configure this for a static
> address for my Raspberry Pi?
> 
> With the latest version of Raspbian [Stretch] They have changed the way
> that the network  is configured. In the old system I used to paste in my
> two standard files [Interfaces & wpa_supplicant.conf] and away it went.

...

> Any  ideas welcome. The R-Pi forums haven't been much use.

Have you seen this one:

https://lb.raspberrypi.org/forums/viewtopic.php?t=192314

The default names for the interfaces changed with Stretch so re-using an old 
set of files won't work.

I had to do it fairly recently (definitely with Stretch) and I had to make the 
static IP Address declaration in dhcp.conf, if I recall.  I can't remember 
what else I changed, but I used the instructions that I found on the Internet.

I note that the Tutorials at 'ModMyPi' are now years out of date and still use 
the interfaces file to set the IP Address.

This appears to be the most recent posting that I could find:

https://lb.raspberrypi.org/forums/viewtopic.php?t=205276

-- 



Terry Coles



--
Next meeting at *new* venue:  Bournemouth, Tuesday, 2018-11-06 20:00
Check if you're replying to the list or the author
Meetings, mailing list, IRC, ...  http://dorset.lug.org.uk/
New thread, don't hijack:  mailto:dorset@mailman.lug.org.uk