Ubuntu: Interface konfigurieren

Interfacekonfiguration über das interfaces-File bei Ubuntu:

 

Anbei ein paar Möglichkeiten der Interfacekonfiguration über das interfaces-File:

File:   /etc/network/interfaces

Neustart Networking-Dämon:   /etc/init.d/networking restart    # start/stop

# DHCP
auto eth0
iface eth0 inet dhcp

# statische Adresse, def. GW, DNS
auto eth0
iface eth0 inet static
address 192.168.3.90
gateway 192.168.3.254
netmask 255.255.255.0
network 192.168.3.0
broadcast 192.168.3.255
dns-nameservers 192.168.7.254

# 2 IP Adressen auf 1 Interface
auto eth0 eth0:1
iface eth0 inet static
address 192.168.0.1
network 192.168.0.0
netmask 255.255.255.0
broadcast 192.168.0.255
gateway 192.168.0.254
iface eth0:1
inet static
address 192.168.0.2
network 192.168.0.0
netmask 255.255.255.0

# Pre-up (Achtung: wenn das myfirewallstartfile nicht existiert, dann fährt das IF nicht hoch!)
auto eth0
iface eth0 inet static
address 192.168.0.1
netmask 255.255.255.0
pre-up /any/path/myfirewallstartfile

# Eintrag einer Route beim Starten des IFs
auto eth0
iface eth0 inet static
address 192.168.0.1
netmask 255.255.255.0
broadcast 192.168.0.255
up route add -net 192.168.1.0 netmask 255.255.255.0 gw 192.168.0.254
down route del -net 192.168.1.0 netmask 255.255.255.0 gw 192.168.0.254

 

Für weitere, teils interessante Möglichkeiten siehe auch:

http://www.cyberciti.biz/faq/setting-up-an-network-interfaces-file/