Commit Graph

800 Commits

Author SHA1 Message Date
Bjoern A. Zeeb
ac606903a8 ifconfig: print interface name on SIOCIFCREATE2 error
We have repeatedly gotten reports of unclassified SIOCIFCREATE2 errors
(usually "Device not configured").  This can happen if there is
configuration for interfaces in rc.conf which do not (yet) exist and
we try to configure.  I can, e.g., provoke this by configuring wlan
interfaces with their physical interface not installed.
In order to cut support (guesswork) down print the name of the
interface to be configured with the error message.
Hopefully this will help us in the future to improve other configuration
or driver problems.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2022-09-06 13:09:39 +00:00
Gordon Bergling
2f2cf766b2 ifconfig(8): Fix a typo in source code comment
- s/overriden/overridden/

MFC after:	3 days
2022-09-03 14:55:54 +02:00
Jens Schweikhardt
14e3d3248a Fix wrong capitalization in man page references. 2022-08-13 20:46:59 +02:00
Kristof Provost
b82b8055ad ifconfig: fix vlan/vlanproto reconfiguration
The setvlantag() and setvlanproto() functions are used in two scenarios:
when we create a new vlan interface and when we update an existing
interface.
These are distinguished by the getvlan() at the end of the functions. If
this fails we assume that is because the interface doesn't exist (so
we're creating a new one). We only update the 'params' struct, and
expect the settings to be applied when we vlan_create().

However, if we're updating an existing interface we do not retrieve the
current settings, and can end up invalidating settings.

Fix this by using the settings we retrieved while checking which
scenario we're in.

Note that we do not address this for setvlandev(), because if_vlan does
not allow the vlan parent device to be changed without disassociating it
first (with ifconfig vlanX -vlandev).

Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D35848
2022-07-21 18:36:01 +02:00
Eugene Grosbein
3c9ad9398f ifconfig.8: cleanup reminiscence about long gone ppp(4)
Replace ppp(4) removed since FreeBSD 8.0-RELEASE with vlan(4).
While here, remove commented out reference to non-existing "egress"
interface group hiding since initial import of interface groups
from OpenBSD in 2006.
2022-07-11 11:53:54 +07:00
Zhenlei Huang
7f7a804ae0 vxlan: Add support for socket ioctls SIOC[SG]TUNFIB
Submitted by: Luiz Amaral <email@luiz.eng.br>
PR: 244004
Differential Revision:	https://reviews.freebsd.org/D32820
MFC after:	2 weeks
2022-07-08 18:14:19 +00:00
Zhenlei Huang
2567cc419e ifconfig.8: Polish
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D35686
2022-07-01 11:00:26 +02:00
Zhenlei Huang
ccc48995c2 ifconfig.8: Prefer consistent terminologies
Reviewed by:	pauamma_gundo.com, email_luiz.eng.br
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D35384
2022-06-29 08:57:07 +02:00
Mateusz Piotrowski
78d4bd8753 ifconfig.8: Document -g all and -G all
The special group name "all" selects all the interfaces.

MFC after:	3 days
2022-06-24 11:38:02 +02:00
Zhenlei Huang
030f3ee995 ifconfig.8: reflect removal of FDDI and Token Ring
Reviewed By:	pauamma
Differential Revision: https://reviews.freebsd.org/D35409
2022-06-15 18:52:05 +01:00
Konrad Sewiłło-Jopek
c9a5c48ae8 arp: Implement sticky ARP mode for interfaces.
Provide sticky ARP flag for network interface which marks it as the
"sticky" one similarly to what we have for bridges. Once interface is
marked sticky, any address resolved using the ARP will be saved as a
static one in the ARP table. Such functionality may be used to prevent
ARP spoofing or to decrease latencies in Ethernet networks.

The drawbacks include potential limitations in usage of ARP-based
load-balancers and high-availability solutions such as carp(4).

The implemented option is disabled by default, therefore should not
impact the default behaviour of the networking stack.

Sponsored by:		Conclusive Engineering sp. z o.o.
Reviewed By:		melifaro, pauamma_gundo.com
Differential Revision: https://reviews.freebsd.org/D35314
MFC after:		2 weeks
2022-05-27 12:41:30 +00:00
Konstantin Belousov
d72ea9fb3f ifconfig: Use SIOCGIFCAPNV if supported
Reviewed by:	hselasky, jhb, kp (previous version)
Sponsored by:	NVIDIA Networking
MFC after:	3 weeks
Differential revision:	https://reviews.freebsd.org/D32551
2022-05-24 23:59:33 +03:00
Konstantin Belousov
277b9588fd ifconfig: add rxtls and -rxtls commands
Reviewed by:	hselasky, jhb, kp
Sponsored by:	NVIDIA Networking
MFC after:	3 weeks
Differential revision:	https://reviews.freebsd.org/D32551
2022-05-24 23:59:33 +03:00
Konstantin Belousov
6ca418e481 ifconfig: add setifcapnv()
which uses SIOCSIFCAPNV to set arbitrary string-named interface
capability.

