1

my first question here.

I'm currently using the 'dhcp-helper' program to do dhcp relay, works fine, but I want to switch to using the systemd-networkd 'RelayTarget' function in the *.network file. I've tried every option I can think of, but can't seem to get it working.

  • Running current Debian stable "bookworm 12" 6.1.0-13-amd64
  • Debian stable runs systemd 252 (252.17-1~deb12u1)

I've tried every option I can think of, no luck yet.

/etc/systemd/network/02-port2-lan0-static.network:

# /etc/systemd/network/02-port2-lan0-static.network
# configures lan0 with static ip address
#
[Match]
Name=lan0
[Network]
Address=172.16.1.1/24
# do not set gateway or dns, will inherit from system
[DHCPServer]
ServerAddress=172.16.11.2/24
RelayTarget=172.16.11.2
BindToInterface=no

Anyone have this working in Debian stable? I realize Debian stable does not run the latest systemd version. This is a production router, so upgrading to testing is not an option.

Thanks

0

1 Answer 1

0

With this ServerAddress=, you're telling networkd to become 172.16.11.2 and to relay all DHCP requests back to itself. Do not set ServerAddress= at all, or set it to 172.16.1.1/24 (i.e. the router's own address).

1
  • I've tried every combo I can think of, started with just the RelayTarget line, then added the others, none of it worked.
    – drokmed
    Nov 6, 2023 at 17:13

You must log in to answer this question.

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