-
Notifications
You must be signed in to change notification settings - Fork 27
/
Copy pathnsh.8
5991 lines (5907 loc) · 164 KB
/
nsh.8
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
.\" $OpenBSD: nsh.8,v 1.2.3 2024/09/17 17:57:00 UTC chrisc $
.\"
.\" Copyright (c) 2002-2024 Chris Cappuccio. All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution.
.\" 3. The name of the author may not be used to endorse or promote products
.\" derived from this software without specific prior written permission.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
.Dd $Mdocdate: September 17 2024 $
.Dt NSH 8
.Os
.Sh NAME
.Nm nsh
.Nd network configuration shell
.Sh SYNOPSIS
.Nm nsh
.Op Fl ev
.Op Fl i Ar rcfile
.Op Fl c Ar config-script-file
.Sh DESCRIPTION
.Nm
is a command interpreter intended for both interactive and shell script use.
.Nm
is an alternative to:
.Xr ifconfig 8 ,
.Xr sysctl 8 ,
.Xr route 8 ,
and encapsulates configuration for other daemons into one place.
.Nm
provides an alternative to:
.Xr netstart 8
and parts of
.Xr rc 8 .
.Nm
has its own command language similar to the configuration language used by
many network appliance vendors.
.Pp
.Nm
encapsulates the many available networking services and daemons that are
included in
.Ox
base, see the
.Sx SEE ALSO
section for a complete list.
.Pp
.Nm
is a shell to configure
.Ox
kernel's networking functions such as routing
of packets, firewalling, network address translation, rate limiting,
bandwidth queueing, LAN bridging, IP tunnelling, and encryption.
.Nm
provides simple wrappers around these functions to aid setting up a network.
The goals of this software are:
.Bl -dash
.It
Make the command syntax uniform
.It
Bring all configuration together in a single configuration file
.It
Provide a wrapper for any
.Ox
ctl utility such as
.Xr ospfctl 8 ,
.Xr ipsecctl 8 ,
and
.Xr bgpctl 8 .
.El
.Pp
.Nm
encapsulates those configuration files, so that their native configuration
files are encapsulated within the
.Nm
configuration framework.
.Nm
does not in any way obfuscate the configuration syntax that is utilised or
provided by these ctl.c based programs.
.Nm
allows the administrator to view and edit all configuration in one place.
.Ss COMMAND LINE ARGUMENTS
When
.Nm
is run without arguments it loads an interactive shell.
.Pp
The options are as follows:
.Bl -tag -width Ds
.It Fl v
Produce verbose output
.It Fl c Ar config-script-file
Execute the command(s) in the
.Ar config-script-file .
This is typically used to implement scripted changes to configuration.
.It Fl i Ar rcfile
Load the initial system configuration from the command(s) in the
.Ar rcfile .
This is typically used to clear the configuration and load a full
.Nm
configuration script from rcfile .
.It Fl e
Start
.Nm
in a privileged mode session.
This option is not intended to be used directly.
It is used internally by
.Nm
while restarting itself with root privileges when a non-root user runs the
.Cm enable
command.
.El
.Ss INTERACTIVE FEATURES
When run without any command line arguments,
.Nm
presents an interactive shell to the user.
If
.Nm
is run as root user then
.Nm
shall start as a privileged full functionality shell.
If
.Nm
is run as a non-root user then
.Nm
shall start as an unprivileged and limited functionality shell.
Privileged
.Nm
shell functionality can be enabled using the
.Cm enable
command.
.Pp
All
.Nm
interactive command line modes allow basic command line editing features from
.Xr editline 7
library.
The command history of the current session is available through the up / down
arrow keys.
.Pp
It is possible to repeat the commands from the command history.
.Pp
Any command can be abbreviated as long as the abbreviation is not ambiguous.
E.g. 'show running-config' can be abbreviated to 'sho run'.
.Pp
If the user enters a command that is ambiguous
.Nm
warns the user with 'Ambiguous argument' message,
E.g. ambiguous command entry.
.Bd -literal -offset indent
nsh/show i
% Ambiguous argument i
.Ed
.Ss Command line completion
.Nm
has double <Tab> command line completion for user convenience if the command
is not ambiguous double <Tab> completes the command.
.Pp
E.g show all available valid commands with double tab key sequence <tab><tab>
.Bd -literal -offset indent
nsh(config-p)/
! enable ldap ping6 show
? exit ldp pipex smtp
arp flush logger powerdown snmp
bgp ftp-proxy manual quit ssh
bridge group motd rad sshd
clear halt mpls reboot telnet
configure help nameserver relay tftp
crontab hostname ndp resolv tftp-proxy
ddb ifstate no rip traceroute
dhcp ike nppp route traceroute6
disable inet ntp rtable unsetenv
do interface ospf sasync verbose
dvmrp ip ospf6 saveenv who
editing ip6 pf scheduler write-config
eigrp ipsec ping setenv
nsh(config-p)/
.Ed
If what is typed is ambiguous double tab presents the administrator
with the available command line options that match what has been typed thus
far.
.Pp
E.g. command line completion display for all commands begining with i
.Bd -literal -offset indent
nsh(config-p)/i
ifstate inet ip ipsec
ike interface ip6
.Ed
.Ss Command History
Use the up arrow on most keyboards to review the previous commands entered in
the current session.
The command being currently viewed can be repeated by hitting enter.
.Ss Reversing Commands
.Nm
commands can be reversed in the following ways:
.Bl -dash
.It
Any affirmative commands that do not contain
.Ic enable
keyword can be reversed
with the
.Ic no
keyword in front of the affirmative version of the command.
e.g. reverse allowing IP packet forwarding.
.Bd -literal -offset indent
nsh(config-p)/ip forwarding
nsh(config-p)/no ip forwarding
.Ed
.It
Any affirmative commands that contain
.Ic enable
keyword can be reversed
with
.Ic disable
keyword.
E.g reverse enabling packet filter firewall command.
.Bd -literal -offset indent
nsh(config-p)/pf enable
%pf enabled
nsh(config-p)/pf disable
%pf disabled
.Ed
.El
.Ss Standard Prompt vs Privileged Prompt vs Configuration mode Prompt
.Tg disable
.Tg unprivileged
.Tg shell
.Ic Standard Prompt
The shell starts out with an unprivileged prompt which displays as the text
of the FQDN (fully qualified domain name) of the machine followed by a
forward slash.
This unprivileged prompt will allow only basic diagnostic commands
and does not allow viewing sensitive configuration information.
.Bl -dash
.It
e.g. standard prompt of the device firewall.machine.com
.Bd -literal -offset indent
firewall.machinename.com/
.Ed
.El
.Pp
.Tg enable
.Tg privileged
.Tg shell
.Ic Privileged Prompt
The privileged shell is accessed using the
.Cm enable
command.
It allows the administrator to run privileged diagnostic commands.
If external commands are enabled, external commands can be invoked by
the user in privileged mode.
The privileged mode alone will not allow changes to the system via
.Nm
commands.
The privileged shell is indicated by the FQDN of the machine followed
by (p) and followed by a /
.Bl -dash
.It
E.g. privileged shell prompt of the device firewall.machine.com
.Bd -literal -offset indent
firewall.machinename.com(p)/
.Ed
.El
.Pp
.Tg configure
.Tg config
.Ic Configuration Mode Prompt
The
.Cm configure
command allows the administrator to make changes to the system
configuration.
This additional command is a safeguard against accidental configuration
of a system.
I.e. a user can run privileged diagnostic commands, however without
configuration mode being enabled,
.Nm
will not permit any modifications to the system configuration.
.Pp
E.g. user elevating privileges from privilege disabled, to enabled privilege
mode and finally configuration mode on a system called hostname.nsh.org
.Bd -literal -offset indent
% NSH v1.1
hostname.nsh.org/
hostname.nsh.org/enable
hostname.nsh.org(p)/
hostname.nsh.org(p)/configure
hostname.nsh.org(config-p)/
.Ed
.Pp
For the purposes of this manual, any examples the machine is called
.Nm
.
.Bl -dash
.It
E.g. standard prompt appearing in examples in this manual
.Bd -literal -offset indent
nsh/
.Ed
.It
E.g. privileged prompt appearing in examples in this manual
.Bd -literal -offset indent
nsh(p)/
.Ed
.El
.Sh INTERACTIVE COMMANDS
.Tg help
.Ic ? | help
.Op nsh-command
.Pp
Display available commands and options that can used in the current
.Nm
mode.
The help or ? can be followed by a
.Nm
command,
.Nm
displays the purpose of the specified command.
.Bl -dash
.It
E.g. display help on the rtable command
.Bd -literal -offset indent
nsh(config-p)/? rtable
% rtable: Routing table switch
.Ed
.It
E.g. display help for all available commands in privileged mode
.Bd -literal -offset indent
nsh(p)/help
% Commands may be abbreviated.
% Commands are:
rtable Routing table switch
show Show system information
flush Flush system tables
enable Enable privileged mode
clear Clear the terminal screen
disable Disable privileged mode
ping Send IPv4 ICMP echo request
ping6 Send IPv6 ICMP echo request
traceroute Print the route to IPv4 host
traceroute6 Print the route to IPv6 host
ssh SSH connection to remote host
telnet Telnet connection to remote host
reboot Reboot the system
logger Write a message to syslog on the system
halt Halt the system
powerdown Power the system down
write-config Save the current configuration
verbose Set verbose diagnostics
editing Set command line editing
configure Set configuration mode
who Display system users
do Superfluous, do is ignored and its arguments executed
setenv Set an environment variable
unsetenv Delete an environment variable
saveenv Save environment variables set by setenv to ~/.nshenv
! Invoke a subshell or run an executable
? Print help information
manual Display the NSH manual
exit Leave configuration mode and return to privileged mode
quit Close current connection
nsh(p)/
.Ed
.It
E.g. display help for all available commands in config mode
.Bd -literal -offset indent
nsh(config-p)/?
% Commands may be abbreviated.
% Commands are:
hostname Set system hostname
interface Modify interface parameters
rtable Routing table switch
group Modify group attributes
arp Static ARP set
ndp Static NDP set
nameserver set or remove static DNS nameservers
bridge Modify bridge parameters
show Show system information
ip Set IP networking parameters
ip6 Set IPv6 networking parameters
mpls Set MPLS network parameters
ddb Set DDB parameters
pipex Set PIPEX parameters
flush Flush system tables
enable Enable privileged mode
clear Clear the terminal screen
disable Disable privileged mode
route Add a host or network route
pf Packet filter control
ospf OSPF control
ospf6 OSPF6 control
eigrp EIGRP control
bgp BGP control
rip RIP control
ldp LDP control
relay Relay control
ipsec IPsec IKEv1 control
ike IPsec IKEv2 control
dvmrp DVMRP control
rad Router advertisement control
sasync SA synchronization control
dhcp DHCP server control
snmp SNMP server control
ldap LDAP server control
smtp SMTP server control
sshd SSH server control
ntp NTP synchronization control
nppp PPP server control
ifstate ifstate server control
ftp-proxy ftp-proxy server control
tftp-proxy tftp-proxy server control
tftp TFTP server control
resolv Resolver configuration control
motd Message of-the-day
crontab Configure scheduled background jobs
scheduler Configure scheduled background jobs
inet Inet super-server control
ping Send IPv4 ICMP echo request
ping6 Send IPv6 ICMP echo request
traceroute Print the route to IPv4 host
traceroute6 Print the route to IPv6 host
ssh SSH connection to remote host
telnet Telnet connection to remote host
reboot Reboot the system
logger Write a message to syslog on the system
halt Halt the system
powerdown Power the system down
write-config Save the current configuration
verbose Set verbose diagnostics
editing Set command line editing
configure Set configuration mode
who Display system users
do Superfluous, do is ignored and its arguments executed
setenv Set an environment variable
unsetenv Delete an environment variable
saveenv Save environment variables set by setenv to ~/.nshenv
! Invoke a subshell or run an executable
? Print help information
manual Display the NSH manual
exit Leave configuration mode and return to privileged mode
quit Close current connection
nsh(config-p)/
.Ed
.El
.Pp
.Tg manual
.Ic manual
.Op Ar search tag
.Pp
Display the
.Nm
manual page.
If a
.Ar search tag
is specified then jump to the first section matching this tag if one
or more matching tags exist.
.Pp
.Tg hostname
.Ic hostname
.Op Ar hostname
.Pp
hostname without arguments displays the current configured hostname
of the system.
hostname with an argument will set hostname to the argument's value.
.Bl -dash
.It
e.g. set hostname to the myfirewallname.com .
.Bd -literal -offset indent
nsh(config-p)/hostname myfirewallname.com
myfirewallname.com(p)/
.Ed
.El
.Pp
.Tg su
.Tg doas
.Tg sudo
.Tg enable
.Ic su
.Pp
An alias for the
.Cm enable
.Nm
command.
The
.Cm su
alias is to facilitate users used to running BSD systems elevate
privileges with a similar user experience to running
.Xr su 1
commmand in other shells.
See
.Cm enable
command below for more details.
.Pp
.Tg su
.Tg doas
.Tg sudo
.Tg enable
.Ic enable
.Pp
Start a privileged shell to allow the user to run privileged commands.
If an enable secret is set, the user shall be prompted to enter
the secret to access the privileged shell.
If neccessary,
.Nm
then attempts to obtain root privileges.
Depending on configuration, this step may require the user's password or
the root password to be entered.
Root privileges will be obtained via access rules in
.Xr doas.conf 5 ,
with a fallback to the root password.
For relevant configuration examples see
.Sx Section 7 Allowing users to run NSH
below.
.Pp
.Op no
.Ic enable Ar secret
.Pp
Set or the password that an administrator would enter to access the privileged
shell.
.Bl -dash
.It
e.g. Set a password manually to yourpassword
.Bd -literal -offset indent
nsh(config-p)/enable secret yourpassword
.Ed
.It
e.g. Set a password using a previously set encrypted password
.Bd -literal -offset indent
nsh(config-p)/enable secret blowfish $2b$10$kKSJFDd....NqIUaTCZ0=
.Ed
.El
.Pp
.Tg disable
.Ic disable
.Pp
Exit privileged mode.
Useful if you have completed configuration but still want the ability to run
diagnostics in an unprivileged
.Nm
shell.
.Pp
.Tg clear
.Ic clear
.Pp
Wipe contents of terminal and scrollback buffer and present a
.Nm
prompt at the first line of the active terminal.
See also
.Xr clear 1
for more information.
.Pp
.Tg rtable
.Tg rdomain
.Op no
.Ic rtable
.Op Ar table-id
.Op Ar name
.Pp
rtable when used with a specified table-id can execute services, diagnostic
commands (ping, traceroute) and set routes under alternate routing tables.
The default
.Ox
kernel can accommodate 256 rtables.
They have a 1:1 relationship with routing domains, except that routing domain 0
can contain multiple routing tables.
In addition, routing tables initialized prior to their corresponding
routing domain
.Xr rdomain 4
, shall be initialised with a routing domain of 0.
.Bl -dash
.It
e.g. Create a new routing table rdomain 3 create a loopback for rdomain 3.
.Bd -literal -offset indent
nsh(config-p)/interface lo3
nsh(interface-lo3)/rdomain 3
nsh(interface-lo3)/inet 127.0.0.1/8
.Ed
.It
configure a physical interface
.Bd -literal -offset indent
nsh(config-p)/interface em0
nsh(interface-em0)/rdomain 3
nsh(interface-em0)/inet 10.255.0.10/24
.Ed
.It
Once the rdomain has been initialized (by creating a loopback inside the
rdomain) the administrator can add routes to the rtable.
.Bd -literal -offset indent
nsh(config-p)/rtable 3 customer label network3
nsh(p-rtable 3)/route 0.0.0.0/0 10.255.0.1
.Ed
.It
One can configure any service or daemon inside that routing domain e.g.
to setup ssh in rdomain 3
.Bd -literal -offset indent
nsh(p-rtable 3)/sshd edit
nsh(p-rtable 3)/sshd enable
.Ed
.It
The rtable command also supports unprivileged mode usage to execute
diagnostic commands in the respective route domain / VRF.
.Bd -literal -offset indent
nsh(p)/disable
nsh/rtable 3
nsh(rtable 3)/ping 10.255.0.10
%PING 10.255.0.10 (10.255.0.10): 56 data bytes
%64 bytes from 10.255.0.10: icmp_seq=0 ttl=255 time=0.090 ms
.Ed
.It
To leave the rtable menu the user can type rtable 0 to return to the main
routing table.
.Bd -literal -offset indent
nsh(p-rtable 3)/rtable 0
nsh(p)/
.Ed
.El
.Pp
.Tg group
.Op no
.Ic group
.Op Ar group-name
.Op Cm carpdemote
.Op demotion-counter
.Pp
Modify group attributes for the group-name named group.
TBC
.Pp
.Tg arp
.Op no
.Ic arp
.Op Ar IPv4-Address
.Op Ar MAC-Address
.Pp
Set or remove a static IP address and MAC address binding for Address
Resolution Protocol.
TBC
.Pp
.Tg ndp
.Op no
.Ic ndp
.Op Ar IPv6-Address
.Op Ar MAC-Address
.Op Cm temp
.Op Cm proxy
.Pp
Set or remove a static IPv6 address and MAC address binding for the
IPv6 Neighbour Discovery Protocol (NDP).
The entry will be permanent unless the word
.Cm temp
is given in the command.
If the word
.Cm proxy
is given, this system will act as an ND Proxy server,
responding to requests for
.Ar IPv6-Address
even though the MAC address is not its own.
.Pp
.Tg bridge
.Tg tpmr
.Tg veb
.Tg switch
.Tg layer2
.Op no
.Ic bridge
.Op Ar bridge-name
.Pp
Modify bridge configuration on the named bridge or layer 2
forwarding interfaces such as,
.Xr bridge 4 ,
.Xr veb 4 ,
.Xr tpmr 4 .
See also
.Ox
manual pages for
.Xr bridge 4 ,
.Xr veb 4 ,
.Xr tpmr 4
and
.Xr ifconfig 8
(accessible via the following
.Nm
commands):
.Bd -literal -offset indent
!man bridge
!man ifconfig
.Ed
.Bl -dash
.It
e.g. configure bridge settings on bridge1, and display bridge configuration
help.
.El
E.g show available bridge configuration commands.
.Bd -literal -offset indent
nsh(config-p)/bridge bridge100
nsh(bridge-bridge100)/?
% Commands may be abbreviated.
% Type 'exit' at a prompt to leave bridge configuration mode.
% Bridge configuration commands are:
description Bridge description
member Bridge member(s)
span Bridge spanning port(s)
blocknonip Block non-IP traffic forwarding on member(s)
discover Mark member(s) as discovery port(s)
learning Mark member(s) as learning port(s)
stp Enable 802.1D spanning tree protocol on member(s)
maxaddr Maximum address cache size
timeout Address cache timeout
maxage Time for 802.1D configuration to remain valid
fwddelay Time before bridge begins forwarding packets
hellotime 802.1D configuration packet broadcast interval
priority Spanning priority for all members on an 802.1D bridge
ping Send IPv4 ICMP echo request
ping6 Send IPv6 ICMP echo request
traceroute Print the route to IPv4 host
traceroute6 Print the route to IPv6 host
ssh SSH connection to remote host
telnet Telnet connection to remote host
logger Write a message to syslog on the system
do Superfluous, do is ignored and its arguments executed
setenv Set an environment variable
unsetenv Delete an environment variable
saveenv Save environment variables set by setenv to ~/.nshenv
rule Bridge layer 2 filtering rules
static Static bridge address entry
ifpriority Spanning priority of a member on an 802.1D bridge
ifcost Spanning tree path cost of a member on 802.1D bridge
link Link level options
txprio Priority in tunnel protocol headers
rxprio Source used for packet priority
vnetid Virtual interface network identifier
parent Parent interface
tunneldomain Tunnel parameters
protect Configure protected bridge domains
interface Modify interface parameters
shutdown Shutdown bridge
show Show system information
who Display system users
verbose Set verbose diagnostics
editing Set command line editing
! Invoke a subshell or run an executable
? Options
manual Display the NSH manual
exit Leave bridge config mode and return to global config mode
nsh(bridge-bridge100)/
.Ed
.Tg port
.Tg switchport
.Tg bridgeport
.Op no
.Ic member
.Op Ar interface-name
.Pp
Add a named interface as a member port to the layer 2 bridge device.
Using the no suffix removes the named interface from the layer 2
bridge device.
.Pp
E.g. configure a standard
.Xr bridge 4
device called bridge101 and add vlan 101 and vether101 as member ports.
.Bd -literal -offset indent
nsh(config-p)/bridge bridge101
nsh(bridge-bridge101)/member vether101
nsh(bridge-bridge101)/member vlan101
nsh(bridge-bridge101)/exit
.Ed
E.g. configure a virtual ethernet bridge
.Xr veb 4
device called veb101 and add vlan 101 and vether101 as member ports.
.Bd -literal -offset indent
nsh(config-p)/bridge veb101
nsh(bridge-veb101)/member vether101
nsh(bridge-veb101)/member vlan101
nsh(bridge-veb101)/exit
.Ed
E.g. configure a virtual ethernet bridge
.Xr veb 4
device called veb101 and add vlan 101 and vether101 as member ports.
.Bd -literal -offset indent
nsh(config-p)/bridge tpmr101
nsh(bridge-tpmr101)/member vether101
nsh(bridge-tpmr101)/member vlan101
nsh(bridge-tpmr101)/exit
.Ed
Note
.Xr tpmr 4
is a layer 2 mac relay and it does not have layer2 to physical
interface mac learning capabilities it is simply a relay, its
purpose is to minimise processing when forwarding packets
transparently between two and only two interfaces on a machine.
Consequentially not all bridge configuration commands will be accepted by
the system.
If an unsupported command is issued to a tpmr interface the system will
display the following when rejecting the configuration command
.Bd -literal -offset indent
% Inappropriate ioctl for device
.Ed
.Tg protected
.Tg isolation
.Op no
.Ic protected
.Op Ar interface-name
.Pp
This command requires that the named interface is already a member
of the layer 2 bridge device.
Add the named interface to a protected domain.
Any member ports in the same bridge in the same protected domain are
isolated from each other.
No layer 2 communication is possible between memers ports in the same
port protection group.
Protected domains allow for selective port isolation and or private
vlan functionality.
.Pp
E.g. enable port isolation between vether101 and vlan101 which are
member ports of the bridge veb101.
.Bd -literal -offset indent
nsh(config-p)/bridge veb101
nsh(bridge-veb101)/protect vether101 20
nsh(bridge-veb101)/protect vlan101 20
nsh(bridge-veb101)/exit
.Ed
.Tg ip6
.Op no
.Ic ip6
.Op Cm \&? | forwarding | mforwarding | multipath | maxifprefixes | maxifdefrouters | maxdynroutes
.Pp
Configure IPv6 networking parameters,
such as forwarding, multicast forwarding, multipath routing, etc.
.Bl -dash
.It
e.g. list available IPv6 configuration options
.Bd -literal -offset indent
nsh(config-p)/ip6
% Commands may be abbreviated.
% 'ip6' commands are:
forwarding Enable IPv6 Forwarding
mforwarding Enable IPv6 Multicast Forwarding
multipath Multipath routing
maxdynroutes Max IPv6 Dyn Routes
? Help
.Ed
.El
.Pp
.Op no
.Ic ip6 forwarding
.Pp
Enable or disable forwarding (routing /NAT) of IPv6 packets through the
kernel.
.Bd -literal -offset indent
nsh(config-p)/ip6 forwarding
.Ed
.Pp
.Op no
.Ic ip6 forwarding
.Pp
Enable or disable forwarding of IPv6 multicast packets through the
kernel.
.Bd -literal -offset indent
nsh(config-p)/ip6 mforwarding
.Ed
.Pp
.Op no
.Ic ip6 multipath
.Pp
Enable or disable multipath routing for IPv6 addresses.
If multipath is disabled, only the first selected route is used for a
given destination regardless of how many routes exist in the routing table.
.Bd -literal -offset indent
nsh(config-p)/ip6 multipath
.Ed
.Pp
.Op no
.Ic ip6 maxdynroutes
.Op Ar max-route-value
.Pp
Set or disable the limit on maximum number of IPv6 routes created as a result
of incomming ICMPv6 redirects.
The max-route-value can be set to any value 0-20480 or -1.
A value of 0 prevents any routes being created as a result of incoming ICMPv6
redirects.
Set to -1 to disable the limit.
The default value for maxdynroutes is 4096.
.Bd -literal -offset indent
nsh(config-p)/ip6 maxdynroutes 8192
.Ed
.Tg mpls
.Op no
.Ic mpls
.Op Cm \&? | ttl | mapttl-ip | mapttl-ip6
Configure MPLS (Multi Protocol Label Switching) network parameters in the
kernel.
.Bd -literal -offset indent
nsh(config-p)/mpls ?
% Commands may be abbreviated.
% 'mpls' commands are:
ttl MPLS ttl
mapttl-ip MPLS mapttl IPv4
mapttl-ip6 MPLS mapttl IPv6
? Help
.Ed
.Pp
.Op no
.Ic mpls ttl
.Op Ar 0-255
.Pp
Configure the default MPLS (Multi Protocol Label Switching) TTL (time to live)
in the kernel for MPLS shim headers of generated (not forwarded) MPLS packets.
The default value is 255.
.Bd -literal -offset indent
nsh(config-p)/mpls ttl 64
.Ed
.Pp
.Op no
.Ic mpls mapttl-ip
.Op Ar 0-1
.Pp
Set or unset whether the kernel decrements the TTL of the IP packet
header that is encapsulated in mpls packet, when the packet is mpls label
switched (forwarded via MPLS).
This is useful when diagnosing failures in the forwarding path of an
MPLS tunnel.
If set to 0, the encapsulated payload IP header TTL is not modified while
passing through MPLS and the MPLS label stack.
The default value is 1.
.Bd -literal -offset indent
nsh(config-p)/mpls mapttl-ip 1
.Ed
.Pp
.Op no
.Ic mpls mapttl-ip6
.Op Ar 0-1
.Pp
Set or unset whether or not the kernel decrements the TTL of the IPv6
packet header that is encapsulated in mpls packet, when the packet is mpls
label switched (forwarded via MPLS).
This feature is useful when diagnosing failures in the forwarding path of an
MPLS tunnel.
If set to 0, the encapsulated payload IPv6 header TTL field is not modified
while passing through MPLS and the MPLS label stack.
The default value is 0.
.Bd -literal -offset indent
nsh(config-p)/mpls mapttl-ip6 1
.Ed
.Pp
.Tg ddb
.Op no
.Ic ddb
.Op Cm \&? | panic | console | log
.Pp
Configure or remove kernel debug (DDB) options.
.Bd -literal -offset indent
nsh(config-p)/ddb ?
% Commands may be abbreviated.
% 'ddb' commands are:
panic DDB panic
console DDB console
log DDB log
? Help
.Ed
.Pp
.Op no
.Ic ddb panic
.Pp
Enable or disable dropping the system to the kernel debugger in the event of a
system panic.
By default, dropping to the ddb debugger in a system panic is enabled.
.Bd -literal -offset indent
nsh(config-p)/ddb panic
.Ed
.Pp
.Op no
.Ic ddb console
.Pp
Enable access to the kernel debugger from the console using an
architecture-dependent magic key sequence on the console or a debugger button.
When running
.Ox
with a
.Xr securelevel 7
greater than 0, this feature cannot be enabled.
By default accessing the ddb debugger from the console is disabled.