Um auf einem Raspberry Pi mit Ubuntu-Mate den Netzwerkverkehr von eth0 (intern) zu eth1 (USB) zu routen sind einige wenige Schritte notwendig. Zur Vereinfachung sollten die Interfacenamen auf den Standard eth0 zurück gesetzt werden. Wenn sich im Netz kein anderer DHCP-Server befindet, ist die Installation eines DHCP-Servers zu empfehlen.
#Installieren der Bridge Utils pi@pi-desktop:~$ sudo apt-get install bridge-utils #Öffnen der Konfigurationsdatei pi@pi-desktop:~$ sudo nano /etc/network/interfaces [sudo] password for pi: #Inhalt der Datei: # interfaces(5) file used by ifup(8) and ifdown(8) # Include files from /etc/network/interfaces.d: source-directory /etc/network/interfaces.d # The loopback network interface auto lo iface lo inet loopback auto eth0 iface eth0 inet manual auto eth1 iface eth1 inet manual #Bündeln von eth0 und eth1 mit statischer IP Adresse für #Serverbetrieb konfiguriert #Kann auch zum beziehen von IP Adressen eingestellt werden #iface br0 inet dhcp auto br0 iface br0 inet static address 192.168.1.5 network 192.168.1.0 netmask 255.255.255.0 broadcast 192.168.1.255 bridge_ports eth0 eth1 #Strg + o speichern Strg + x schließen #Zuletzt muss der Dateverkehr durchgereicht werden. Hierfür #entfert man das Kommentarsymbol '#' vor net.ipv4.ip_forward=1 #öffnen der Datei pi@pi-desktop:~$ sudo nano /etc/sysctl.conf #Ausschnitt des Inhalts <...> ##############################################################3 # Functions previously found in netbase # # Uncomment the next two lines to enable Spoof protection (reverse-path filter) # Turn on Source Address Verification in all interfaces to # prevent some spoofing attacks #net.ipv4.conf.default.rp_filter=1 #net.ipv4.conf.all.rp_filter=1 # Uncomment the next line to enable TCP/IP SYN cookies # See http://lwn.net/Articles/277146/ # Note: This may impact IPv6 TCP sessions too #net.ipv4.tcp_syncookies=1 # Uncomment the next line to enable packet forwarding for IPv4 net.ipv4.ip_forward=1 # Uncomment the next line to enable packet forwarding for IPv6 # Enabling this option disables Stateless Address Autoconfiguration # based on Router Advertisements for this host #net.ipv6.conf.all.forwarding=1 <...> #Strg + o Speichern Strg + x Verlassen #Nach einem Neustart sollte die Funktion bereitgestellt sein pi@pi-desktop:~$ sudo shutdown -r now