I am trying to manage my container host interface(one of the interface) from docker container. I am able to change ip address and assign static ip to interface but it looks like when i am flushing ip address in case of dhcp, I need to renew the lease using dhclient eth1
which doesn't run inside container because there s no such package installed container. What would be best approach so I can renew lease ?
I am running container using docker run --net=host --cap-add=NET_ADMIN -v /etc/network/:/mnt/network -p 8080 -d ubuntu_network
command where ubuntu_network
is my custom application. Any help would be appreciated.
I couldn't find any relevant document for this.
I should be able to renew lease from container to container host interfaces.
This is a bit late, but running udhcpc
inside Alpine Linux seemed to work for me to get a new DHCP address.
Within Alpine Linux, if the system is configured to obtain network configurations via DHCP, a DHCP refresh can be triggered with the following command:
/etc/init.d/networking restart
via https://wiki.alpinelinux.org/wiki/Configure_Networking#Activating_Changes_and_Testing_Connectivity
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With