summaryrefslogtreecommitdiffstats
path: root/etc/network.subr
Commit message (Collapse)AuthorAgeFilesLines
* Fix an issue when ipv6_enable=YES && ipv6_gateway_enable=YES which couldhrs2012-10-271-1/+5
| | | | | | | prevent rtadvd(8) from working as intended. Spotted by: brian Discussed with: brian
* Fix several glitches in IPv6-related knobs:hrs2012-01-221-6/+18
| | | | | | | | | | | | | | - ipv6_enable + ipv6_gateway_enable should unset ACCEPT_RTADV by default for backward compatibility. - Configurations in ipv6_prefix_IF should be recognized even if there is no ifconfig_IF_ipv6. - DAD wait should be performed at once, not on a per-interface basis, if possible. This fixes an issue that a system with a lot of IPv6-capable interfaces takes too long for booting. MFC after: 1 week
* Spelling fixes for etc/uqs2012-01-071-1/+1
|
* Add compatibility support for specifing IPv4 aliases inglebius2011-12-131-0/+7
| | | | | | rc.conf without the "inet" keyword. Obtained from: hrs
* Add support for removing addresses added by ipv6_prefix_hostid_addr_up()hrs2011-10-231-7/+10
| | | | upon rc.d/netif stop.
* Fix an issue that 127/8 is not configured when $ifconfig_DEFAULT is not empty.hrs2011-10-231-1/+1
| | | | Spotted by: ume
* Test if the interface is afif in dhcpif() and syncdhcpif(), asdelphij2011-09-281-0/+8
| | | | | | | done in ipv6_autoconfif. Reviewed by: hrs (freebsd-rc@) MFC after: 1 week
* Minor spelling, wording and punctuation fixes in comments.brueffer2011-09-141-6/+6
| | | | | | | PR: 155984 Submitted by: gcooper Approved by: re (kib) MFC after: 1 week
* - Add an warning when ifconfig_IF_ipv6 has no inet6 keyword in fronthrs2011-09-131-2/+10
| | | | | | | | of an IPv6 address. (r225489) - Use eval for ${ifconfig_args} to fix an issue fixed in r223506. (r225489) Approved by: re (bz)
* Add $ipv6_cpe_wanif to enable functionality required for IPv6 CPEhrs2011-09-131-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | (r225485). When setting an interface name to it, the following configurations will be enabled: 1. "no_radr" is set to all IPv6 interfaces automatically. 2. "-no_radr accept_rtadv" will be set only for $ipv6_cpe_wanif. This is done just before evaluating $ifconfig_IF_ipv6 in the rc.d scripts (this means you can manually supersede this configuration if necessary). 3. The node will add RA-sending routers to the default router list even if net.inet6.ip6.forwarding=1. This mode is added to conform to RFC 6204 (a router which connects the end-user network to a service provider network). To enable packet forwarding, you still need to set ipv6_gateway_enable=YES. Note that accepting router entries into the default router list when packet forwarding capability and a routing daemon are enabled can result in messing up the routing table. To minimize such unexpected behaviors, "no_radr" is set on all interfaces but $ipv6_cpe_wanif. Approved by: re (bz)
* Add support for string values with white spaces for ifconfig(8)pluknet2011-06-241-1/+1
| | | | | | | | | | | | parameters accepting them (such as description, group). Changes discussed on freebsd-rc. PR: conf/156675 Reported by: "Alexander V. Chernikov" <melifaro att ipfw ru> Suggested by: hrs Analyzed with: Alexander V. Chernikov via IRC MFC after: 2 weeks
* Add a helper function to check kern.features.* sysctls.hrs2011-06-111-5/+2
| | | | Discussed with: dougb
* Do not mark lo0 as IFDISABLED even if there is no $ifconfig_lo0_ipv6 line.hrs2011-06-061-1/+1
|
* Remove "ifconfig IF inet6 -accept_rtadv" when ipv6_gateway_enable=YES becausehrs2011-06-061-16/+10
| | | | this is no longer needed.
* No logner set an IPv4 loopback address by default in defaults/rc.conf.bz2011-05-311-8/+20
| | | | | | | | | | | | | | | | | | If not specified, network.subr will add it automatically if we have INET support (1). In network.subr only call the address family up/down functions if the respective AF is available. Switch to new kern.features variables for inet and inet6 as the inet sysctl tree is also available for IPv6-only kernels leading to unexpected results. Suggested by: hrs (1) Reviewed by: hrs Sponsored by: The FreeBSD Foundation Sponsored by: iXsystems MFC after: 20 days
* network.subr: Use printf(1) builtin for hexprint function.jilles2011-05-141-26/+2
| | | | | | | | | Now that printf(1) is a shell builtin, there is no need to emulate it anymore. The external printf(1) is /usr/bin/printf and therefore may not be available in early boot. It may be faster to use printf directly but the function is useful for compatibility.
* Split $ipv6_prefer into $ip6addrctl_policy and $ipv6_activate_all_interfaces.hrs2010-09-131-1/+1
| | | | | | | | | | | | | | | | | | | The $ip6addrctl_policy is a variable to choose a pre-defined address selection policy set by ip6addrctl(8). The keyword "ipv4_prefer" sets IPv4-preferred one described in Section 10.3, the keyword "ipv6_prefer" sets IPv6-preferred one in Section 2.1 in RFC 3484, respectively. When "AUTO" is specified, it attempts to read /etc/ip6addrctl.conf first. If it is found, it reads and installs it as a policy table. If not, either of the two pre-defined policy tables is chosen automatically according to $ipv6_activate_all_interfaces. When $ipv6_activate_all_interfaces=NO, interfaces which have no corresponding $ifconfig_IF_ipv6 is marked as IFDISABLED for security reason. The default values are ip6addrctl_policy=AUTO and ipv6_activate_all_interfaces=NO. Discussed with: ume and bz
* Localize $_punct_c in get_if_var() and whitespace clean-ups.hrs2010-09-131-6/+6
| | | | Based on: changes in r206408 by dougb
* - Check some specific IFs first in ipv6_autoconfif().hrs2010-09-131-18/+15
| | | | | | - $ipv6_enable supports YES|TRUE|ON|1 as in checkyesno(). Based on: changes in r206408 by dougb
* Fix $ipv6_network_interfaces and set it as AUTO by default.hrs2010-09-131-22/+11
| | | | Based on: changes in r206408 by dougb
* Revert changes in r206408.hrs2010-09-131-85/+126
| | | | Discussed with: dougb, core.5, and core.6
* Prevent unloading a kld for a driver that has subinterfaces (vlan and/orjhb2010-05-171-9/+3
| | | | | | | | | | | | | | | | | wlan interfaces) from being automatically reloaded via devd shutdown event handlers. - Revert part of my previous changes to call ifn_stop on subinterfaces when an interface is detached. It is better to destroy the interfaces first so that an 'ifconfig foo0.blah down' doesn't result in ifconfig auto-loading if_foo.ko. The ifconfig command will not be invoked if foo0.blah is gone when ifn_stop() is called. Furthermore, it is not necessary to explicitly invoke ifn_stop() after the subinterface is destroyed as devd will already do that. - Pass -n to ifconfig when destroying interfaces so that destroying a cloned interface does not kldload any drivers. Reviewed by: dougb MFC after: 4 days
* Remove trailing white space. No functional changes.dougb2010-05-141-5/+5
|
* Make address assignment via ipv6_prefix_IF work againdougb2010-05-041-0/+2
|
* Improve the handling of IPv6 configuration in rc.d. The ipv6_enabledougb2010-04-091-121/+78
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | and ipv6_ifconfig_<interface> options have already been deprecated, these changes do not alter that. With these changes any value set for ipv6_enable will emit a warning. In order to avoid a POLA violation for the deprecation of the option ipv6_enable=NO will still disable configuration for all interfaces other than lo0. ipv6_enable=YES will not have any effect, but will emit an additional warning. Support and warnings for this option will be removed in FreeBSD 10.x. Consistent with the current code, in order for IPv6 to be configured on an interface (other than lo0) an ifconfig_<interface>_ipv6 option will have to be added to /etc/rc.conf[.local]. 1. Clean up and minor optimizations for the following functions: ifconfig_up (the ipv6 elements) ipv6if ipv6_autoconfif get_if_var _ifconfig_getargs The cleanups generally were to move the "easy" tests earlier in the functions, and consolidate duplicate code. 2. Stop overloading ipv6_prefer with the ability to disable IPv6 configuration. 3. Remove noafif() which was only ever called from ipv6_autoconfif. Instead, simplify and integrate the tests into that function, and convert the test to use is_wired_interface() instead of listing wireless interfaces explicitly. 4. Integrate backwards compatibility for ipv6_ifconfig_<interface> into _ifconfig_getargs. This dramatically simplifies the code in all of the callers, and avoids a lot of other code duplication. 5. In rc.d/netoptions, add code for an ipv6_privacy option to use RFC 4193 style pseudo-random addresses (this is what windows does by default, FYI). 6. Add support for the [NO]RTADV options in ifconfig_getargs() and ipv6_autoconfif(). In the latter, include support for the explicit addition of [-]accept_rtadv in ifconfig_<interface>_ipv6 as is done in the current code. 7. In rc.d/netif add a warning if $ipv6_enable is set, and remove the set_rcvar_obsolete for it. Also remove the latter from rc.d/ip6addrctl. 8. In /etc/defaults/rc.conf: Add an example for RTADV configuration. Set ipv6_network_interfaces to AUTO. Switch ipv6_prefer to YES. If ipv6_enable is not set this will have no effect. Add a default for ipv6_privacy (NO). 9. Document all of this in rc.conf.5.
* Add rc.d script for the rtsold(8) daemon.ume2010-02-031-1/+3
| | | | | | | | | | The rtsol(8) handles just one RA then exit. So, the OtherConfig flag may not be handled well by rtsol(8) in the environment where there are multiple RA servers on the segment. In such case, rtsold(8) will be your friend. Reviewed by: hrs MFC after: 2 weeks
* Remove a trailing reference to the obsolete vaps_<IF> variable.jhb2009-12-291-1/+1
| | | | | Reviewed by: brooks MFC after: 3 days
* Add support for configuring vlan(4) interfaces as child devices similar tojhb2009-12-291-2/+48
| | | | | | | | | | | | | | wlan(4) interfaces. vlan(4) interfaces are listed via a new 'vlans_<IF>' variable. If a vlan interface is a number, then that number is treated as the vlan tag for the interface and the interface will be named '<IF>.<tag>'. Otherwise, the vlan tag must be provided via a vlan parameter in a 'create_args_<vlan>' variable. While I'm here, fix a few nits in rc.conf(5) and mention create_args_<IF> in the description of cloned_interfaces. Reviewed by: brooks MFC after: 2 weeks
* - Add AF_IPX and AF_NATM to afexists().hrs2009-10-021-0/+10
| | | | | | - Add afexists() check to address family specific rc.d scripts. A script for an AF will be silently ignored if the kernel has no support for the AF.
* Fix several logic bugs in the previous IPv6 variable change andhrs2009-09-261-12/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | re-add $ipv6_enable support for backward compatibility. From UPDATING: 1. To use IPv6, simply define $ifconfig_IF_ipv6 like $ifconfig_IF for IPv4. For aliases, $ifconfig_IF_aliasN should be used. Note that both variables need the "inet6" keyword at the head. Do not set $ipv6_network_interfaces manually if you do not understand what you are doing. It is not needed in most cases. $ipv6_ifconfig_IF and $ipv6_ifconfig_IF_aliasN still work, but they are obsolete. 2. $ipv6_enable is obsolete. Use $ipv6_prefer and/or "inet6 accept_rtadv" keyword in ifconfig(8) instead. If you define $ipv6_enable=YES, it means $ipv6_prefer=YES and all configured interfaces have "inet6 accept_rtadv" in the $ifconfig_IF_ipv6. These are for backward compatibility. 3. A new variable $ipv6_prefer has been added. If NO, IPv6 functionality of interfaces with no corresponding $ifconfig_IF_ipv6 is disabled by using "inet6 ifdisabled" flag, and the default address selection policy of ip6addrctl(8) is the IPv4-preferred one (see rc.d/ip6addrctl for more details). Note that if you want to configure IPv6 functionality on the disabled interfaces after boot, first you need to clear the flag by using ifconfig(8) like: ifconfig em0 inet6 -ifdisabled If YES, the default address selection policy is set as IPv6-preferred. The default value of $ipv6_prefer is NO. 4. If your system need to receive Router Advertisement messages, define "inet6 accept_rtadv" in $ifconfig_IF_ipv6. The rc(8) scripts automatically invoke rtsol(8) when the interface becomes UP. The Router Advertisement messages are used for SLAAC (State-Less Address AutoConfiguration).
* Add missing comments and whitespace clean-ups.hrs2009-09-121-42/+64
|
* Integrate rc.d/network_ipv6 into rc.d/netif:hrs2009-09-121-325/+520
| | | | | | | | | | - Add rc.d/stf and rc.d/faith for stf(4) and faith(4). - Remove rc.d/auto_linklocal and rc.d/network_ipv6. - Move rc.d/sysctl to just before FILESYSTEMS because rc.d/netif depends on some sysctl variables. Reviewed by: brooks MFC after: 3 days
* In the loop through the list of interfaces in network6_interface_setup()dougb2009-08-271-2/+2
| | | | | | | | | | | rtsol_interface gets reset to "yes" each time through the loop, but rtsol_available does not. If a user has lo0 first in their list of interfaces rtsol_available will get set to "no" the first time through the loop and subsequent interfaces will not get rtsol'ed when they should. Therefore change the conditional for the is_wired() test to _interface. Noticed by: Dimitry Andric <dimitry@andric.com>
* Improve the case test to detect the presence of lo0 in the list ofdougb2009-08-241-1/+1
| | | | | | network_interfaces. Submitted by: Christoph Mallon <christoph.mallon@gmx.de>
* Prior to the dire warning about values of network_interfaces other thandougb2009-08-231-0/+7
| | | | | | AUTO the biggest mistake users made was leaving lo0 off the list. Since lo0 is effectively mandatory, check for it and add it to the list if it's not there.
* Move is_wired_interface() from rc.d/wpa_supplicant into network.subr,dougb2009-08-231-3/+19
| | | | | | | | | simplify it a bit, and make use of that method to determine if an interface is a candidate for IPv6 rtsol rather than listing all of the possible wireless interfaces that should _not_ get rtsol'ed. This change is only relevant for 8.0+ unless the "wlan mandatory" code gets ported back to RELENG_7.
* rtsol should not be run on the wireless NIC interfaces directly,dougb2009-06-261-0/+3
| | | | it will run on wlan0 instead.
* Eliminate the warning that "Values of network_interfaces other thandougb2009-06-011-4/+0
| | | | | | AUTO are deprecated.' There is no good reason to deprecate them, and setting this to different values can be useful for custom solutions and/or one-off configuration problems.
* Add support for setting the debug flags on wlan interfaces after the arebrooks2009-03-131-1/+9
| | | | created using wlandebug_<ifn> variables.
* Check for NOAUTO on child interfaces (eg wlanX) so they can be created viathompsa2009-02-041-1/+3
| | | | rc.conf but not necessarily started.
* Remove compat support for vaps_<ifn> and vap_create_<ifn> variables asbrooks2008-10-011-7/+1
| | | | | | promised in r178527. These variables were never in a release version. Reminded by: sam
* Implement a "quiet" mode for rc.d/netif, which only outputsmtm2008-06-231-8/+0
| | | | | | | | | the interface name of interfaces that were configured. This change has the added benefit that ifn_start() and ifn_stop() in network.subr no longer write to standard output. Whether to output and what to output is now handled entirely in rc.d/netif.
* Add a missing space between a variable and the ] for a testdougb2008-05-261-1/+1
|
* Change the default value of synchronous_dhclient to NO.brooks2008-05-151-0/+23
| | | | | | | | | To preserve the existing behavior of etc/rc.d/netif, add code to wait up to if_up_delay seconds (30 seconds by default) for a default route to be configured if there are any dhcp interfaces. This should be extended to test that the interface is actually up. X-MFC after:
* Fix last commit and call childif_destroy() correctly.brooks2008-05-151-1/+1
|
* Don't print the interface status if we only create child or destroybrooks2008-05-141-3/+3
| | | | | | interfaces. Correctly return status from childif_create().
* Emit a warning when the network_interfaces variable is not set to AUTO.brooks2008-04-301-0/+4
| | | | MFC after: 3 days
* Replace the prototype vaps_<ifn> and vap_create_<ifn> variables withbrooks2008-04-251-9/+16
| | | | | | | | | | | | | more wlans_<ifn> and create_args_<ifn> Add documentation for these variants and generally update the wireless device example. There is are very short lived shim from vaps_<ifn> which produces a warning and vap_create_<ifn> which does not. Misuse the MFC notification service to remind me to remove them. MFC after: 3 weeks
* rc support for vapssam2008-04-201-1/+89
|
* Support gif_interface values that don't follow the pattern gif###.brooks2008-03-281-9/+6
| | | | Remove ancient compatablity support for gif_interface="NO".
OpenPOWER on IntegriCloud