I've got a Raspberry Pi. I would like to have it running with a Pidora, and run something cool on it. I'm taking some notes in the process.
DHCP on my machine
For starters, let's have it running. I could attach it to the ADSL router, but where's the fun in this? So I learned a number of things. My local machine is going to act as DHCP server on the Ethernet NIC, where I'll attach the Raspberry.
Setup of the local machine:
port=0for disabling DNS and keeping DHCP;
interface=eno1since I just want to run it on the Ethernet interface;
dhcp-range=192.168.128.2,192.168.128.20declares my DHCP range.
dhcp-option=6,192.168.1.1will ask DHCP clients to use 192.168.1.1 (the ADSL router) as DNS.
The Ethernet connection must be static
- Option 0: Disable network manager and control manually
- Option 1: Control using network manager (
nmcli), so we can keep configuration. Going for this one.
My Ethernet configuration
After editing with
nmcli a new connection named
obtained the following network script:
$ cat /etc/sysconfig/network-scripts/ifcfg-dhcp_serve
Some comments and gotchas:
I had to manually set
BOOTPROTO=nonein order to disable the DHCP server to run automatically on this connection. This is because we are offering DHCP, but I noticed that TCP was reporting my machine's attempts to do it.
If you want your DNSMasq to actually work, it's a put that
/24on your network. Here the
PREFIXwas added by the
nmclieditor when I specified
192.168.128.1/24as address. By default it goes with
The firewall will be in the way. I'm doing this on a Fedora, where the configuration is not linear IMHO.
iptables -Lgives me kind of a maze. I'm not (yet) expert with IP Tables, thus I need to go for
dhcpport must be enabled in the firewall configuration. This is going to affect the
internalZone as consequence of the previous point.
The Zone of the Ethernet connection is going to be
internal. This was set with the mentioned
firewall-configtool, and got reflected on this network script. The fact is: we want to enable the DNS Masquerade (NAT) later on!
Of course, enable IP forwarding:
echo 1 > /proc/sys/net/ipv4/ip_forward
Apparently it works, but how do I prevent NM to automatically reset everything if (say) the Raspberry goes down or I detach the Ethernet cable? TODO think of this.
Fresh login in Pidora
After the DHCP is set, it's simply a matter of ssh to the correct IP address. Something you get from the logs.
The default password is just
raspberrypi, as mentioned in the
Fix the SD Card
The default installation will just use 2 of the N available gigabytes. In my case I've got 4 Gigabytes. The graphic installation application however shows a resize root filesystem option.
There must be a program for this.
$ rpm -qa | grep resize
Yup. Sounds like we found it. How does it work?
$ rpm -ql rootfs-resize
It's fairly easy: the
rootfs-resize program is a python script. It
requires certain files in place as parametrization. Everything is clearly
described in the script in form of comments.
Just run and claim all your space.