Disclosure up front: I run IPYE, a company that leases IP space. Most of this article is practical how-to; IPYE appears where a free /48, LOA, or ROA helps you try the work, with a short call to action at the end.
Plenty of Debian servers still use ifupdown and /etc/network/interfaces, especially minimal installs and older VPS images. The format is short, but it has a few habits that surprise people, such as how additional addresses are declared and what happens to router advertisements. This guide numbers a Debian server from a free IPv6 /48 from IPYE. Our host gets 2001:db8:100:10::20 on 2001:db8:100:10::/64, with the router at 2001:db8:100:10::1.
A basic static stanza
# /etc/network/interfaces
auto lo
iface lo inet loopback
auto ens18
iface ens18 inet6 static
address 2001:db8:100:10::20/64
gateway 2001:db8:100:10::1
accept_ra 0
autoconf 0
accept_ra 0 tells the kernel to ignore router advertisements on this interface, and autoconf 0 stops it from generating SLAAC addresses. For a server with a fixed address this removes a source of surprise: a stray or misconfigured router on the segment can no longer add a default route or an unexpected address.
If the segment does carry deliberate router advertisements and you want them, use accept_ra 1 and leave autoconf alone. Choose one model per segment rather than mixing them.
Additional addresses
ifupdown accepts more than one iface stanza for the same interface and family. Each extra stanza adds an address:
iface ens18 inet6 static
address 2001:db8:100:10::21/64
iface ens18 inet6 static
address 2001:db8:100:10::22/64
Put these after the main stanza and do not repeat the gateway. An older alternative is a set of up ip -6 addr add lines inside the main stanza, paired with matching down lines; it works, but the separate stanzas are easier to read and clean up.
Extra routes
When part of the /48 is reached through a different router on the same link, add a route with up and down hooks:
iface ens18 inet6 static
address 2001:db8:100:10::20/64
gateway 2001:db8:100:10::1
up ip -6 route add 2001:db8:100:40::/64 via 2001:db8:100:10::5
down ip -6 route del 2001:db8:100:40::/64 via 2001:db8:100:10::5
The down line matters. Without it, an ifdown followed by ifup can fail because the route still exists, and the interface ends up half configured.
DNS servers
ifupdown only sets dns-nameservers if the resolvconf package is installed. Without it, the line is silently ignored and /etc/resolv.conf stays as it was. Either install resolvconf, or manage /etc/resolv.conf directly with an IPv6 resolver such as nameserver 2001:db8:100:53::53.
Applying changes safely
Restarting networking over SSH is the classic way to lock yourself out. Safer options:
ifdown ens18 && ifup ens18
run inside tmux or screen, so the commands complete even if your session drops. Better still, schedule a revert first:
cp /etc/network/interfaces /root/interfaces.good
echo "cp /root/interfaces.good /etc/network/interfaces && ifdown ens18; ifup ens18" | at now + 5 minutes
If the change works, remove the job with atrm. Check the result with ip -6 addr show ens18 and ip -6 route, then test an outbound connection with ping -6 to a well-known address.
Watch out for duplicate address detection
A freshly added IPv6 address is "tentative" for a moment while the kernel checks that no one else on the link uses it. Services that bind to the address during that window fail. If a daemon starts right after ifup, you may see "cannot assign requested address" in its logs. Ordering the service after network-online.target usually solves this; on segments you fully control you can also shorten or disable the check with the dad-attempts option, at the cost of losing the protection.
When to switch tools
ifupdown is fine for a handful of static addresses. If you need many addresses, VLANs, bridges and policy routing on one host, systemd-networkd or NetworkManager may be easier to keep tidy. There is no need to migrate just because the tool is old; it is still maintained in Debian.
The prefix behind it
The host side is the same whoever routes the prefix. If you announce the /48 yourself, the LOA from the IPYE portal is what most upstreams want, and the ROA that IPYE creates for the /48 lets validators mark your route valid.
Next step
Claim your free /48 and number your Debian servers from it, using one stanza per address and a scheduled revert before every change over SSH. Questions: ipye@turnel.com.
About IPYE
IPYE (https://ipye.com) leases IPv4, IPv6 and ASN space with instant setup. Your first IPv6 /48 is free for the first year, a real allocation you can announce on your own ASN, with a LOA from the portal and the ROA created automatically. ASN and region changes apply automatically. IPv4 /24 to /22 leases include LOA, ROA and per-/24 rDNS; WHOIS is editable on IPv6 /44 and larger. Locations: Los Angeles, New York, Ashburn, Salt Lake City, London, Amsterdam, Frankfurt. Claim your free /48: https://my.ipye.com/products/ipv6-rental. Questions: ipye@turnel.com.
Disclosure: I run IPYE
Top comments (0)