Reviewed by:	hselasky, jhb, kp
Sponsored by:	NVIDIA Networking
MFC after:	3 weeks
Differential revision:	https://reviews.freebsd.org/D32551
2022-05-24 23:59:33 +03:00
Konstantin Belousov
42d5cb0927 ifconfig: add glue for specifying functions taking static string parameter
Reviewed by:	hselasky, jhb, kp
Sponsored by:	NVIDIA Networking
MFC after:	3 weeks
Differential revision:	https://reviews.freebsd.org/D32551
2022-05-24 23:59:33 +03:00
Konstantin Belousov
7aecd12d9c ifconfig: use c99 designated initializers for DEF_CMD
Reviewed by:	hselasky, jhb, kp
Sponsored by:	NVIDIA Networking
MFC after:	3 weeks
Differential revision:	https://reviews.freebsd.org/D32551
2022-05-24 23:59:32 +03:00
Konstantin Belousov
7541a95a54 ifconfig: some style
wrap several too long lines

Reviewed by:	hselasky, jhb, kp
Sponsored by:	NVIDIA Networking
MFC after:	3 weeks
Differential revision:	https://reviews.freebsd.org/D32551
2022-05-24 23:59:32 +03:00
Warner Losh
b91a48693a ifconfig: Fix spelling error
s/discreet/discrete

Reported by: Diane Bruce
2022-04-20 17:57:42 -06:00
Mateusz Piotrowski
632ea8ea98 ifconfig.8: Note that -l accepts -g in addition to -d and -u
Fixes:	5533c5046a ifconfig.8: Update -l synopsis
MFC after:	3 days
2022-04-11 20:05:36 +02:00
Mateusz Piotrowski
5533c5046a ifconfig.8: Update -l synopsis
The -g flag can be used together with the -l flag.

MFC after:	2 weeks
2022-03-31 17:12:27 +02:00
Mateusz Piotrowski
4d91c53a78 ifconfig.8: Document "ifconfig -g groupname"
"ifconfig -g groupname" prints a list of interface names,
which could be confusing, because it differs from
the behavior of "ifconfig -a -g groupname".

While here, add two examples showing the difference between
"ifconfig -a -g groupname" and "ifconfig -g groupname".

Fixes:	0dad3f0e15 Import interface groups from OpenBSD.
MFC after:	2 weeks
2022-03-31 17:07:15 +02:00
Mateusz Piotrowski
e57f6630d9 ifconfig.8: Remove commented-out Xr eon 5
This reference has been present in the manual page since the initial
import of BSD 4.4 Lite sbin Sources. It's time for it to be removed.

MFC after:	2 weeks
2022-03-31 12:07:18 +02:00
Mateusz Piotrowski
1969cc7bdc ifconfig.8: Remove remaining Xerox Network Systems(tm) bits
Support for Xeros Network Systems seems to be long gone. There is no
reason to keep this in the manual page.

MFC after:	2 weeks
2022-03-31 12:00:42 +02:00
Mateusz Piotrowski
19ac0bc5c1 ifconfig.8: Simplify examples by using canonical parameters
Also, use Bd instead of Dl for multi line examples.

MFC after:	2 weeks
2022-03-31 11:54:06 +02:00
Mateusz Piotrowski
2cd28d6f9b ifconfig.8: Mark address_family as optional in synopsis
Commands like "ifconfig wlan0 up" are valid. There is no need to always
specify the address family.

MFC after:	2 weeks
2022-03-31 11:43:18 +02:00
Mateusz Piotrowski
3049aac91b ifconfig.8: Improve description of the address argument
- Split paragraphs for clarity.
- Add an example of setting a random MAC address.

MFC after:	2 weeks
2022-03-31 11:43:18 +02:00
Mateusz Piotrowski
ad8cac1229 ifconfig.8: Improve readability of address_family documentation
Also, move the description of the special case of "ifconfig -l ether" to
the description of the -l flag.

