Turning interfaces UP/DOWN via SSH

Hello.
I wonder if it is possible to turn interfaces UP/DOWN via SSH connection.

I often do so with my Wireguard VPS interface via LUCI (buttons Stop/Start/Restart) but find it too long and pretty inconvenient.

Sure:
ifdown wg0 / ifup wg0
does the trick for your wireguard interface (asuming it is named wg0).

Here is actually the place where things go strange for me.

I have an interface

root@turris:~# ip -c a show dev VPS
27: VPS: <POINTOPOINT,NOARP,UP,LOWER_UP> mtu 1420 qdisc noqueue state UNKNOWN 
    group default qlen 1000
    link/none 
    inet 192.168.255.2/32 brd 255.255.255.255 scope global VPS
      valid_lft forever preferred_lft forever

It shows UNKNOWN but it is working at the moment.

If I do

root@turris:~# ip l set VPS up

it changes to DOWN state:

root@turris:~# ip -c a show dev VPS
27: VPS: <POINTOPOINT,NOARP,UP,LOWER_UP> mtu 1420 qdisc noqueue state DOWN
    group default qlen 1000
    link/none 
    inet 192.168.255.2/32 brd 255.255.255.255 scope global VPS
      valid_lft forever preferred_lft forever

It’s is not working anymore BUT:

  1. LUCI still shows it is UP and uptime is ticking.
  2. If I turn it back UP nothing changes (I mean it is still doesn’t work). The only way to turn it back UP is to click Restart button in LUCI.