You are not logged in.

#1 2024-02-17 10:32:59

forward_one
Member
Registered: 2023-06-30
Posts: 31

NETDEV. How to delete a created virtual network device

I have just started to figure it out and am dealing with configurations. the documentation says:
"If a netdev with the specified name already exists, networkd will use that as-is rather than create its own. Note that the settings of the pre-existing netdev will not be changed by networkd."

is it possible to delete this network device? is it possible to remove other network devices (enp_xxx and wlan_xxx)? how can I create and configure these devices again? where can I read about it?

My config for .netdev

[Match]
Virtualization=false

[NetDev]
#Description=Virtual Network
Name=br0
Kind=bridge
#MTUBytes=10M
#MACAddress=none

[Bridge]
HelloTimeSec=10
MaxAgeSec=10
Priority=65000
DefaultPVID=1

Offline

#2 2024-02-17 22:50:29

ectospasm
Member
Registered: 2015-08-28
Posts: 273

Re: NETDEV. How to delete a created virtual network device

You only need to define any /etc/systemd/network/*.netdev files if you're doing something specific.  From that .netdev, it looks like a bridge network device was attempted to be set up.  If you don't need or want that device, you should be able to safely remove that file;  move it (mv) somewhere where you can refer back to it later.

I have an Arch router, which uses systemd-networkd as its network manager.  I do have /etc/systemd/network/22-iot.netdev file, but all it really does is set up a VLAN for that interface.  My main WAN and LAN *.network files do not have corresponding .netdev files.

EDIT:  In general, you'll need to define a *.network file that describes the basic parameters of each network interface you want to enable.  It's where you match against a physical network device name, set the IP options (static or DHCP), etc.  If you want to change the network interface names, you should be able to set up udev rules that name them whatever you want;  this is completely optional, I don't do this.

You only need *.netdev if you're trying to build a virtual network (e.g. for containers, virtual machines, etc.), or set up VLANs, or other very specific intentions.  And I wouldn't name it /etc/systemd/network/.netdev, I'd give it a more descriptive filename (like I did with my 22-iot.netdev file in my example).

Last edited by ectospasm (2024-02-17 23:01:25)

Offline

Board footer

Powered by FluxBB