diff options
author | PÁLI Gábor János <pali.gabor@gmail.com> | 2023-09-04 03:41:39 +0200 |
---|---|---|
committer | PÁLI Gábor János <pali.gabor@gmail.com> | 2023-09-26 11:53:45 +0200 |
commit | f84e6eb88ad194dcfbff23e4df1e4ad55b99fc24 (patch) | |
tree | b40502b998d664bb133bc416d9d926a34ffd07f4 | |
parent | 513595d09f7a15e3541a4f11bc29a3d6529188d8 (diff) | |
download | freebsd-wifibox-alpine-f84e6eb88ad194dcfbff23e4df1e4ad55b99fc24.zip |
etc: add configuration file samples for IPv6
7 files changed, 188 insertions, 0 deletions
diff --git a/etc/optional/ipv6/hostapd/appliance/interfaces.conf.sample b/etc/optional/ipv6/hostapd/appliance/interfaces.conf.sample new file mode 100644 index 0000000..a10a337 --- /dev/null +++ b/etc/optional/ipv6/hostapd/appliance/interfaces.conf.sample @@ -0,0 +1,63 @@ +# This is an iface stanza for interfaces(5) with relatively sane +# defaults. Consult http://manpages.org/etc-network-interfaces/5 for +# more. +# +# The `eth0` networking interface represents the virtual Ethernet card +# of the guest, which is shared with the host. The `gateway` IP +# address should match with the address as it was configured on the +# host, and `address` is the guest's own address. In addition to +# this, it is recommended to setup a Network Address Translation (NAT) +# on the host between `wifibox0` and the interface that faces towards +# the Internet. This can be done with the help of pf(4) for example. +# Here is sample configuration, see pf.conf(5) for more information. +# +# wlan_if="wifibox0" +# lan_if="em0" +# virt_net="10.0.0.0/24" +# +# scrub all +# nat on $lan_if from $virt_net to any -> $lan_if +# pass log all +# +# Change these values as desired, they are here only for inspiration. +# Note that configuring the NAT requires the IP packet forwarding to +# be enabled as well. This could be done for example by adding +# `gateway_enable="YES"` to rc.conf(5) along with `pf_enable="YES"`. +# +# gateway_enable="YES" +# pf_enable="YES" +# +# The gateway address on the host should be brought up by assigning an +# IP address for the `wifibox0` network interface. For example, +# adding the following line to rc.conf(5) will implement this. +# +# ifconfig_wifibox0="inet 10.0.0.1/24" +# +# The specified address could be then set for `gateway` at the +# definition of `eth0`. + +iface eth0 inet static + gateway 10.0.0.1 + address 10.0.0.2/24 + +# This is the static IPv6 address for `eth0`. It is important that it +# should be on the same network as it was configured for the +# ifconfig(8) parameters of the `wifibox0` interface on the host. + +iface eth0 inet6 static + address fd00::ffff/64 + +# The `wlan0` networking interface is associated with the wireless +# networking card as it is exposed by the driver. By this default +# configuration, the corresponding IP address is statically set to +# make it the gateway for the wireless network, see the contents of +# udhcpd.conf for the rest. + +iface wlan0 inet static + address 192.168.0.1/24 + +# This is the corresponding static IPv6 address for `wlan0`, which +# could be changed as needed. + +iface wlan0 inet6 static + address fd01::1/64 diff --git a/etc/optional/ipv6/hostapd/appliance/ip6tables.sample b/etc/optional/ipv6/hostapd/appliance/ip6tables.sample new file mode 100644 index 0000000..a2dd906 --- /dev/null +++ b/etc/optional/ipv6/hostapd/appliance/ip6tables.sample @@ -0,0 +1,23 @@ +# This file contains exported IP Tables data that can be read by the +# ip6tables-restore(8) utility. It is not meant to be edited by hand +# but regenerated by the ip6tables-save(8) utility after the necessary +# changes were made via the respective ip6tables(8) commands. +# +# The IP Tables stored here implement a simplistic IP forwarding and +# NAT between `wlan0` (wireless networking) and `eth0` (virtual +# Ethernet, facing towards the host) interfaces. + +*filter +:INPUT ACCEPT [0:0] +:FORWARD ACCEPT [0:0] +:OUTPUT ACCEPT [0:0] +[0:0] -A FORWARD -i wlan0 -o eth0 -m state --state RELATED,ESTABLISHED -j ACCEPT +[0:0] -A FORWARD -i wlan0 -o eth0 -j ACCEPT +COMMIT +*nat +:PREROUTING ACCEPT [0:0] +:INPUT ACCEPT [0:0] +:OUTPUT ACCEPT [0:0] +:POSTROUTING ACCEPT [0:0] +[0:0] -A POSTROUTING -o eth0 -j MASQUERADE +COMMIT diff --git a/etc/optional/ipv6/hostapd/appliance/radvd.conf.sample b/etc/optional/ipv6/hostapd/appliance/radvd.conf.sample new file mode 100644 index 0000000..e9a44b2 --- /dev/null +++ b/etc/optional/ipv6/hostapd/appliance/radvd.conf.sample @@ -0,0 +1,20 @@ +# This is the radvd(8) configuration file, which is the IPv6 Router +# Advertisement Daemon. It listens to router solicitations and sends +# router advertisements as described in "Neighbor Discovery for IP +# Version 6 (IPv6)" (RFC 4861). See https://manpages.org/radvdconf/5 +# for more information on the details. + +interface wlan0 +{ + AdvSendAdvert on; + AdvManagedFlag on; + prefix ::/64 + { + AdvOnLink on; + AdvAutonomous on; + AdvRouterAddr on; + }; + + RDNSS 2001:4860:4860::8888 2001:4860:4860::8844 { + }; +}; diff --git a/etc/optional/ipv6/wpa_supplicant/appliance/dhcpcd.conf.sample b/etc/optional/ipv6/wpa_supplicant/appliance/dhcpcd.conf.sample new file mode 100644 index 0000000..a397c3a --- /dev/null +++ b/etc/optional/ipv6/wpa_supplicant/appliance/dhcpcd.conf.sample @@ -0,0 +1,10 @@ +# This is the configuration file for dhcpcd(8), an RFC-2131-compliant +# DHCP client. This program is to automatically configure the +# wireless interface for working with both IPv4 an IPv6. Consult +# https://manpages.org/dhcpcdconf/5 for more. + +duid +noipv6rs + +interface wlan0 + ipv6rs diff --git a/etc/optional/ipv6/wpa_supplicant/appliance/interfaces.conf.sample b/etc/optional/ipv6/wpa_supplicant/appliance/interfaces.conf.sample new file mode 100644 index 0000000..d4b44a7 --- /dev/null +++ b/etc/optional/ipv6/wpa_supplicant/appliance/interfaces.conf.sample @@ -0,0 +1,25 @@ +# This is an iface stanza for interfaces(5) with relatively sane +# defaults. Consult http://manpages.org/etc-network-interfaces/5 for +# more. +# +# The `eth0` networking interface represents the virtual Ethernet card +# of the guest, which would be the default gateway for the host. +# Change these values only if the 10.0.0.0/24 IPv4 network is not +# suitable. + +iface eth0 inet static + address 10.0.0.1 + netmask 255.255.255.0 + +# This is the default IPv6 address and prefix for `eth0`. Change this +# value only if the fd00::/64 IPv6 network is not suitable. + +iface eth0 inet6 static + address fd00::ffff/64 + +# The `wlan0` networking interface is associated with the wireless +# networking card as it is exposed by the driver. By this default +# configuration, the corresponding IP address is obtained through the +# use of DHCP. This should just work for most of the cases. + +iface wlan0 dhcp diff --git a/etc/optional/ipv6/wpa_supplicant/appliance/ip6tables.sample b/etc/optional/ipv6/wpa_supplicant/appliance/ip6tables.sample new file mode 100644 index 0000000..42d881f --- /dev/null +++ b/etc/optional/ipv6/wpa_supplicant/appliance/ip6tables.sample @@ -0,0 +1,23 @@ +# This file contains exported IP Tables data that can be read by the +# ip6tables-restore(8) utility. It is not meant to be edited by hand +# but regenerated by the ip6tables-save(8) utility after the necessary +# changes were made via the respective ip6tables(8) commands. +# +# The IP Tables stored here implement a simplistic IP forwarding and +# NAT between the `eth0` (virtual Ethernet, facing towards the host) +# and `wlan0` (wireless networking) interfaces. + +*filter +:INPUT ACCEPT [0:0] +:OUTPUT ACCEPT [0:0] +:FORWARD ACCEPT [0:0] +[0:0] -A FORWARD -i eth0 -o wlan0 -m state --state RELATED,ESTABLISHED -j ACCEPT +[0:0] -A FORWARD -i eth0 -o wlan0 -j ACCEPT +COMMIT +*nat +:INPUT ACCEPT [0:0] +:OUTPUT ACCEPT [0:0] +:PREROUTING ACCEPT [0:0] +:POSTROUTING ACCEPT [0:0] +[0:0] -A POSTROUTING -o wlan0 -j MASQUERADE +COMMIT diff --git a/etc/optional/ipv6/wpa_supplicant/appliance/radvd.conf.sample b/etc/optional/ipv6/wpa_supplicant/appliance/radvd.conf.sample new file mode 100644 index 0000000..36dd04e --- /dev/null +++ b/etc/optional/ipv6/wpa_supplicant/appliance/radvd.conf.sample @@ -0,0 +1,24 @@ +# This is the radvd(8) configuration file, which is the IPv6 Router +# Advertisement Daemon. It listens to router solicitations and sends +# router advertisements as described in "Neighbor Discovery for IP +# Version 6 (IPv6)" (RFC 4861). See https://manpages.org/radvdconf/5 +# for more information on the details. +# +# At the RDNSS section, the `%%DNS%%` variable would be replaced with +# the IPv6 address of the DNS servers as provided by the wireless +# network (wifibox extension). + +interface eth0 +{ + AdvSendAdvert on; + AdvManagedFlag on; + prefix ::/64 + { + AdvOnLink on; + AdvAutonomous on; + AdvRouterAddr on; + }; + + RDNSS %%DNS%% 2001:4860:4860::8888 2001:4860:4860::8844 { + }; +}; |