2te IP Adress auf eth0 dauerhaft binden



Lord_Icon

Member
Moinz,

ich bekomme einen neuen IP Kreis. Der alte IP Kreis wird ende des Jahres dann deaktiviert. In der übergangszeit will ich mit beiden IP Adressen arbeiten.

Soweit auch kein Problem.
In der /etc/network/interfaces einfach einen neuen Block mit eth0:1 anlegen.
Klappt soweit auch ganz gut.

Nur hab ich dann eine 2te virtuelle Netzwerkkarte. Schöner (uns laut web auch empfohlen) ist die zusätzliche Bindung auf eth0 direkt.
Mittels:
Code:
ip addr add 192.168.0.77/24 broadcast 192.168.0.255 dev eth0
klappt das auch (vorübergehend)


Nur wie sieht ein solcher eintrag dauerhaft innerhalb etc/network/interfaces aus ?
Kann da ja schlecht 2 x den Befehl "address" eingeben


Danke für Tipps oder auszüge ;-)
 
Das kannst du mit den optionalen Parametern "post-up" realisieren :-)
Siehe Manpage von Interfaces: "man interfaces"
IFACE OPTIONS
The following "command" options are available for every family and method. Each of these
options can be given multiple times in a single stanza, in which case the commands are executed
in the order in which they appear in the stanza. (You can ensure a command never fails by suf-
fixing them with "|| true".)

pre-up command
Run command before bringing the interface up. If this command fails then ifup aborts,
refraining from marking the interface as configured, prints an error message, and exits
with status 0. This behavior may change in the future.

up command

post-up command
Run command after bringing the interface up. If this command fails then ifup aborts,
refraining from marking the interface as configured (even though it has really been con-
figured), prints an error message, and exits with status 0. This behavior may change in
the future.

down command

pre-down command
Run command before taking the interface down. If this command fails then ifdown aborts,
marks the interface as deconfigured (even though it has not really been deconfigured),
and exits with status 0. This behavior may change in the future.

post-down command
Run command after taking the interface down. If this command fails then ifdown aborts,
marks the interface as deconfigured, and exits with status 0. This behavior may change
in the future.
 
Back
Top