Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #199337

Re: DHCP to static without reboot?

From bw <bwtnguy@yahoo.com>
Newsgroups linux.debian.user
Subject Re: DHCP to static without reboot?
Date 2018-08-25 02:30 +0200
Message-ID <wquCK-79e-3@gated-at.bofh.it> (permalink)
References <wqtdD-6ds-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


[Multipart message — attachments visible in raw view] - view raw

On Sat, 25 Aug 2018, Mark Pavlichuk wrote:

> I can't seem to change the configuration of a nic from DHCP to static in
> Stretch (without rebooting) - I do this a lot so I don't want to have to
> reboot every time.  I'm using the old "killall dhclient;ifdown eth0;ifup eth0"
> method which also still seems to be in the documentation... at least on the
> debian.org site.  I've also tried doing various combinations of "service
> stop/start/restart networking" along with ifup/ifdown commands to no avail. 
> Is there some special new magic?
> 
> -- 
> Mark Pavlichuk
> 
> 

I don't know what "killall dhclient;ifdown eth0;ifup eth0" method is but I 
never found that necessary.  You should be able to bring the iface down, 
then edit interfaces file, then bring it up with the new config.  I don't 
think restarting networking service is what you want, it does not do the 
same thing as the old /etc/init.d/networking restart command did.

Alternately I have used separate iface names for each config and used 
something like ifup wlan0=cfg_static ifup wlan0=cfg_dhcp 
depending on which I wanted.


iface cfg_static inet dhcp
     address 192.168.1.109
iface cfg_dhcp inet dhcp

good luck

Back to linux.debian.user | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

DHCP to static without reboot? Mark Pavlichuk <pav5088@internode.on.net> - 2018-08-25 01:00 +0200
  Re: DHCP to static without reboot? bw <bwtnguy@yahoo.com> - 2018-08-25 02:30 +0200
    Re: Re: DHCP to static without reboot? Mark Pavlichuk <pav5088@internode.on.net> - 2018-08-25 05:40 +0200
      Re: DHCP to static without reboot? Gene Heskett <gheskett@shentel.net> - 2018-08-25 10:00 +0200
        Re: DHCP to static without reboot? <tomas@tuxteam.de> - 2018-08-25 10:30 +0200
          Re: DHCP to static without reboot? Gene Heskett <gheskett@shentel.net> - 2018-08-25 10:50 +0200
          Re: DHCP to static without reboot? Gene Heskett <gheskett@shentel.net> - 2018-08-25 12:10 +0200
          Re: DHCP to static without reboot? Gene Heskett <gheskett@shentel.net> - 2018-08-25 12:10 +0200
      Re: Re: DHCP to static without reboot? bw <bwtnguy@yahoo.com> - 2018-08-25 14:30 +0200
        Re: Re: Re: DHCP to static without reboot? Mark Pavlichuk <pav5088@internode.on.net> - 2018-08-26 06:10 +0200
          Re: Re: Re: DHCP to static without reboot? bw <bwtnguy@yahoo.com> - 2018-08-26 15:20 +0200

csiph-web