mikrotik_snippets/interfaces.sh

45 lines
736 B
Bash
Raw Normal View History

2016-05-07 05:34:43 +03:00
#
# /etc/network/interfaces
#
# Loopback.
auto lo
iface lo inet loopback
# Another loopback.
auto lo:50
iface lo:50 inet static
address 192.168.0.1
netmask 255.255.255.255
# VLANs.
auto eth0
auto eth0.100
auto eth0.333
auto eth0.333.400
# Physical interface,
iface eth0 inet manual
mtu 1508
pre-up /sbin/ifconfig eth0 mtu 1508
# Vlan 100.
iface eth0.100 inet static
address <IP_ADDR>
netmask <IP_MASK>
gateway <GATEWAY>
dns-nameservers <DNS1> <DNS2>
mtu 1500
# Vlan 333.
iface eth0.333 inet manual
mtu 1500
up /sbin/vconfig add eth0.333 400
# Vlan 333.400.
iface eth0.333.400 inet static
address <IP_ADDR>
netmask <IP_MASK>
mtu 1500
pre-up /sbin/ifconfig eth0.333 up