DEV Community

Nick Schmidt
Nick Schmidt

Posted on • Originally published at blog.engyak.co on

Static IPv4/IPv6 Addresses - Debian 11

Here's how to set both static IPv4 and IPv6 addressing on Debian 11. The new portions are outlined in italics.

First, edit /etc/network/interfaces

auto lo
auto ens192
iface lo inet loopback
# The primary network interface
allow-hotplug ens192
iface ens192 inet static
    address {{ ipv4.address }}
    gateway {{ ipv4.gateway }}
iface ens192 inet6 static
    address {{ ipv6.address }}
    gateway {{ ipv6.gateway }}
Enter fullscreen mode Exit fullscreen mode

Then, restart your networking stack:

systemctl restart networking
Enter fullscreen mode Exit fullscreen mode

Top comments (0)