summaryrefslogtreecommitdiff
path: root/etc/netstart
AgeCommit message (Collapse)Author
2020-12-23Allow the provision of dhclient(8) options on 'dhcp' lines in hostname.if(5)Kenneth R Westerback
files. Usual man page help & ok jmc@
2020-12-21Avoid issuing pointless 'ifconfig <if> up' when processing 'dhcp' inKenneth R Westerback
hostname.if files. dhclient(8) does that itself. Part of the "further script optimizations" promised in r1.200 of netstart. Tested & ok gnezdo@
2020-11-29Fix previous: use correct version of netstart and installer bits.Theo Buehler
2020-11-29Add support for !command to mygate, so that netstart has a late opportunityTheo de Raadt
to perform network configuration (for example, "!route source -ifp em0") Split mygate and myname manual pages (how did anyone ever believe these are related), and perform hostname configuration much earlier in rc. discussed with benno, claudio, jmc, etc etc, last version of !command parser by tb
2020-11-08no more mobileip;Jason McIntyre
ok claudio deraadt
2020-06-21start wg with the other interfaces that rely on routing being up.David Gwynne
from Matt Dunwoodie and Jason A. Donenfeld ok deraadt@
2020-05-22Revert the following commit as it breaks hostname.if(5) lines with akn
backslash at the end for line continuation Breaking long lines into multiple ones must still be possible and does require to treat the backslash as an escape character. Breakage reported by Mark Patruck <mark at wrapped dot cx >, thanks! --- distrib/miniroot/install.sub revision 1.1151 etc/netstart revision 1.203 date: 2020/05/21 11:54:41; author: kn; state: Exp; lines: +2 -2; Do not treat backslashe as an escape character in hostname.if(5) lines ifstart() should always pass such lines unaltered, especially if they contain "nwid" or "description" lines with arbitrary strings. <bsdlisten at gmail dot com> reported SSIDs such as "Mike's" during installation end as broken; this was because the installer escaped the single quote using backslashes which ended up being treated as escape characters much later during hostname.if parsing in netstart(8). Ok deraadt
2020-05-21Fix stripcom() description wrt. comments not on their own linekn
Neither netstart's nor install.sub's (subtly different) implementations remove trailing comments on lines not starting as a comment, e.g., lines like "up #not down" go through unaltered and without "#not down" being removed. Only lines *beginning* with the comment sign ("#") are stripped. No functional change, just updating function descriptions.
2020-05-21Do not treat backslashe as an escape character in hostname.if(5) lineskn
ifstart() should always pass such lines unaltered, especially if they contain "nwid" or "description" lines with arbitrary strings. <bsdlisten at gmail dot com> reported SSIDs such as "Mike's" during installation end as broken; this was because the installer escaped the single quote using backslashes which ended up being treated as escape characters much later during hostname.if parsing in netstart(8). Ok deraadt
2020-01-15Do not redirect already quiet stdout for IPv6 reject routeskn
"route -q" already silences all standard output; if it still prints something, that's a bug to fix in route. OK bluhm
2019-10-25handle aggr(4) in the same way as trunk(4)David Gwynne
from brad@ ok bluhm@ claudio@ deraadt@
2018-08-29Historically /etc/netstart (and the equivalent code in the installKenneth R Westerback
script) did 'ifconfig <if> down' before starting dhclient(8). This was a way of ensuring old running copies of dhclient were killed before a new one started. Current dhclient does not need this assist, so change "ifconfig <if> down" to "ifconfig <if> up" pending further script optimizations. Similar to a 2014 attempt by halex@. Prompted by a misc@ report from Kristjan Komlosi reporting hanging diskless setups. ok halex@ kn@
2018-07-08netstart is used during system start, but also interactively.Theo Buehler
Show proper error message if a regular user executes netstart. Only do the privilege check if the id binary is available, which might not be the case during diskless system startup. ok deraadt, jasper, jca, krw, rpe (who wrote the same diff), sthen
2018-04-28Add a proper usage() function.Robert Peichaer
Suggested by and OK jmc. OK tb
2018-03-04when -n is used, no need to spit out "Missing parameters." beforeJason McIntyre
displaying usage(); ok tb
2018-03-03Lowercase 'usage' and group -n with interface in it.Landry Breuil
From jmc@, ok tb@
2018-02-21Tweak comments.Robert Peichaer
OK tb
2018-02-19Write warning/error messages to stderr and end them with a fullstop.Robert Peichaer
OK tb
2018-02-19- use specific patterns when looping over /etc/hostname.if filesRobert Peichaer
to skip backup or temp files. - test if the patterns matched actual files - warn if ifcreate() fails on an interface and continue with the subsequent interfaces in the list instead of return'ing OK dlg sthen tb
2018-02-17- Add descriptions for the new functions ifcreate() and vifscreate()Robert Peichaer
- In ifcreate() use the exit code of the {} block directly - In vifscreate(), use the ifconfig -C output directly in the for _vif loop - Remove superfluous and somewhat confusing comment OK dlg kn sthen
2018-02-14create virtual interfaces before starting all interface config.David Gwynne
this resolves an ordering problem when adding pseudo interfaces to bridges tweaks from kn@ ok mpi@ sthen@
2018-02-10Remove some special IPv4 in IPv6 mapped prefixes that are already rejectedClaudio Jeker
by the ::0.0.0.0/96 reject route added to deny all IPv4 mapped addresses. Makes the inet6 routing table almost fit in one screen. OK benno@
2018-02-10Load RFC 7217 key material and generate if it does not already exist.Florian Obser
Add soii.key to changelist (pointed out by semarie) and mtree/special (suggest by Craig Skinner). OK naddy, sthen, rpe, tb
2018-02-06If -n is given, the netstart script should not (try to) set the defaultTheo Buehler
route(s). Simply print the command(s) to be issued instead. tweak & ok rpe
2017-11-12Remove HN_DIR variable and expand it in the only place it was used. ItTheo Buehler
currently serves no purpose. ok rpe, agreement from deraadt and halex
2017-07-25Finally remove backwards compat code to support the 'rtsol' keywordRobert Peichaer
in hostname.if(5) OK mpi@ deraadt@ florian@ OK jmc@ from doc perspective
2017-07-21Align ifstart() in netstart and install.sub.Robert Peichaer
- in netstart, rename _file to _hn referencing hostname.if files - in install.sub switch ifstart() to be used with _if instead of _hn as parameter ok krw@ tb@
2017-05-28etc/netstart: use colon separator instead of dot with chownAdam Wolk
OK jung@, deraadt@, jmc@
2017-05-07Change test from [] to [[]] and simplify pattern.Robert Peichaer
OK tb@, krw@ (for [[]]) Feedback and OK halex@
2017-05-07Replace hardcoded script name with ${0##*/}Robert Peichaer
OK tb@ halex@
2017-05-01Revert r1.170 and remove the id==0 check.Robert Peichaer
The id binary is not available in nfs diskless setups at this point. reported by Andreas Kusalananda, thanks. discussed with deraadt@
2017-05-01Remove last remnants of rtsol. IPv6 autoconfiguration of interfaces is nowRobert Peichaer
done in ifstart(). Remove ipv6autoconf() and replace rtsolif with a boolean variable V6_AUTOCONF. Replace dhcpif with a boolean variable V4_DHCPCONF. Both are later used in defaultroute() to decide whether or not to configre defaultroutes from /etc/mygate. OK krw@
2017-04-30Do not try to delete a default route before adding it.Martin Pieuchot
Now that route are automatically G/C with the address they are attached to there's no reason to duplicate the kernel's job. Fix a regression introduced with multipath default routes. ok deraadt@
2017-04-25Unbreak netstart for multiple inteface configurations like trunkRobert Peichaer
or carp. Ensure that the noglob option is disabled at the end of parse_hn_line() and ifstart(). Reported by Christer Solskogen and Stefan Wollny, thanks!
2017-04-24Introduce a new function parse_hn_line() that replaces the existingRobert Peichaer
hostname.if(5) parsing code in ifstart(). Add a -n option to netstart to only print the interface configuration commands instead of executing them. Add a HN_DIR variable, that points to the directory of the hostname.if files (default /etc) that allows for future regression tests. - add new parse_hn_line() function - change ifstart() - rename $if to $_if - don't ifconfig or ifconfig create if -n option is used - replace hostname.if(5) parsing code with new parse_hn_line() - just print configuration commands if -n option is used - autoconf now happens in ifstart(), remove ifv6autoconf() - introduce HN_DIR variable for the hostname.if file location - add handling of the -n option to only print config commands - ensure -n is only used if interfaces are specified as parameters Discussed with and positive feedback from many 'commit' deraadt@ OK sthen@
2017-04-08- localize the if, file and stat variables which also ensures thatRobert Peichaer
variables are not named like commands. - change test from [] to [[]] OK tb@ halex@
2017-04-07Minimize differences in ifstart() function between netstart andRobert Peichaer
install.sub which makes it easier to spot changes in the future. - comments and formatting - quotes on assignments are not needed (netstart) - remove stray space in test (netstart) - use $file variable with while-loop (netstart) - although valid, instead of i use $i in arithmetic test (install.sub) OK krw@, tb@ Looks good deraadt@
2017-04-07Align comments of ifstart() function in netstart and install.sub.Robert Peichaer
2017-04-07Align comments of stripcom() function in netstart and install.sub.Robert Peichaer
2016-12-06Do not lose the default route when netstart(8) is run a second time onMartin Pieuchot
the interface pointed to by the default route. Since the kernel no longer keep routes with dangling address pointer, netstart(8) has to re-add the default route when the corresponding ifa has been deleted and re-created. deraadt@ points out that even if the previous semantic was not necessarily better, a script like netstart(8) cannot totally fix the default route problem. Regression reported by and fix tested by Hrvoje Popovski. ksh foo checked by halex@
2016-09-27Delay switch(4) interface start up so it can attach virtual interfacesRafael Zalamena
like vether(4). nits from and ok benno@, phessler@
2016-09-09print a clear error message when not ran as root instead of just fallingJasper Lievisse Adriaanse
through and try whatever it can do with the invoking user's perms feedback/ok aja@ rpe@
2016-07-19Do not consider tap(4) a special interface and start if before otherMartin Pieuchot
pseudo-interfaces. This unbreak vlan(4) on top of tap(4) since the refactoring to turn it MP-safe. ok claudio@, deraadt@
2016-03-27Don't delete the 224/4 route in netstart, unless it's being done to ensure thatStuart Henderson
a -reject route can be added. Restores the ability to set an interface route before daemons are started, lost during the previous simplification. ok millert mpi
2015-12-29Remove backslash, not necessary after '&&'Robert Peichaer
OK halex@
2015-12-29Replace last remaining `` with $()Robert Peichaer
OK halex@
2015-12-18Drop the now useless multicast setup comment.Antoine Jacoutot
prodded by tim@, ok mpi@
2015-12-17Simplify multicast option handling (10 less lines) by matching /etc/rc behaviorAntoine Jacoutot
towards other YES|NO options and drop the error warning. with and ok tim@, ok rpe@ on an earlier diff
2015-12-05It does not make sense to insert a specific route for 224/4 when theMartin Pieuchot
default one is good enough. So merge rc.conf(8)'s 'multicast_router' and 'multicast_host' into a single 'multicast'. If set to YES the reject route for 224/4 is not inserted by netstart(8). Manual bits from jmc@ ok henning@, ajacoutot@
2015-11-12Changes to ifautostart():Robert Peichaer
- Rename function to ifv6autoconf() to make IPv6 relation clearer - Localize and rename variables OK krw@