Added configurations for main-site linux host and off-site linux host
Added GNS3 example topology image
This commit is contained in:
24
main-site/scripts/create-bridge
Normal file
24
main-site/scripts/create-bridge
Normal file
@@ -0,0 +1,24 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# This script is for creating a bridge interface, assigning an IP address, and adding physical interface enp2s0 to it.
|
||||
|
||||
# Create bridge
|
||||
ip link add type bridge
|
||||
# name is non deterministic, fix
|
||||
# Two addresses are given, one for wireguard peer and one for L2TP tunnel. Seperate addresses are required because the wireguard peer will have one route over the internet, and another route through the wireguard network.
|
||||
ip address add 200.1.0.2/16 dev bridge0
|
||||
ip address add 200.1.0.3/16 dev bridge0
|
||||
|
||||
# Change bridge0 mac address to not conflict with bridge interface of other wireguard peer
|
||||
ip link set bridge0 address d6:05:05:32:d1:5d
|
||||
|
||||
# Add physical nic to bridge
|
||||
ip link set enp2s0 master bridge0
|
||||
ip link set enp2s0 up
|
||||
ip link set bridge0 up
|
||||
|
||||
# Static Routes
|
||||
# default
|
||||
ip route add default via 200.1.0.1
|
||||
# to reach l2tp tunnel interface through wg0
|
||||
ip route add 200.1.0.4/32 via 192.168.1.2
|
||||
13
main-site/scripts/create-l2tp
Normal file
13
main-site/scripts/create-l2tp
Normal file
@@ -0,0 +1,13 @@
|
||||
#!/bin/sh
|
||||
# This script creates an L2TP tunnel and session, then adds the L2TP interface to bridge0
|
||||
|
||||
# Create tunnel and session
|
||||
ip l2tp add tunnel tunnel_id 123456 peer_tunnel_id 123456 remote 200.1.0.4 local 200.1.0.3 encap ip
|
||||
ip l2tp add session tunnel_id 123456 session_id 789 peer_session_id 789
|
||||
|
||||
# Change address to not conflict with l2tp interface of other wireguard peer
|
||||
ip link set l2tpeth0 address 9a:a5:d4:74:0c:d1
|
||||
|
||||
# Bridge physical interface with L2TP interface
|
||||
ip link set l2tpeth0 master bridge0
|
||||
ip link set l2tpeth0 up
|
||||
Reference in New Issue
Block a user