Last active
March 15, 2021 04:48
-
-
Save rsaxvc/92a7d70c7fc62289fe78347142a9925e to your computer and use it in GitHub Desktop.
/etc/network/interfaces file for Linux router
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This file describes how to configure a Linux computer as a router for GoogleFiber. | |
# References: | |
# https://wiki.debian.org/NetworkConfiguration#Bridges_and_VLANs | |
# https://wiki.debian.org/BridgeNetworkConnections#Configuring_bridging_in_.2Fetc.2Fnetwork.2Finterfaces | |
# http://flyovercountry.org/2014/02/google-fiber-gigabit-speeds-your-router-part-2-qos/ | |
source /etc/network/interfaces.d/* | |
# The loopback network interface | |
auto lo | |
iface lo inet loopback | |
#This is the standard NAT setup | |
pre-up iptables-restore < /etc/iptables.rules | |
#This interface connects to Google's GPON Fiber<->Ethernet converter. Also spoof the Google Fiber router's MAC | |
auto enp3s0f0 | |
iface enp3s0f0 inet manual | |
hwaddress ether 00:11:22:33:44:55 | |
#This creates a VLAN | |
auto enp3s0f0.2 | |
iface enp3s0f0.2 inet manual | |
hwaddress ether 00:11:22:33:44:55 | |
#By default, route all traffic to priority 3. This is not strictly correct, but close enough. | |
up vconfig set_egress_map "$IFACE" 0 3 | |
#Create a bridge to support hosting virtual machines on the internet. | |
#You could also configure enp3s0f0.2 directly with DHCP | |
auto br_external | |
iface br_external inet dhcp | |
bridge_ports enp3s0f0.2 | |
bridge_stp off | |
up ip link set dev enp3s0f0 up | |
#Create a bridge to support hosting virtual machines on the LAN and VPN bridging. | |
auto br_internal | |
iface br_internal inet static | |
bridge_ports enp3s0f1 | |
bridge_stp off | |
address 192.168.9.1 | |
broadcast 192.168.9.255 | |
netmask 255.255.255.0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment