15
2
I have a Linux server (Rasperry Pi using Raspbian as OS) that should be using only static IP.
However I noticed that it also has got IP from DHCP server (The IP given out by DHCP is 192.168.111.2
). According to network settings the server should be only using static IP (192.168.111.100
).
The contents of /etc/network/interfaces
:
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet static
address 192.168.111.100
netmask 255.255.255.0
gateway 192.168.111.1
dns-nameservers ip1 ip2
Despite using static configuration I can SSH to the device also using the IP given by DHCP. Also it appears that ntpd
is using the wrong IP as well as the correct one.
Output of Netstat:
udp 0 0 192.168.111.2:123 0.0.0.0:* 2774/ntpd
udp 0 0 192.168.111.100:123 0.0.0.0:* 2774/ntpd
According to ifconfig
the IP 192.168.111.2
is not used:
eth0 Link encap:Ethernet HWaddr b8:27:eb:be:18:1c
inet addr:192.168.111.100 Bcast:192.168.111.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:138099 errors:0 dropped:0 overruns:0 frame:0
TX packets:81146 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:95954711 (91.5 MiB) TX bytes:27076870 (25.8 MiB)
ps -ef | grep dhcp
shows that I have a DHCP daemon running:
root 2000 1 0 Oct07 ? 00:00:06 /sbin/dhcpcd
How do I disable the DHCP
daemon from starting and make sure that my server uses only the static?
What is the command you are referring to? – Madoc Comadrin – 2015-10-12T05:25:28.433
I tried those commands but was not able to find anything to help me in this. – Madoc Comadrin – 2015-10-12T16:06:22.207
@barlop There is nothing wrong with
ifconfig
and it is used regularly. It will one day be replaced byip
but honestly, it’s of no consequence to badger someone about which is “better” since this is not a pissing contest.ifconfig
provides more than enough details for debugging things like this. – JakeGould – 2015-10-12T17:12:10.653