Linux setting network from static to dhcp client

if you want to setting eth0 to dhcp client , you can use this command:
sudo dhclient eth0

if you get the message: File exists, or something like that..

Basically what happens is that dhclient adds a route to the routing table.
It tries this while the route is already in the table.
Check
ip route
for a route which was added by the dhcp server.
For having the lease renewed do
sudo dhclient -r
if thats not enough you can remove all leases by removing the file and getting a new lease
sudo rm /var/lib/dhcp/dhclient.leases; sudo dhclient eth0
Depending on your exact setup this might be an issue with having to type your password twice, so watch out for that.

留言

這個網誌中的熱門文章

《Microsoft Word 應用》:圖片被文字蓋住解決方法,不可設定為固定行高

【多益】現點現做的英文怎麼說呢?

美國西部灌溉農業區現怪圈,其實是高度發達的現代農業