OpenBSD – grupowanie interfejsów

IFCONFIG(8) OpenBSD System Manager's Manual            IFCONFIG(8)

NAME
ifconfig – configure network interface parameters

SYNOPSIS
ifconfig [-AaCm] [interface] [address_family] [address [dest_address]]
[parameters]
[...]

The following parameters may be set with ifconfig:

[...]

group group-name
Assign the interface to a „group”.  Any interface can
be in multiple groups.

For instance, such a group could be used to create a
hardware independent pf(4) ruleset (i.e. not one based on
the names of NICs) using existing (egress, carp, etc.) or
user-defined groups.

Some interfaces belong to specific groups by default:

-       All interfaces are members of the all interface
group.
-       Cloned interfaces are members of their interface
family group.  For example, a PPP interface such
as ppp0 is a member of the ppp interface family
group.
-       The interface(s) the default route(s) point to
are members of the egress interface group.
-       IEEE 802.11 wireless interfaces are members of
the wlan interface group.
-       Any interfaces used for network booting are mem-
bers of the netboot interface group.

-group group-name
Remove the interface from the given „group”.
[...]

Bardzo przydatnym parametrem w ifconfig jest group – grupowanie interfejsów. W przypadku interfejsów klonowanych dodawane są one automatycznie do grupy oznaczającej rodzinę, np. VLAN:

vlan150: flags=8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> mtu 1500
lladdr 00:80:1e:15:78:ab
vlan: 150 priority: 0 parent interface: rl0
groups: vlan egress
[...]
vlan5: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
lladdr 00:80:1e:15:78:ab
vlan: 5 priority: 0 parent interface: rl0
groups: vlan
[...]

Z kolei interfejsy bezprzewodowe mają grupę wlan, a wszystkie są w grupie all.
Możemy również tworzyć samodzielnie własne grupy, a interfejsy mogą jednocześnie należeć do wielu grup.
Aby wyświetlić interfejsy należące do danej grupy należy podać jej nazwę, np.

# ifconfig phy
rl0: flags=8943 mtu 1500
lladdr 00:80:1e:15:78:ab
groups: phy
media: Ethernet autoselect (100baseTX full-duplex)
status: active
[...]
xl0: flags=8843 mtu 1500
lladdr 00:0a:5e:5f:de:77
groups: phy
media: Ethernet autoselect (100baseTX full-duplex)
status: active
[...]
xl1: flags=8943 mtu 1500
lladdr 00:50:da:18:eb:79
groups: phy
media: Ethernet autoselect (100baseTX full-duplex)
status: active
[...]
xl2: flags=8943 mtu 1500
lladdr 00:01:02:1d:c4:6d
groups: phy
media: Ethernet autoselect (100baseTX full-duplex)
status: active
[...]

Przy okazji w Solaris groupname oznacza interfejsy należące do grupy IPMP.

Tagi: ,

Dodaj odpowiedź