mikrotik_snippets/linux/interfaces.txt

61 lines
1.3 KiB
Plaintext

#
# /etc/network/interfaces
#
# Loopback.
auto lo
iface lo inet loopback
# Another IPv4 loopback.
auto lo:50
iface lo:50 inet static
address 192.168.0.1
netmask 255.255.255.255
# Another IPv6 loopback.
iface lo inet6 static
address 2000:www:xxx::zzzz
netmask 128
# Physical interface.
auto eth0
iface eth0 inet manual
mtu 1508
pre-up /sbin/ifconfig eth0 mtu 1508
# Vlan 100: IPv4 address.
auto eth0.100
iface eth0.100 inet static
address <IP_ADDR>
netmask <IP_MASK>
gateway <GATEWAY>
dns-nameservers <DNS1> <DNS2>
mtu 1500
# Vlan 333.
auto eth0.333
iface eth0.333 inet manual
mtu 1500
up /sbin/vconfig add eth0.333 400
# Vlan 333.400: IPv4 address.
auto eth0.333.400
iface eth0.333.400 inet static
address 10.10.10.2
netmask 255.255.255.0
mtu 1500
pre-up /sbin/ifconfig eth0.333 up
post-up /sbin/ip route add 10.3.0.0/16 via 10.10.10.1 src 192.168.0.1
post-up /sbin/ip route add 10.4.0.0/16 via 10.10.10.1 src 192.168.0.1
post-up /sbin/ip route add default via 10.10.10.1 src 192.168.0.1
# Vlan 555: IPv6 address.
auto eth0.555
iface eth0.555 inet6 static
address 2001:wwww:xxxx::2
netmask 64
mtu 1500
post-up /sbin/ip -6 route add default via 2001:wwww:xxxx::1 src 2000:www:xxx::zzzz
# End.