(solved) How to start/stop a network interface (Stretch)

New to Debian (Or Linux in general)? Ask your questions here!

(solved) How to start/stop a network interface (Stretch)

Postby PaulS » 2017-03-08 01:56

Hi,

I just switched from Kubuntu to Debian Stretch with KDE and have a problem stopping my openVPN connections.

They are started automatically at system boot, but sometimes I have to stop one of them manually.
In old Debian I used ifup and ifdown for that task
In Kubuntu I used ifconfig

In Debian Strech I'm clueless, even after some recherche.
I have ifup and ifdown installed but it doesn't find my adapters.

My adapters are:
enp3sC for the ethernet device
tun1 and tun3 for openVPN devices

ifdown tun1 (or any other network device) just results in
ifdown: unknown inerface tun1

How is it done nowadays?
Last edited by PaulS on 2017-03-08 23:18, edited 1 time in total.
PaulS
 
Posts: 2
Joined: 2017-03-08 01:36

Re: How to start/stop a network interface (Stretch)

Postby Head_on_a_Stick » 2017-03-08 06:40

I can't check this atm but try:
Code: Select all
# systemctl stop networking.service

Use this to start it again:
Code: Select all
# systemctl start networking.service

ifupdown only works if the connections are controlled through /etc/network/interfaces

You can do this instead if you want by configuring that file as desired with reference to interfaces(5).

EDIT: you can set an individual interface down with:
Code: Select all
# ip link set tun1 down

Bring it up again with:
Code: Select all
# ip link set tun1 up
"Are you quite sure that all those bells and whistles, all those wonderful facilities of your so called powerful programming languages, belong to the solution set rather than the problem set?" — Edsger W. Dijkstra
User avatar
Head_on_a_Stick
 
Posts: 6585
Joined: 2014-06-01 17:46
Location: /dev/chair

(solved) How to start/stop a network interface (Stretch)

Postby PaulS » 2017-03-08 23:16

Thanks a lot, Head_on_a_Stick,

systemctl stop networking.service didn't seem to do anything, but ip link set tun1 up / down did exactly what I wanted.

Can I mark this question as solved somehow? I did it by changing the subject, but maybe there's an "official" way?
PaulS
 
Posts: 2
Joined: 2017-03-08 01:36


Return to Beginners Questions

Who is online

Users browsing this forum: No registered users and 3 guests

fashionable