Quantcast
Channel: Debian User Forums
Viewing all articles
Browse latest Browse all 2849

System and Network configuration • Re: How to add new dummy persistent network device

$
0
0
Hello,
Hello, I'm currently executing

Code:

ip l add veth type dummyip l dev veth address d4:d4:d4:d4:d4:d4
every time I start the machine.

How can I configure Debian in a way that this dummy network device with fixed mac address is persisted between reboots?

I wanted to avoid to "pollute" my crontab, but I did not find out what is _the_ way one should do it.
The syntax of /etc/network/interfaces is a bit obscure to me, and I did not manage to add the device there (where IMHO it makes the most sense).
This can be a possible solution.

You can create two shell scripts (e.g. named veth-up and veth-down) with 0755 permissions:
  • a first script called veth-up in the directory named /etc/network/if-up.d :

    Code:

    #! /bin/ship link add veth type dummyip link set veth address d4:d4:d4:d4:d4:d4
  • a second script called veth-down in the directory named /etc/network/if-down.d :

    Code:

    #! /bin/ship link del veth
Hope this helps.

--
note:
1) I modified the syntax of your mac address set command because it was returning a syntax error.
2) please, use code tags to include commands and/or their logs in the body of a message; I modified the first post for you.

Statistics: Posted by Aki — 2024-10-05 08:23



Viewing all articles
Browse latest Browse all 2849

Trending Articles