0

TLDR: How do you add persistent promiscuous mode in Debian 12?

I'm running a Proxmox server with a few virtual machines and each VM is running separate Docker containers for different tasks. Previously I've had no problem with promiscuous mode in Debian 11 cloudinit image, but Debian 12 seems to work differently. I've tested this behaviour also in Debian 12 "normal" installation, so problem is probably not cloudinit related.

For cloudinit template creation I used this guide from OchoaProjects

Debian 11 allowed automatic promiscuous mode with this line in /etc/network/interfaces:

up ip link set eth0 promisc on
down ip link set eth0 promisc off

Also, ip link set eth0 promisc on still works on Debian 12.

So, how do you add persistent promiscuous mode in Debian 12?

3
  • Does the wireless card support monitor mode? It needs to.
    – anon
    Commented Aug 18, 2023 at 16:58
  • Use case here is virtual machines. So no wireless cards, only virtual ethernet connections.
    – samumoil
    Commented Aug 18, 2023 at 19:35
  • Set up USB Pass Through and procure and install a USB Wireless card that supports Monitor Mode. I do that here.
    – anon
    Commented Aug 18, 2023 at 19:37

1 Answer 1

2

Debian 12 Bookworm cloudinit uses systemd-networkd

Turns out systemd-networkd completely bypasses /etc/network/interface and changes in that file do not propagate. You can solve this by disabling systemd-networkd, but I suspect they have a reason to use it. Thus, I solved the problem using a modified version of a systemd service from this post.

Solution #1

We'll add a service to activate command ip link set eth0 promisc on at boot:

  1. Add this service file promisc.service in /etc/systemd/system/
[Unit]
Description=Control promiscuous mode for interface eth0
After=network.target

[Service]
Type=oneshot
ExecStart=/usr/bin/ip link set eth0 promisc on
ExecStop=/usr/bin/ip link set eth0 promisc off
RemainAfterExit=yes

[Install]
WantedBy=multi-user.target
  1. Enable the service with sudo systemctl enable promisc.service

  2. Reboot and ip a should show "PROMISC"

2: eth0: <BROADCAST,MULTICAST,PROMISC,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000

Solution #2

User Tom Yan pointed to systemd documentation which provided another solution. You can add a config file in /etc/systemd/network/ and set promiscuous mode there.

Steps for Debian 12 cloudinit

  1. List contents of directory /run/systemd/network/ and check files with .network suffix. One of them (or the only one) should contain IP address provided by your cloudinit image. Mine was 10-netplan-eth0.network.
  2. Create directory /etc/systemd/network/<name-of-file>.d/. Use the filename from previous step.
  3. Create a file in that directory with a suffix .conf, any name will do. Add following in that file (use whatever network interface name you want to affect, mine is eth0):
[Match]
Name=eth0

[Link]
Promiscuous=true
  1. Reboot and check network interface with ip a.
0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .