hello
I have changed the config of my machine from dhcp to static but it keeps sending DHCP requests over the network. What are my options to stop the DHCP requests ?
Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230
stop dhcp requests
- Head_on_a_Stick
- Posts: 14114
- Joined: 2014-06-01 17:46
- Location: London, England
- Has thanked: 81 times
- Been thanked: 133 times
Re: stop dhcp requests
How did you do that? Please post the exact command(s) and/or configuration file(s).ychaouche wrote:I have changed the config of my machine from dhcp to static
How do you know that? Please post the exact command(s) and/or tool(s).ychaouche wrote:it keeps sending DHCP requests over the network
We should probably also check your enabled services:
Code: Select all
ls -lR /etc/systemd/system
deadbang
Re: stop dhcp requests
You asked for it
I issued a few ip commands until I found out the problem wasn't on the host but on the VM network config...
The DHCP requests are in the syslog :
Code: Select all
ip a
ip a ens192
ip a -d ens192
ip -d ens192 a
man ip
ls
dpkg -s isc-dhcp-client
echo $PATH | tr ":" "\n"
whoami
echo $PATH | tr ":" "\n"
ip a
dhclient ens192
dhclient -v ens192
ip addr add 10.10.10.84 dev ens192
ip a dev ens192
ip addr show
ip addr show 2
ip addr show ens192
ip addr del 172.16.10.183 dev ens192
ip addr show ens192
ip addr del 10.10.10.84/32 dev ens192
ip addr show ens192
ip addr add 10.10.10.84/24 dev ens192
ip addr show ens192
ip route add default via 10.10.10.10/24
ip route show
ping 10.10.10.19
ping 10.10.10.10
ifdown ens192
ifup ens192
ip addr show ens192
ip addr add 10.10.10.84/24 dev ens192
ip route show
ip route show
roue
route
route
ip route show
y
ip route show
ip route del 10.10.10.10
ip route show
ip route delete 10.10.10.10/24
ip route delete 10.10.10.0/24 via 10.10.10.10
ip route delete 10.10.10.0/24 via 10.10.10.10 dev ens192
ip route show
ip route delete 10.10.10.0/24 dev ens192
ip route show
ip route add default via 10.10.10.10 dev ens192
ip route add default via 10.10.10.10
ip route add default via 10.10.10.10ip route show
ip route add default via 10.10.10.10
ip route
ip route
reboot
cp --parents
cp --parent
cp --pare
cp --parents .ssh/authorized_keys .
cp --parents .ssh/authorized_keys ~/
cat ~/.ssh/authorized_keys
ip addr show ens192
ip addr add 10.10.10.84/24 dev ens192
ip route
ip addr show dev ens192
ip route add default via 10.10.10.10
ip route
ping 10.10.10.10
ping 10.10.10.19
ping 10.10.10.21
ip addr show dev ens192
ping 10.10.10.84
ping 10.10.10.10
route
ip route show
ip route add default via
ip route show
ping 10.10.10.10
ping 10.10.10.19
nmap
ping 10.10.10.19
ping 10.10.10.19
ip addr show
The DHCP requests are in the syslog :
I changed /etc/network/interfaces from dhcp to static but did not restart any networking service or called ifup/ifdown scripts. I just wanted to know if there was a way to granularly stop DHCP requests w/o restarting the whole networking service.Mar 23 11:15:44 cloud dhclient[446]: DHCPDISCOVER on ens192 to 255.255.255.255 port 67 interval 4
Mar 23 11:15:48 cloud dhclient[446]: DHCPDISCOVER on ens192 to 255.255.255.255 port 67 interval 5
Mar 23 11:15:53 cloud dhclient[446]: DHCPDISCOVER on ens192 to 255.255.255.255 port 67 interval 13
Mar 23 11:16:06 cloud dhclient[446]: DHCPDISCOVER on ens192 to 255.255.255.255 port 67 interval 13
Mar 23 11:16:19 cloud dhclient[446]: DHCPDISCOVER on ens192 to 255.255.255.255 port 67 interval 19
Mar 23 11:16:38 cloud dhclient[446]: DHCPDISCOVER on ens192 to 255.255.255.255 port 67 interval 7
Mar 23 11:16:45 cloud dhclient[446]: No DHCPOFFERS received.
Mar 23 11:16:45 cloud dhclient[446]: No working leases in persistent database - sleeping.
Code: Select all
root#cloud 11:22:02 ~ # cat /etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
source /etc/network/interfaces.d/*
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
allow-hotplug ens192
iface ens192 inet static
address 10.10.10.84/24
gateway 10.10.10.10
root#cloud 11:22:03 ~ #
- Head_on_a_Stick
- Posts: 14114
- Joined: 2014-06-01 17:46
- Location: London, England
- Has thanked: 81 times
- Been thanked: 133 times
Re: stop dhcp requests
ychaouche wrote:I just wanted to know if there was a way to granularly stop DHCP requests w/o restarting the whole networking service.
Code: Select all
# pkill dhclient
deadbang
Re: stop dhcp requests
that's just perfect ! thanks a ton I usually think of programs like these to be daemons, never thought dhclient was a kind of daemon (or is it ?)
-
- Global Moderator
- Posts: 3049
- Joined: 2017-09-17 07:12
- Has thanked: 5 times
- Been thanked: 132 times
Re: stop dhcp requests
Do not restart the whole networking service. It does not work the way you think and does not do what you want.ychaouche wrote:I changed /etc/network/interfaces from dhcp to static but did not restart any networking service or called ifup/ifdown scripts. I just wanted to know if there was a way to granularly stop DHCP requests w/o restarting the whole networking service.
The networking service has no configuration memory. All it knows about a given interface is whether it started it (status).
If you want to change the configuration for an interface,
1) Stop the interface with ifdown <interface>
2) Edit /etc/network/interfaces
3) Start the interface with ifup <interface>
If you do not stop the interface before changing it from dhcp to static, the networking service does not know it was using dhcp and does not stop the DHCP client.
It is.ychaouche wrote:never thought dhclient was a kind of daemon (or is it ?)