Hi,
after setting Pi-hole up and also activating the DHCP service, I've noticed that I should assign my RaspberryPi a static IP-Address as I wasn't able to connect to it using SSH without the DHCP service running. To resolve this issue I've added these few lines at the end of my /etc/dhcpcd.conf
:
# static ip setup
interface eth0
static ip_address=192.168.2.2/24
static routers=192.168.2.1
static domain_name_servers=192.168.2.2
Now I tried to setup port sharing on my Fritz!Box to be able to connect to some services from outside my home network. After some failing attempts I've noticed that all my devices, except that RaspberryPi running Pi-hole, have a IPv4 address (over DS-Lite) and multiple IPv6 addresses.
What ip addr
returns to me on my PC running Manjaro Linux:
enp0s31f6: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
link/ether x:x:x:x:x:x brd ff:ff:ff:ff:ff:ff
inet 192.168.2.20/24 brd 192.168.2.255 scope global dynamic noprefixroute enp0s31f6
valid_lft 595667sec preferred_lft 595667sec
inet6 2a02:x:x:x:x:x:x:x/64 scope global dynamic noprefixroute
valid_lft 6958sec preferred_lft 3358sec
inet6 fe80::x:x:x:x/64 scope link noprefixroute
valid_lft forever preferred_lft forever
If I understand it right, one address is calculated based on my MAC address, lasts forever and is used for connections coming in and the other address is random, lasts only for a limited time and is used for outgoing connections and thus displayed when using curl https://wtfismyip.com/text
.
Does static really mean that I don't even need a DDNS service to access this PC from somewhere else?
On my RaspberryPi running RaspberryPi OS 64bit ifconfig -a
returns:
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.2.2 netmask 255.255.255.0 broadcast 192.168.2.255
inet6 fe80::x:x:x:x prefixlen 64 scopeid 0x20<link>
ether x:x:x:x:x:x txqueuelen 1000 (Ethernet)
RX packets 2083113 bytes 1038306946 (990.2 MiB)
RX errors 0 dropped 531322 overruns 0 frame 0
TX packets 864623 bytes 216914725 (206.8 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
It seams like my RaspberryPi also has an IPv6 address but when using curl https://wtfismyip.com/text
I only get an IPv4 address. Is this probably the static address for incoming connections?
In the end I would like my RaspberryPi to also have one random address to stay kind of anonym and one static address to access it from elsewhere. Is something wrong with my Pi-hole setup or do I have to change something in my /etc/dhcpcd.conf
?
Thanks in advance, I really appreciate all your work.
Leon
Debug Token:
https://tricorder.pi-hole.net/6e1rekjs5q