diff --git a/src/confd/bin/gen-interfaces b/src/confd/bin/gen-interfaces index b7c4c9a3..39137d1d 100755 --- a/src/confd/bin/gen-interfaces +++ b/src/confd/bin/gen-interfaces @@ -1,14 +1,15 @@ #!/bin/sh -# Generates ietf-intefaces + ietf-ip settings for all detected interfaces -# Interfaces must be of type Ethernet (copper/sfp), not be "internal" DSA -# ports, and must have a "parentbus", i.e., be physical ports. +# Generates ietf-intefaces + ietf-ip settings for all detected interfaces. # -# Usage: gen-interfaces [-4bd] +# Interfaces must be of type Ethernet (copper/sfp), not be "internal" +# DSA ports, and must have a "parentbus", i.e., be physical ports. # -# -b brN Bridged mode, set all interfaces as ports in brN -# -4 Generic option for both modes, enables ZeroConf IPv4 -# -d Generic option for both modes, enables DHCPv4 client +# The script mainly caters to two modes of operation: switch and router. +# There is also a mixed mode with limited usability. Other use-cases or +# combinations we recommend overriding this script in your br2-external +# rootfs overlay. # +### Router Mode (default) ############################################## # By default this script generates plain interfaces with IPv6 autoconfig # (EUI64) enabled. Useful both in a plain router and a Fail Secure mode # where any switchcore-backed ports should be prevented from switching. @@ -21,6 +22,14 @@ # can be used to enable IPv4 and DHCP on a single service interface if # needed. # +# Note: interfaces classified as ports, i.e., switchcore interfaces, or +# have been classified 'group port' by other means will by default +# *not* get an IPv6 address. This is by design, some may want to +# have port isolation and *no* IP communication by default. But, +# if you want IPv6 SLAAC on your port interfaces by default, add +# the -6 option to GEN_IFACE_OPTS in your /etc/confdrc.local +# +### Bridge Mode ######################################################## # The '-b brname' option triggers the bridge mode, creating a 'brname' # bridge interface using all interfaces classified in 'group port' by # the nameif script. In the bridge mode port interfaces do not have any @@ -28,6 +37,7 @@ # the '-4' option is set, ZeroConfig (169.254.x.y) is anabled on 'brN'. # If the '-d' option is set, a DHCPv4 client is enabled on 'brN'. # +### Mixed Mode ######################################################### # A "mixed mode" is also supported, where the system may have multiple # ports in a switchcore, but some Ethernet interfaces directly connected # to the SoC. In this case, if '-b brname' is given, all 'group port' @@ -38,8 +48,28 @@ set -e bridge= ipv4=false +ipv6=false dhcp= +usage() +{ + cat <