/etc/network/interfaces 3x => /etc/network/interface.d/XXX

Einrichten des lokalen Netzes, Verbindung zu anderen Computern und Diensten.
Antworten
egerlach
Beiträge: 206
Registriert: 13.06.2009 17:21:50

/etc/network/interfaces 3x => /etc/network/interface.d/XXX

Beitrag von egerlach » 24.11.2021 23:04:43

Hallo,
wer hilft mir meine /etc/network/interfaces mit 3 Netzwerk-Einträgen für eth0, eth0:1 und wg0 in eine zeitgemäße Variante mit 3 einzelnen Netzwerk-Devices in /etc/network/interface.d/ zu verwandeln?
Habe es versucht ... ist mir nicht gelungen:

Code: Alles auswählen

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
#allow-hotplug eth0
#iface eth0 inet dhcp

auto eth0
    iface eth0 inet static
        address 10.0.0.104
        netmask 255.255.255.0
        network 10.0.0.0
        gateway 10.0.0.1
        broadcast 10.0.0.255


auto eth0:1
iface eth0:1 inet static
address 10.0.0.102
        netmask 255.255.255.0
        network 10.0.0.0
        gateway 10.0.0.1
        broadcast 10.0.0.255


# indicate that wg0 should be created when the system boots, and on ifup -a
auto wg0
# describe wg0 as an IPv4 interface with static address
iface wg0 inet static
        # static IP address
        address 10.0.2.1/24
        #address 192.168.2.1/24

        # before ifup, create the device with this ip link command
        pre-up ip link add $IFACE type wireguard

        # before ifup, set the WireGuard config from earlier
        pre-up wg setconf $IFACE /etc/wireguard/$IFACE.conf

        # after ifdown, destroy the wg0 interface
        post-down ip link del $IFACE
danke schon mal
Eckard

mat6937
Beiträge: 2927
Registriert: 09.12.2014 10:44:00

Re: /etc/network/interfaces 3x => /etc/network/interface.d/XXX

Beitrag von mat6937 » 25.11.2021 08:31:41

egerlach hat geschrieben: ↑ zum Beitrag ↑
24.11.2021 23:04:43
wer hilft mir meine /etc/network/interfaces mit 3 Netzwerk-Einträgen für eth0, eth0:1 und wg0 in eine zeitgemäße Variante mit 3 einzelnen Netzwerk-Devices in /etc/network/interface.d/ zu verwandeln?
Habe es versucht ... ist mir nicht gelungen:
BTW: Warum willst Du jetzt noch die interfaces-Datei benutzen? Das geht viel schöner/besser mit systemd-networkd, gerade wenn es um WireGuard geht.

egerlach
Beiträge: 206
Registriert: 13.06.2009 17:21:50

Re: /etc/network/interfaces 3x => /etc/network/interface.d/XXX

Beitrag von egerlach » 25.11.2021 18:11:36

Ja super! Das nehme ich, es ist ja überall state-of-art! Ich war nur nicht auf dem neusten Stand! :)

Antworten