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


Groups > linux.debian.user > #199333 > unrolled thread

DHCP to static without reboot?

Started byMark Pavlichuk <pav5088@internode.on.net>
First post2018-08-25 01:00 +0200
Last post2018-08-26 15:20 +0200
Articles 11 — 4 participants

Back to article view | Back to linux.debian.user


Contents

  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

#199333 — DHCP to static without reboot?

FromMark Pavlichuk <pav5088@internode.on.net>
Date2018-08-25 01:00 +0200
SubjectDHCP to static without reboot?
Message-ID<wqtdD-6ds-1@gated-at.bofh.it>
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

[toc] | [next] | [standalone]


#199337

Frombw <bwtnguy@yahoo.com>
Date2018-08-25 02:30 +0200
Message-ID<wquCK-79e-3@gated-at.bofh.it>
In reply to#199333

[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

[toc] | [prev] | [next] | [standalone]


#199343

FromMark Pavlichuk <pav5088@internode.on.net>
Date2018-08-25 05:40 +0200
Message-ID<wqxAB-sU-1@gated-at.bofh.it>
In reply to#199337
ifdown doesn't seem to work.  It seems to complete successfully with 
messages about a released DHCP address, but ifconfig shows the interface 
is still up, a ping will be returned etc...  Though if I try another 
ifdown it will say the interface is not configured.

If I then make configuration changes, then ifup, ifconfig will show no 
change.

-- 
Mark Pavlichuk

[toc] | [prev] | [next] | [standalone]


#199348

FromGene Heskett <gheskett@shentel.net>
Date2018-08-25 10:00 +0200
Message-ID<wqBEd-2Kp-3@gated-at.bofh.it>
In reply to#199343
On Friday 24 August 2018 23:33:49 Mark Pavlichuk wrote:

> ifdown doesn't seem to work.  It seems to complete successfully with
> messages about a released DHCP address, but ifconfig shows the
> interface is still up, a ping will be returned etc...  Though if I try
> another ifdown it will say the interface is not configured.
>
> If I then make configuration changes, then ifup, ifconfig will show no
> change.

I've experienced that on a armbian install on a rock64, it takes 
sometimes 2 or 3 powerdown recycles to make a change in e-n-i.d/name of 
interface to stick. And it doesn't work at all if you try to set a 
separate netmask, you must use address xx.xx.xx.xx/24 style.

So this is not an amd64 problem only.  Thats an arm64.


-- 
Cheers, Gene Heskett
--
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
Genes Web page <http://geneslinuxbox.net:6309/gene>

[toc] | [prev] | [next] | [standalone]


#199350

From<tomas@tuxteam.de>
Date2018-08-25 10:30 +0200
Message-ID<wqC7g-390-5@gated-at.bofh.it>
In reply to#199348

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

On Sat, Aug 25, 2018 at 03:54:32AM -0400, Gene Heskett wrote:

[...]

> I've experienced that on a armbian install on a rock64, it takes 
> sometimes 2 or 3 powerdown recycles to make a change in e-n-i.d/name of 
> interface to stick [...]

That sounds a bit like Voodoo. But then, there's Clarke's Third Law.

Cheers
-- tomás

[toc] | [prev] | [next] | [standalone]


#199351

FromGene Heskett <gheskett@shentel.net>
Date2018-08-25 10:50 +0200
Message-ID<wqCqC-3f1-5@gated-at.bofh.it>
In reply to#199350
On Saturday 25 August 2018 04:20:51 tomas@tuxteam.de wrote:

> On Sat, Aug 25, 2018 at 03:54:32AM -0400, Gene Heskett wrote:
>
> [...]
>
> > I've experienced that on a armbian install on a rock64, it takes
> > sometimes 2 or 3 powerdown recycles to make a change in e-n-i.d/name
> > of interface to stick [...]
>
> That sounds a bit like Voodoo. But then, there's Clarke's Third Law.
>
I must admit that Arthers 3rd escapes me ATM. Oldtimers effects more than 
likely as I've read everything he ever wrote.  But I'm sure Murphy has a 
corollary.

> Cheers
> -- tomás



-- 
Cheers, Gene Heskett
--
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
Genes Web page <http://geneslinuxbox.net:6309/gene>

[toc] | [prev] | [next] | [standalone]


#199353

FromGene Heskett <gheskett@shentel.net>
Date2018-08-25 12:10 +0200
Message-ID<wqDG1-49Y-1@gated-at.bofh.it>
In reply to#199350
On Saturday 25 August 2018 06:02:20 Gene Heskett wrote:

> On Saturday 25 August 2018 04:20:51 tomas@tuxteam.de wrote:
> > On Sat, Aug 25, 2018 at 03:54:32AM -0400, Gene Heskett wrote:
> >
> > [...]
> >
> > > I've experienced that on a armbian install on a rock64, it takes
> > > sometimes 2 or 3 powerdown recycles to make a change in
> > > e-n-i.d/name of interface to stick [...]
> >
> > That sounds a bit like Voodoo. But then, there's Clarke's Third Law.
>
> I looked it up, yes. But the wiki page, a ways down, says:
>
> "seeing and hearing Linotype machines which slowly converted ‘molten
> lead into front pages that required two men to lift them.’  I had to
> chuckle about that because it brought up a memory from my childhood,
1947, damn these ancient fingers.
> 1047 or so. Those old frames were 4" bigger than todays papers, 2
> pages wide, and probably weighed well over 250 lbs loaded and ready
> for the press.
>
> When I was in my early teens, and helping out in the darkroom at our
> local weekly paper, it only took one man to pick up that frame of
> Linotype, carry it out thru the back door to a shed over his press and
> place it on the bed of that press.
>
> his name was John Hines, stood about 6'5" and around 275 lbs, owned
> the paper & job shop and only wore white shirts to work and never once
> did he get any ink in them.
>
> One of the local brickyards supervisor guys was famous for a foul
> mouth, and John and his missus was in a benefit bridge game during an
> Old Settlers Re-union, & this guy came to a position behind Johns
> wife, with every third word being a foul word. John told him to watch
> his mouth, he replied "and what the F--k are you going to do about it?
>
> Johns butt never cleared the folding chair he was sitting on as he
> reached over his wife's head across the table and open handedly
> slapped him cold on the floor. The whole fire hall gave him a hand
> when he stood up, picked him up and laid him gently on a park bench
> just outside the front doors.  End of problem.
>
> Thanks for the trip down memory lane.
>
> > Cheers
> > -- tomás



-- 
Cheers, Gene Heskett
--
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
Genes Web page <http://geneslinuxbox.net:6309/gene>

[toc] | [prev] | [next] | [standalone]


#199354

FromGene Heskett <gheskett@shentel.net>
Date2018-08-25 12:10 +0200
Message-ID<wqDG1-49Y-3@gated-at.bofh.it>
In reply to#199350
On Saturday 25 August 2018 04:20:51 tomas@tuxteam.de wrote:

> On Sat, Aug 25, 2018 at 03:54:32AM -0400, Gene Heskett wrote:
>
> [...]
>
> > I've experienced that on a armbian install on a rock64, it takes
> > sometimes 2 or 3 powerdown recycles to make a change in e-n-i.d/name
> > of interface to stick [...]
>
> That sounds a bit like Voodoo. But then, there's Clarke's Third Law.
>
I looked it up, yes. But the wiki page, a ways down, says:

"seeing and hearing Linotype machines which slowly converted ‘molten lead 
into front pages that required two men to lift them.’  I had to chuckle 
about that because it brought up a memory from my childhood, 1047 or so. 
Those old frames were 4" bigger than todays papers, 2 pages wide, and 
probably weighed well over 250 lbs loaded and ready for the press.

When I was in my early teens, and helping out in the darkroom at our 
local weekly paper, it only took one man to pick up that frame of 
Linotype, carry it out thru the back door to a shed over his press and 
place it on the bed of that press.

his name was John Hines, stood about 6'5" and around 275 lbs, owned the 
paper & job shop and only wore white shirts to work and never once did 
he get any ink in them.

One of the local brickyards supervisor guys was famous for a foul mouth, 
and John and his missus was in a benefit bridge game during an Old 
Settlers Re-union, & this guy came to a position behind Johns wife, with 
every third word being a foul word. John told him to watch his mouth, he 
replied "and what the F--k are you going to do about it?

Johns butt never cleared the folding chair he was sitting on as he 
reached over his wife's head across the table and open handedly slapped 
him cold on the floor. The whole fire hall gave him a hand when he stood 
up, picked him up and laid him gently on a park bench just outside the 
front doors.  End of problem.

Thanks for the trip down memory lane.

> Cheers
> -- tomás

-- 
Cheers, Gene Heskett
--
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
Genes Web page <http://geneslinuxbox.net:6309/gene>

[toc] | [prev] | [next] | [standalone]


#199360

Frombw <bwtnguy@yahoo.com>
Date2018-08-25 14:30 +0200
Message-ID<wqFRw-5mD-7@gated-at.bofh.it>
In reply to#199343

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

On Sat, 25 Aug 2018, Mark Pavlichuk wrote:

> ifdown doesn't seem to work.  It seems to complete successfully with messages
> about a released DHCP address, but ifconfig shows the interface is still up, a
> ping will be returned etc...  Though if I try another ifdown it will say the
> interface is not configured.
> 
> If I then make configuration changes, then ifup, ifconfig will show no change.
> 
> -- 
> Mark Pavlichuk
> 
> 

Since man ifdown says the commands only work on "...network interfaces 
based on interface definitions in the file /etc/network/interfaces," my 
guess would be that you have used another method?  or altered the 
interfaces file while the iface is up?

good luck,
no need to cc: I am subscribed to the list

[toc] | [prev] | [next] | [standalone]


#199378

FromMark Pavlichuk <pav5088@internode.on.net>
Date2018-08-26 06:10 +0200
Message-ID<wqUxc-5JC-3@gated-at.bofh.it>
In reply to#199360
If I use a completely vanilla freshly installed VM (on VirtualBox)...  
LXDE, but otherwise standard options:

Even a simple "ifdown <interface>" with no configuration changes gives 
inconsistent results.  Three different results so far:

1) Sometimes it SEEMS like it releases the DHCP address, and completes 
successfully.  ifconfig however shows the interface still there, with an 
IP that can be pinged.

