0

I'm trying to make persistent some ip links settings on ubuntu 22.04 desktop.
Commands below works fine but are not persistent:

ip link add mynet-shim link eno1 type macvlan  mode bridge
ip addr add 192.168.1.223/32 dev mynet-shim
ip link set mynet-shim up
ip route add 192.168.1.192/27 dev mynet-shim

I have tried using nmcli but it seems macvlan bridge is not available. Do you have any idea or a tutorial explaining how to proceed?

7

1 Answer 1

0

You're using NetworkManager, so this should be a NetworkManager connection. You could set that up graphically using your desktop's "edit connections" dialog (or nm-connection-editor), or something like

nmcli connection add \
  save yes \
  autoconnect yes\
  con-name mynet-shim \
  type macvlan \
  dev eno1 \
  mode bridge \
  ip4 192.168.1.223/32 \
  gw4 192.168.192/27

No need for any startup scripting – this is literally what your network manager is for.

0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.