Thanks for the answer, but neither works.
All the data below shows the state while the cable isn't plugged in.
Code:
root@TDTErsatz:/home/katrin# cat /etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
source /etc/network/interfaces.d/*
# The loopback network interface
auto lo
auto eth1
auto eth0
iface lo inet loopback
# The primary network interface
allow-hotplug eth0
iface eth0 inet static
address 192.168.1.11
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.1.1
# dns-* options are implemented by the resolvconf package, if installed
dns-nameservers 192.168.1.1
dns-search Alec.de
iface eth1 inet static
address 192.168.0.11
netmask 255.255.255.0
broadcast 192.168.0.255
post-down route del 192.168.0.0/24
Code:
root@TDTErsatz:/home/katrin# ip ad show dev eth1
3: eth1: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN group default qlen 1000
link/ether a0:48:1c:b8:9a:b9 brd ff:ff:ff:ff:ff:ff
inet 192.168.0.11/24 brd 192.168.0.255 scope global eth1
valid_lft forever preferred_lft forever
inet6 fe80::a248:1cff:feb8:9ab9/64 scope link
valid_lft forever preferred_lft forever
Code:
root@TDTErsatz:/home/katrin# ip -s link show dev eth1
3: eth1: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN mode DEFAULT group default qlen 1000
link/ether a0:48:1c:b8:9a:b9 brd ff:ff:ff:ff:ff:ff
RX: bytes packets errors dropped overrun mcast
526164 4638 0 917 0 2055
TX: bytes packets errors dropped carrier collsns
680 8 0 0 0 0
Code:
root@TDTErsatz:/home/katrin# ip route
default via 192.168.1.1 dev eth0
192.168.0.0/24 dev eth1 proto kernel scope link src 192.168.0.11
192.168.1.0/24 dev eth0 proto kernel scope link src 192.168.1.11