2) Again, seems to complete successfully BUT an ifconfig shows the 
interface without any IP.

3) The ifdown completes successfully, and gets the expected results.

I've waited to make sure I'm not being too quick for a process to 
complete or something.  I'm simply getting inconsistent results with 
identical VM snapshots, and I'm at a loss.

Oh, I forgot...  I think I mentioned earlier in the thread I got some 
kind of (uninformative) systemd message, but that was just one run out 
of perhaps 50 or so.

-- 
Mark Pavlichuk

[toc] | [prev] | [next] | [standalone]


#199386

Frombw <bwtnguy@yahoo.com>
Date2018-08-26 15:20 +0200
Message-ID<wr37s-2id-17@gated-at.bofh.it>
In reply to#199378

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

No need to cc: me, I am subscribed to the list

On Sun, 26 Aug 2018, Mark Pavlichuk wrote:

> If I use a completely vanilla freshly installed VM (on VirtualBox)...  LXDE,
> but otherwise standard options:
> 
> Even a simple "ifdown <interface>" with no configuration changes gives
> inconsistent results.  Three different results so far:
> 
> 1) Sometimes it SEEMS like it releases the DHCP address, and completes
> successfully.  ifconfig however shows the interface still there, with an IP
> that can be pinged.
> 
> 2) Again, seems to complete successfully BUT an ifconfig shows the interface
> without any IP.
> 
> 3) The ifdown completes successfully, and gets the expected results.
> 
> I've waited to make sure I'm not being too quick for a process to complete or
> something.  I'm simply getting inconsistent results with identical VM
> snapshots, and I'm at a loss.
> 
> Oh, I forgot...  I think I mentioned earlier in the thread I got some kind of
> (uninformative) systemd message, but that was just one run out of perhaps 50
> or so.
> 
> -- 
> Mark Pavlichuk
> 
> 

Maybe it would help other people offer some help if you included your 
ifupdown configuration, and also the ifconfig and ping output that 
concerns you?  I would probably check for bugs on ifupdown pkg page also.

I stopped using ifconfig a couple yrs ago.  From what I recall it always 
shows the iface without an IP when it is down?  I never used ifconfig to 
set or manipulate interfaces, but I think it's probably not compatible 
with ifupdown?

I think some ip output might be helpful also.
https://www.debian.org/releases/stable/amd64/release-notes/ch-information.en.html#iproute2

[toc] | [prev] | [standalone]


Back to top | Article view | linux.debian.user


csiph-web