MFC after:	2 weeks
2022-03-31 11:43:17 +02:00
Jose Luis Duran
607eed2f84 ifconfig.8: Fix quoting
Obtained from:	67d77afb0d (r69907135)
Fixes:		67d77afb0d ifconfig.8: Do not use ``'' for quoting
MFC after:	2 weeks
2022-03-30 17:43:13 +02:00
Mateusz Piotrowski
388c12e3f4 ifconfig.8: Clean up markup of "state" parameter
MFC after:	2 weeks
2022-03-30 14:58:39 +02:00
Mateusz Piotrowski
39da6db9bc ifconfig.8: Make the -f flag description compact
- Remove extraneous examples
- Apply "-compact" to the list macros so that it is possible to fit the
  definitions of the types and formats in one terminal screen.

MFC after:	2 weeks
2022-03-30 14:58:39 +02:00
Mateusz Piotrowski
67d77afb0d ifconfig.8: Do not use ``'' for quoting
MFC after:	2 weeks
2022-03-30 14:58:38 +02:00
Mateusz Piotrowski
ce03846373 ifconfig.8: Clean up the channel parameter description
MFC after:	2 weeks
2022-03-30 14:58:38 +02:00
Mateusz Piotrowski
0e2045b294 ifconfig.8: Add section headers to the parameters section
MFC after:	2 weeks
2022-03-30 14:58:37 +02:00
Mateusz Piotrowski
186a372f24 ifconfig.8: Clean up -n documentation
MFC after:	2 weeks
2022-03-30 14:58:37 +02:00
Mateusz Piotrowski
9076f99b9b ifconfig.8: Clean up -k documentation
MFC after:	2 weeks
2022-03-30 14:58:36 +02:00
Mateusz Piotrowski
59cdaadcf6 ifconfig.8: Clean up -C and -v documentation
MFC after:	2 weeks
2022-03-30 14:58:36 +02:00
Mateusz Piotrowski
fe1e3b55f2 ifconfig.8: Clean up -l documentation
MFC after: 2 weeks
2022-03-30 14:58:35 +02:00
Mateusz Piotrowski
787599088b ifconfig.8: Clean up -G & -g documentation
MFC after:	2 weeks
2022-03-30 14:58:35 +02:00
Mateusz Piotrowski
0625c31391 ifconfig.8: Clean up documentation of -a, -d, and -u
MFC after:	2 weeks
2022-03-30 14:58:34 +02:00
Mateusz Piotrowski
19c1b75f71 ifconfig.8: Clean up -L documentation
MFC after:	2 weeks
2022-03-30 14:58:34 +02:00
Mateusz Piotrowski
b56e4224e9 ifconfig.8: Clean up -m documentation
MFC after: 2 weeks
2022-03-30 14:58:33 +02:00
Mateusz Piotrowski
f4f02fa1e3 ifconfig.8: Clean up formatting of -f documentation
This change is about moving the -f documentation into the right place in
the manual. Also, document the IFCONFIG_FORMAT variable in the
ENVIRONMENT section.

MFC after:	2 weeks
2022-03-30 14:58:33 +02:00
Mateusz Piotrowski
f15eed7c2a ifconfig.8: Move options sections to the top
In order to clean up the layout of the manual page, let's keep
parameters in the end of the DESCRIPTION section. This patch does not
change any content, it's meant to only move the content around before
refactoring.

MFC after:	2 weeks
2022-03-30 14:58:32 +02:00
Mateusz Piotrowski
12a774649a ifconfig.8: Deduplicate groupname documentation
-G and -g flags are already described somewhere else in the manual.

MFC after:	2 weeks
2022-03-30 14:58:32 +02:00
Mateusz Piotrowski
b710d4c85a ifconfig.8: Document that -k can be used with -a
MFC after:	2 weeks
2022-03-29 19:37:01 +02:00
Mateusz Piotrowski
52ec8807d8 ifconfig.8: Improve -f synopsis
- There is no need to mention in the synopsis that -f can be a list of
  comma-separated type:format pairs. Let's keep it simple instead.
- Mention that -f can be supplied multiple times.
- Add -f to other entries in the synopsis where it can be used.

MFC after:	2 weeks
2022-03-29 19:32:32 +02:00
Mateusz Piotrowski
efb4f7fd09 ifconfig.8: Document the synopsis of -C
As documented, the -C flag can only be used on its own. Any other
command modifiers and flags are ignored when -C is used. Reflect that in
synopsis.

MFC after:	2 weeks
2022-03-29 19:16:07 +02:00
Mateusz Piotrowski
a9475cb389 ifconfig.8: Show that -g groupname can be used on its own
MFC after:	2 weeks
2022-03-29 19:14:20 +02:00
Mateusz Piotrowski
2e053399fc ifconfig.8: Cluster together short flags
MFC after:	2 weeks
2022-03-29 19:12:50 +02:00
Mateusz Piotrowski
d1d14f0428 ifconfig.8: Simplify -G & -g synopsis
MFC after:	1 week
2022-03-29 18:53:10 +02:00