LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 07-04-2018, 03:26 AM   #1
Chris_M
LQ Newbie
 
Registered: Jul 2018
Posts: 5

Rep: Reputation: Disabled
Restarting networking on Debian Stretch


I have 2 VM's running in Hyper-v, the first VM is running Debian Jessie and the second one is running Stretch. I have been playing around with networking and have set a static IP address for eth0 in /etc/network/interfaces.
After setting the static IP I run

sudo service networking stop
sudo service networking start.


One the Jesse VM it will change the IP address on eth0 from the DHCP allocated IP to the static IP but on Stretch
it doesn't change the IP address.

I have compared /etc/network/interfaces for a difference but can't find any (both listed below).

Does anyone know why the change isn't taking affect on Stretch?

Jesse /etc/network/interfaces
Code:
source /etc/network/interfaces.d/*

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
allow-hotplug eth0
#iface eth0 inet dhcp
iface eth0 inet static
address 192.168.43.190
Stretch /etc/network/interfaces
Code:
source /etc/network/interfaces.d/*

# the loopback network interface
auto lo
iface lo inet loopback

# Primary interface
allow-hotplug eth0
#iface eth0 inet dhcp
iface eth0 inet static
address 192.168.43.200
 
Old 07-05-2018, 05:31 AM   #2
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
probably has something to do with systemd.
while jessie was already using systemd, there's less and less support for sysvinit-style scripts.
in other words: find out how to do the same with systemd.

generally speaking, i used debian jessie, use stretch now, and also archlinux, and never once have i touched /etc/network/interfaces.
i think you should go the systemd route altogether.
systemd commands are different. the old 'service ... start' might not work anymore.
 
Old 07-07-2018, 03:15 AM   #3
Chris_M
LQ Newbie
 
Registered: Jul 2018
Posts: 5

Original Poster
Rep: Reputation: Disabled
Update

Update
So I created a new VM and installed Debian Stretch. I had to configure eth0 in /etc/network/interfaces as it wasn't already present for some reason. After configuring I was able to obtain a IP via DHCP. Once I had an IP I then used ifdown eth0 to bring the interface down and configured a static IP address in /etc/network/interfaces, using ifup eth0 I was then able to bring the interface up and I now had the static IP address.

I repeated the steps above on my previous stretch vm but it still didn't work.

Note
I must have installed net-tools on the first instance of Stretch as I have been using ifconfig which is not present a fresh install of Debian Stretch. I have not as yet installed net-tools on the second instance.
 
Old 07-07-2018, 04:45 AM   #4
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
i can see that this debian wiki article recommends to do it your way.
however, it does not mention systemd even once, hence it must be outdated.

this article has more to say; once more i suggest to leave /etc/network/interfaces alone and go fully systemd.
 
Old 07-07-2018, 06:02 PM   #5
Chris_M
LQ Newbie
 
Registered: Jul 2018
Posts: 5

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by ondoho View Post
i can see that this debian wiki article recommends to do it your way.
however, it does not mention systemd even once, hence it must be outdated.

this article has more to say; once more i suggest to leave /etc/network/interfaces alone and go fully systemd.
This is from the Debian manual and potentially why the wiki hasn't been updated.

Note
Do not use these automatic network configuration tools for servers. These are aimed primarily for mobile desktop users on laptops.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Installing Php 7.2 On Debian 8 Jessie And Debian 9 Stretch LXer Syndicated Linux News 0 03-09-2018 10:12 AM
LXer: How to upgrade Debian 8 Jessie to Debian 9 Stretch LXer Syndicated Linux News 0 06-16-2017 02:11 AM
Restarting networking service fanoflq Linux - Networking 2 08-23-2016 09:50 AM
[SOLVED] Getting error after restarting networking service on debian! massy Linux - Server 2 12-08-2014 01:18 AM
Restarting Networking Randy Slackware 3 10-25-2003 08:59 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 11:27 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration