Network (Buster)

From Hexwiki
Revision as of 18:40, 21 January 2021 by Vekseid (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Fairly universal for Debian-derived systems. Little has changed.

/etc/network/interfaces

# Friendly local loopback.
auto lo
iface lo inet loopback
# The primary network interface
allow-hotplug eno1 
# IPv4
iface eno1 inet4 static
       address 192.168.119.218/29
       gateway 192.168.119.217
       dns-nameservers ::1 1.1.1.1 8.8.8.8
       dns-search invalid
       # Firewall script.
       pre-up /root/firewall.sh
       up /bin/ip addr add 192.168.119.219/29 dev eno1 label eno1:0
       down /bin/ip addr del 192.168.119.219/29 dev eno1 label eno1:0 
       # ...
# IPv6!
iface eno1 inet6 static
       address 2001:db8:0:4ee4::2/64
       gateway 2001:db8:0:4ee4::1
       dns-nameservers ::1 1.1.1.1 8.8.8.8
       dns-search invalid
       pre-up /root/firewall6.sh
       # If you want, pick something that isn't going to get random-scanned for your ssh ip.
       up /bin/ip -6 addr add dev eth0 2001:db8:0:4ee4:62e1:2091:be42:f322/64
       down /bin/ip -6 addr del dev eth0 2001:db8:0:4ee4:62e1:2091:ve42:f322/64
       # ...