@@ -473,6 +473,15 @@ func (n *bridge) Validate(config map[string]string, clientType request.ClientTyp
473473 // shortdesc: Comma-separated list of IPv6 ranges to use for DHCP (FIRST-LAST format)
474474 "ipv6.dhcp.ranges" : validate .Optional (validate .IsListOf (validate .IsNetworkRangeV6 )),
475475
476+ // gendoc:generate(entity=network_bridge, group=common, key=ipv6.ra)
477+ //
478+ // ---
479+ // type: bool
480+ // condition: IPv6 address
481+ // default: `true`
482+ // shortdesc: Whether to send IPv6 router advertisements
483+ "ipv6.ra" : validate .Optional (validate .IsBool ),
484+
476485 // gendoc:generate(entity=network_bridge, group=common, key=ipv6.routes)
477486 //
478487 // ---
@@ -1624,7 +1633,11 @@ func (n *bridge) setup(oldConfig map[string]string) error {
16241633 }
16251634
16261635 // Update the dnsmasq config.
1627- dnsmasqCmd = append (dnsmasqCmd , []string {fmt .Sprintf ("--listen-address=%s" , ipAddress .String ()), "--enable-ra" }... )
1636+ dnsmasqCmd = append (dnsmasqCmd , fmt .Sprintf ("--listen-address=%s" , ipAddress .String ()))
1637+ if util .IsTrueOrEmpty (n .config ["ipv6.ra" ]) {
1638+ dnsmasqCmd = append (dnsmasqCmd , "--enable-ra" )
1639+ }
1640+
16281641 if n .DHCPv6Subnet () != nil {
16291642 if n .hasIPv6Firewall () {
16301643 fwOpts .FeaturesV6 .ICMPDHCPDNSAccess = true
@@ -1649,10 +1662,10 @@ func (n *bridge) setup(oldConfig map[string]string) error {
16491662 } else {
16501663 dnsmasqCmd = append (dnsmasqCmd , []string {"--dhcp-range" , fmt .Sprintf ("%s,%s,%d,%s" , dhcpalloc .GetIP (subnet , 2 ), dhcpalloc .GetIP (subnet , - 1 ), subnetSize , expiry )}... )
16511664 }
1652- } else {
1665+ } else if util . IsTrueOrEmpty ( n . config [ "ipv6.ra" ]) {
16531666 dnsmasqCmd = append (dnsmasqCmd , []string {"--dhcp-range" , fmt .Sprintf ("::,constructor:%s,ra-stateless,ra-names" , n .name )}... )
16541667 }
1655- } else {
1668+ } else if util . IsTrueOrEmpty ( n . config [ "ipv6.ra" ]) {
16561669 dnsmasqCmd = append (dnsmasqCmd , []string {"--dhcp-range" , fmt .Sprintf ("::,constructor:%s,ra-only" , n .name )}... )
16571670 }
16581671
0 commit comments