summaryrefslogtreecommitdiffstats
path: root/etc/network.subr
Commit message (Collapse)AuthorAgeFilesLines
* Do not attempt to load the kernel module when checking if an interface exists.thompsa2007-05-231-1/+1
| | | | | | | This would cause pseudo network modules to be reloaded again when trying to unload the first time if any cloned interfaces exist. MFC after: 2 weeks
* Back out network.subr :- fix and comment out dhc*_fxp0 examples insteadache2007-03-291-1/+1
| | | | Submitted by: jhb
* Fix get_if_var() with 3 args (i.e. with default)ache2007-03-291-1/+1
| | | | | | | | | | | | | All xxx_<ifname> flags are set to empty strings automatically earlier so eval echo \${${prefix}${_if}${suffix}-${_default}} not substitute the default but return just the empty string. Fix it using eval echo \${${prefix}${_if}${suffix}:-${_default}} (i.e. treat empty strings as unset) The bug manifistates itself with the following warning from checkyesno(): /etc/rc.d/dhclient: WARNING: $background_dhclient is not set properly - see rc.conf(5)
* Add support for EtherChannel configuration to rc startup scripts.flz2007-02-091-10/+73
| | | | | | | | | | Note: This also deprecates "NO" as a way to specify an empty list of interfaces for gif_interfaces. PR: conf/104884 Submitted by: nork Harassed by: brd Discussed with: brooks, dougb
* Do not try to rtsol on pflog or pfsync devices.mlaier2006-10-291-1/+1
|
* Restore the behavior that net.inet6.ip6.auto_linklocal=0 couldume2006-10-071-4/+0
| | | | | | be coexist with ipv6_enable="YES". MFC after: 3 days
* Turn off automatic link local address if ipv6_enable is not set to YESgnn2006-10-021-0/+4
| | | | | | | in rc.conf Reviewed by: KAME core team, cperciva MFC after: 3 days
* Introduce a new method ipv6if which attemptes to figure out if anbrooks2006-09-211-0/+24
| | | | | | | | | | | | | | interface is an IPv6 interface. Use this method to decide if we should attempt to configure an interface with an IPv6 address in pccard_ether. The mechanism pccard_ether uses to do this is unsuited to the task because it assumes the list of interfaces it is passed is the full list of IPv6 interfaces and makes decissions based on that. This is at least a step in the right direction and is probably about as much as we can MFC safely. PR: conf/103428 MFC after: 3 days
* Introduce a new function, ifexists and use it to avoid attempting tobrooks2006-08-171-26/+41
| | | | | | | | touch interfaces that don't actually exist in the stop case. In the process move some IPv4 specific code from ifconfig_down to ipv4_down. This should solve problems with ifconfig: error messages on boot when interfaces are renamed.
* Spell synchronous with required silent 'h'.brooks2006-04-131-1/+1
| | | | | Reported by: ru, ceri Pointy hat: brooks
* Add missing _ to $_punct.brooks2006-04-131-1/+1
| | | | Submitted by: Dmitry Pryanishnikov <dmitry at atlantis.dp.ua>
* Commit the various network interface configutation updates I've beenbrooks2006-04-131-22/+79
| | | | | | | | | | | | | | | | working on. 1) Make it possible to configure interfaces with certain characters in their names that aren't valid in shell variables. Currently supported characters are ".-/+". They are converted into '_' characters. 2) Replace nearly all eval statements in network.subr with a new function get_if_var which substitues an interface name (after the translations above) for "IF" in a variable name. 3) Fix list_net_interfaces() in the nodhcp case. 4) Allow the administrator to specify if dhclient should be started when /etc/rc.d/netif configures the interface or only by devd. This can be set on both a per interface and system wide basis. PR: conf/88974 [1,2], conf/92433 [1,2]
* Add a new configuration variable, ipv4_addrs_<ifn>, which adds one orbrooks2005-11-141-0/+58
| | | | | | | | | | | more IPv4 address from a ranged list in CIRD notation: ipv4_addrs_ed0="192.168.0.1/24 192.168.1.1-5/28" In the process move alias processing into new ipv4_up/down functions to more toward a less IPv4 centric world. Submitted by: Philipp Wuensche <cryx dash freebsd at h3q dot com>
* - Alwasy explicitly bring the interface up before configuring it.brooks2005-09-021-7/+17
| | | | | | | | - If an interface's ifconfig_<ifn> is set, but empty, don't set it to ifconfig_DEFAULT. This way interfaces can be disabled even in the presence of ifconfig_DEFAULT. - When listing interfaces and network_interfaces=auto, place lo0 first if it's around.
* Support ifconfig_<ifn> variables containing quoted variables with spacesbrooks2005-08-261-1/+1
| | | | | | | | in them by wrapping the ifconfig command with eval "...". For example, this allows: ifconfig_iwi0="DHCP ssid 'foo bar baz'"
* - Remove the removable_interfaces variable. /etc/pccard_ether willbrooks2005-08-241-2/+27
| | | | | | | | | | | | now run on any interface. - Add a new ifconfig_<ifn> keyword, NOAUTO which prevents configuration of an interface at boot or via /etc/pccard_ether. This allows /etc/rc.d/netif to be used to start and stop an interface on a purely manual basis. The decision to affect pccard_ether may be revisited at a later date. Requested by: imp, gallatin (removable_interfaces) Discussed with: sam, Randy Bush (NOAUTO)
* - Remove the pccard_ifconfig variable in favor of a newbrooks2005-06-301-34/+7
| | | | | | | | | | | | | ifconfig_DEFAULT variable. Unlike pccard_ifconfig, ifconfig_DEFAULT applies to all interfaces that do not specify an ifconfig_<ifn> variable rather than just those listed in removable_interfaces. - Correct the list of interfaces when network_interfaces and removable_interfaces are both set by including removable_interfaces in the list of canidates. - When listing dhcp interfaces, include those with other ifconfig options so nat works. Approved by: re (network interface startup blanket)
* Add support for starting wpa_supplicant by adding the WPA keyword to anbrooks2005-06-301-2/+2
| | | | | | interface's ifconfig_<ifn> entry in /etc/rc.conf. Approved by: re (network interface startup blanket)
* Fix return values of ifconfig_up/down.brooks2005-06-071-4/+5
| | | | Reported by: Andrea Campi
* Support code for the OpenBSD dhclient. This significantly changes thebrooks2005-06-071-4/+107
| | | | | | | | | | | | | | | | | | way interfaces are configured. Some key points: - At startup, all interfaces are configured through /etc/rc.d/netif. - ifconfig_<if> variables my now mix real ifconfig commands the with DHCP and WPA directives. For example, this allows media configuration prior to running dhclient. - /etc/rc.d/dhclient is not run at startup except by netif to start dhclient on specific interfaces. - /etc/pccard_ether calls "/etc/rc.d/netif start <if>" to do most of it's work. - /etc/pccard_ether no longer takes additional arguments to pass to ifconfig. Instead, ifconfig_<if> variables are now honored in favor of pccard_ifconfig when available. - /etc/pccard_ether will only run on interfaces specified in removable_interfaces, even if pccard_ifconfig is set.
* 'all' argument for list_net_interfaces() is now unused, remove it.pjd2004-12-051-4/+0
|
* Use "ifconfig -l" instead of "list_network_interfaces all" inrse2004-12-051-1/+1
| | | | | | | | | | | | ifnet_rename() to support situations where rc.conf's $network_interfaces variable is set to an explicit list of network interfaces (instead of the default "auto"). Using "list_network_interfaces all" resulted in using $network_interfaces for both interface _renaming_ and interface _configuration_ which obviously cannot work either before (if the new name is in $network_interfaces) or after (if the old name is in $network_interfaces) renaming the interface.
* fix typo: s/intefraces/interfaces/rse2004-12-051-1/+1
|
* Allow to change interfaces name on boot time.pjd2004-10-301-0/+21
| | | | | | | | | Now, one should be able to put something like this into /etc/rc.conf: ifconfig_fxp0_name="net0" ifconfig_net0="inet 10.0.0.1/16" Reviewed by: green
* Avoid double appearing of cloned interfaces in the outputyar2004-08-281-3/+4
| | | | | | | | | | | | | | | from list_net_interfaces() when network_interfaces=auto. Rationale: Since the auto case is special, the lesser evil had to be chosen among not adding cloned interfaces to _tmplist or removing duplicates from _tmplist after adding cloned interfaces. Since list_net_interfaces() must not use /usr/bin tools, the former "evil" appeared clearer and much more efficient. (See the PR audit trail for discussion.) PR: conf/63700 Reviewed by: brooks MFC after: 5 days
* Fix a typo in a variable name.yar2004-08-271-1/+1
|
* Removed whitespace at BOF, EOL & EOF.schweikh2004-06-061-1/+1
|
* Improve the handling dhcp handling of pccard_ether.mbr2003-08-111-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | There are now many configurations which have a NIC on board, and pccard slots. If a dhclient is running on the internal nic, the Improve the handling dhcp handling of pccard_ether. Improve the dhcp handling of pccard_ether. There are now many configurations which have a NIC on board and Improve the dhcp handling of pccard_ether. There are now many configurations which have a NIC on board and cardbus slots too. If a dhclient was already running on the internal NIC, the user was forced to kill a running dhclient manually. If now a pccard is included at startup time, /etc/rc.d/dhclient start does include it into the startup list for dhcp devices. That means you can now do dhcp on the internal and the pccard devices at the same time. If the card is plugged in later, a running dhclient (working for the internal interface only) is killed, and restarted, but the interface name of the new pccard is added to the internal name. After removal, /etc/rc.d/dhclient is started again. This script does nothing if there are no devices in /etc/rc.conf This is only a workaround for a well known problem. After we have a dhcp client which handles device adding and removal, it will go away.
* add rtsol_flags.ume2003-08-081-1/+1
| | | | MFC after: 1 week
* Check by [ $? -eq 0 ] rather than $?.kuriyama2003-06-241-2/+2
| | | | Reviewed by: mtm
* o Fix a typomtm2003-06-091-3/+23
| | | | | | o Fill in the ipx_down() routine. Submitted by: ceri
* - Remove a debugging echo.mtm2003-06-081-1/+3
| | | | | - When we change the IFS make sure to return it to its previous value before executing a command.
* Implement *_down network routines for ifconfig'ed interfaces, clonedmtm2003-06-081-0/+75
| | | | | | interfaces, interface aliases, user supplied ifconfig scripts, and ipx interfaces. The ipx routine fails unconditionaly at the moment. Someone who has a need for it can fill it in with the appropriate incantations.
* pccard_ether didn't setup IPv6 after rcTOS sweep.ume2003-05-121-0/+296
| | | | | Reviewed by: mtm and dougb Approved by: re (scott)
* Break out and rewrite the network setup scripts.mtm2003-04-181-171/+159
| | | | | | | | | | | | | | o /etc/network.subr contains common subroutines used for seting up network interfaces o rc.d/hostname sets the hostname if not already set o rc.d/nisdomain sets the nis domain *after* rpcbind but before the yp* daemons. This fixes issues with temporary hangs when looking up informaion in nis before it's ready. o rc.d/netif brings network interfaces (minus dhcp) up. o rc.d/network1 has been disabled and will be retired before RELENG_5. It will be replaced by rc.d/netif Approved by: markm (mentor)
* Back out 1.143 and 1.144. They are no longer needed now that we startimp2003-02-121-6/+0
| | | | | | devd later in the boot process. This should fix all the problems people have had with those commits. Diskless should be working again, and those that mount /usr with nfs should be able to do that again too.
* o Don't consider LOOPBACK devices as configured...imp2002-12-131-1/+2
|
* o redirect the grep to /dev/nullimp2002-12-121-0/+5
| | | | | | | o use ifn rather than interface in rc.network o merge into rc.d/network1 Approved by: (re blanket)
* Fix style bugs:schweikh2002-10-121-40/+40
| | | | | | | | | | * Space -> tabs conversion. * Removed blanks before semicolon in "if ... ; then". * Proper indentation of misindented lines. * Put a full stop after some comments. * Removed whitespace at end of line. Approved by: silence from gordon
* up gif during setup.ume2002-09-201-0/+1
|
* Correct commentgordon2002-08-091-1/+1
| | | | Submitted by: Mike Makonnen <makonnen@pacbell.net>
* Remove spurious "echo '.'".dd2002-07-181-2/+0
|
* Make nisdomainname=NO DTRTdougb2002-07-181-2/+6
| | | | Submitted by: des, via Mike Makonnen <makonnen@pacbell.net>
* Cleanup some pollution from the NetBSD sync, and add gif setup.dougb2002-07-181-144/+29
| | | | Submitted by: Mike Makonnen <makonnen@pacbell.net>
* Fix a typo that caused dhclient not to work.gordon2002-07-181-2/+2
| | | | | Submitted by: Dennis Kristensen <snicki@snicki.dk> Reviewed by: Mike Makonnen <makonnen@pacbell.net>
* Merge in all the changes that Mike Makonnen has been maintaining for agordon2002-07-181-827/+196
| | | | | | | | while. This is only the script pieces, the glue for the build comes next. Submitted by: Mike Makonnen <makonnen@pacbell.net> Reviewed by: silence on -current and -hackers Prodded by: rwatson
* Cosmetic changes to the previous commit, bringing it closer to what Ides2002-04-111-7/+7
| | | | already had in my tree but didn't want to commit.
* Since sshd expects /etc/ssh/ssh_host_rsa_key to exist, we had betterpeter2002-04-101-4/+9
| | | | | create it. Also specify protocol v1/v2 in case people wonder why we generate two RSA keys.
* The good news is that my initial PR was correct... the bad news is that Idougb2002-04-011-1/+5
| | | | | | | | | was apparently smoking something when I committed the last fix, because as ume was kindly enough to set me straight on, amd *will* start with no arguments at all, as long as there is an /etc/amd.conf file for it to read. What it won't do is start with *just* -p. In any case, now it's fixed.
* Don't try to generate ssh keys if ssh isn't installed.des2002-03-191-7/+11
|
OpenPOWER on IntegriCloud