From 3d05e7eaa88f429b351e972ee9d32226445d0f13 Mon Sep 17 00:00:00 2001 From: Ralph Ronnquist Date: Sun, 11 Apr 2021 19:48:22 +1000 Subject: [PATCH] added templates for interfaces.d configurations --- debian/rrqnet.docs | 2 ++ interfaces-template-1 | 31 +++++++++++++++++++++++++++++++ interfaces-template-2 | 18 ++++++++++++++++++ interfaces-template-3 | 35 +++++++++++++++++++++++++++++++++++ 4 files changed, 86 insertions(+) create mode 100644 debian/rrqnet.docs create mode 100644 interfaces-template-1 create mode 100644 interfaces-template-2 create mode 100644 interfaces-template-3 diff --git a/debian/rrqnet.docs b/debian/rrqnet.docs new file mode 100644 index 0000000..1df1bd8 --- /dev/null +++ b/debian/rrqnet.docs @@ -0,0 +1,2 @@ +interfaces-template-* + diff --git a/interfaces-template-1 b/interfaces-template-1 new file mode 100644 index 0000000..9204d28 --- /dev/null +++ b/interfaces-template-1 @@ -0,0 +1,31 @@ +# Virtual cable with uplink to example host at 10.0.0.1:2 +# + creates a local tap named "example" with tunneling MTU (1450) +# + uses UDP port 3 for this cable end +# + reniced service daemon +# + single-v logging to /var/log/rrqnet-example.log +# + cable PSK /etc/rrqnet/keys/example.key (not included) +# + 10 packet buffers and a single dispatch thread +# + using dhcpclient locally for IPv4 assignment +# + static MAC address and IPv4 assignment +# +# This template includes an extension block for adding an ipv6 setup +# (with fictive addresses). Usage: +# ifup example=ipv6 +# ifdown example=ipv6 + +auto example +iface example inet static + mtu 1450 + hwaddress 02:00:00:00:00:02 + address 192.168.0.2/24 + broadcast 192.168.0.255 + rrqnet_port 3 + rrqnet_nice -3 + rrqnet_log -v /var/log/rrqnet-example.log + rrqnet_remote 10.0.0.1:2=/etc/rrqnet/keys/example.key + rrqnet_options -B 10 -T 1 + +iface ipv6 inet static inherits example + up ip addr add fe00:0:0:0:0:1:c0a8:0002/96 dev example + up ip route add ::/0 via fe00:0:0:0:0:1:0:1 dev example + down ip route del ::/0 via fe00:0:0:0:0:1:0:1 dev example diff --git a/interfaces-template-2 b/interfaces-template-2 new file mode 100644 index 0000000..8af2221 --- /dev/null +++ b/interfaces-template-2 @@ -0,0 +1,18 @@ +# Virtual cable with uplinks to example host at 10.0.0.1:2 +# + creates a local tap named "example" with tunneling MTU (1450) +# + uses UDP port 3 for this cable end +# + reniced service daemon +# + single-v logging to /var/log/rrqnet-example.log +# + cable PSK /etc/rrqnet/keys/example.key (not included) +# + 10 packet buffers and a single dispatch thread +# + using dhcpclient locally for IPv4 assignment + +auto example +iface example inet manual + mtu 1450 + rrqnet_port 3 + rrqnet_nice -3 + rrqnet_log -v /var/log/rrqnet-example.log + rrqnet_remote 10.0.0.1:2=/etc/rrqnet/keys/example.key + rrqnet_options -B 10 -T 1 + rrqnet_dhcp dhclient diff --git a/interfaces-template-3 b/interfaces-template-3 new file mode 100644 index 0000000..f544a99 --- /dev/null +++ b/interfaces-template-3 @@ -0,0 +1,35 @@ +# Virtual cable with uplinks to example host at 10.0.0.1:2 and [fe::1]:2, +# and downlink ranges 10.1.0.0/16 (any port) and [fe::1:0:0/96]:3 +# +# + creates a local tap named "example" with tunneling MTU (1450) +# + uses UDP port 3 for this cable end +# + reniced service daemon +# + single-v logging to /var/log/rrqnet-example.log +# + cable PSK /etc/rrqnet/keys/example[1-4].key (not included) +# + 10 packet buffers and a single dispatch thread +# + using static IPv4 assignment +# +# This template includes an extension block to manage a dnsmasq instance +# for serving dhcp (only). Usage: +# ifup exampe=dnsmasq +# ifdown exampe=dnsmasq + +auto example +iface example inet manual + mtu 1450 + address 192.168.222.2/24 + rrqnet_port 3 + rrqnet_nice -3 + rrqnet_log -v /var/log/rrqnet-example.log + rrqnet_remote 10.0.0.1:2=/etc/rrqnet/keys/example1.key + rrqnet_remote [fe::1]:2=/etc/rrqnet/keys/example2.key + rrqnet_remote 10.1.0.0/16=/etc/rrqnet/keys/example3.key + rrqnet_remote [fe::1:0:0/96]:3=/etc/rrqnet/keys/example4.key + rrqnet_options -B 10 -T 1 + +iface dnsmasq inherits example + up /usr/sbin/dnsmasq -i example -a 192.168.222.2 -I lo -I wlan0 -I eth0 \ + -p 0 -K -D -N -b --dhcp-sequential-ip \ + -F 192.168.222.100,192.168.222.200,255.255.255.0,192.168.222.255 \ + --dhcp-hostsfile=/etc/network/example.dhcphosts + down pkill -f 'dnsmasq -i example' -- 2.39.2