summaryrefslogtreecommitdiff
path: root/etc/netstart
AgeCommit message (Collapse)Author
2022-12-18Revert previous as it doesn't create additional lo(4) anymoreKlemens Nanni
Reported by Andreas Bartelt on bugs@
2022-12-18Do not try to create physical interfacesKlemens Nanni
vifscreate() always creates all virtual interfaces up-front. To check whether a given interface exists, ifstart() uses ifcreate() which tries to create nonexistent ones. Virtual ones are guaranteed to be present and physical ones cannot be created, so replace the ifcreate() call with a simpler ifconfig test and clarify the comment. OK martijn afresh1
2022-12-16zap double space and needless line breakKlemens Nanni
2022-12-16Prioritize lladdr over name/unit in hostname.if processingAndrew Fresh
When needed, lladdr is more precise and enduring. Suggested by deraadt@ Many improvments and OK kn@
2022-12-05Add support configuring hostname.if(5) by lladdrAndrew Fresh
Original implementation by martijn@ Feedback and suggestions from kn@, sthen@, claudio@, florian@, and deraadt@. ok deraadt
2022-11-05"need root privileges" is an error, print it on stderr"Klemens Nanni
2022-11-05Print full path in usage; OK jmcKlemens Nanni
2022-11-01Only load the SOII key if IPv6 is availableKlemens Nanni
Possible now that IP6KERNERL is hoisted. This also improves readability and zaps double negation logic.
2022-11-01Do not wait for DAD completion in dry-run modeKlemens Nanni
1. only do so when running without -n 2. move code to own wait_dad() helper like wait_autoconf_default() has it 3. use local _count as usual in both functions rather than the global count Feedback OK claudio
2022-10-31Hoist only the feature checkKlemens Nanni
Keep adding IPv6 routes after lo0 got an addres like before, meant to be committed together with r1.223.
2022-10-31Fix comment: IPv6 link local addresses do not use SOII anymoreKlemens Nanni
sys/netinet6/in6_ifattach.c r1.114 limited it to SLAAC addresses in 2019.
2022-10-31Improve shell style wrt. variable naming/boolean conventionKlemens Nanni
The mixed use of upper and lower case variables is neither obvious nor consistent. PRINT_ONLY is local to netstart. ip6kernel is local to netstart. multicast gets sourced from rc.subr(8). 1. uppercase ip6kernel as is common for global variables in base scripts 2. use the simpler true/false idiom and default with the rest of netstart-only variables, making it clearer that only `multicast=YES/NO' comes from the rc environment 3. hoist kernel feature detection such that a later diff can load the SOII key conditionally 4. zap obvious comment OK aja
2022-10-24do not wait for autoconf in dry-runKlemens Nanni
If there is no default route but some interface has AUTOCONF, printing what would be done still waits for... nothing to happen. OK tb
2022-10-24Add required sh(1) to synopsisKlemens Nanni
Contrary to other scripts in base like rc.d(8) or MAKEDEV(8), netstart(8) itself is not executable and must be passed as file to sh(1): $ man -h netstart /etc/netstart [-n] [interface ...] $ /etc/netstart ksh: /etc/netstart: cannot execute - Permission denied Fix usage and synopsis to provide required usage: $ man -h netsart sh /etc/netstart [-n] [interface ...] OK jmc
2022-10-21Fix synopsis, -n does not require an interface; OK jmcKlemens Nanni
2022-07-03Create virtual interfaces upfront if specified on the command lineKlemens Nanni
In cases like `sh /etc/netstart pair1 pair2', one of hostname.pair{1,2} will contain a "patch pair{2,1}" command which expects the other interface to exist. If none exist, this would fail and netstart had to be run separately or "patch"ed interface had to be manually created before. There are other use cases where interfaces depend on each other, so before (re)configuring an explicit list of interfaces, create all virtual ones upfront so that a single netstart invocation will configure everything correctly without having reflect dependencies in multiple ordered netstart invocations. Copy isin() from install.sub to help. Feedback OK halex
2022-06-26Wait for autoconf interfaces to come up in netstart(8) instead ofFlorian Obser
rc(8). This makes tunnel interfaces work that depend on working autoconf interfaces. OK deraadt
2022-02-22add some more tunnels to the list of interfaces that rely on routing.David Gwynne
2021-09-02Do not create loopback interfaces lo1, lo2, ... upfront. They areAlexander Bluhm
automatically set up by the kernel when a routing domain is created. An existing lo1 in rdomain 0 would prevent to add any interfaces in rdomain 1. OK kn@
2021-08-30Improve dubgging in /etc/netstart. Enable print only in ifcreate.Alexander Bluhm
Add debugging output for ipv6 routes. Make localhost and multicast code aware of the print only switch. Allow netstart -n to work also if no interface is given. OK kn@
2021-08-06As tim@ spotted, a use of V4_AUTOCONF crept in when the variable nameStuart Henderson
was actually V4_DHCPCONF from previous use. Rename all of the V4_DHCPCONF to V4_AUTOCONF so everything uses the new name. ok and reminder about the installer from tb@
2021-07-16switch to dhcpleased/resolvd in baseFlorian Obser
OK deraadt
2021-06-20Don't try to install a default route with route(8) later on if we areFlorian Obser
using inet autoconf, like we do with "dhcp" and "inet6 autoconf". OK kn
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@