Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Label and group interfaces created by pot #206

Merged
merged 1 commit into from Feb 11, 2022

Conversation

grembo
Copy link
Collaborator

@grembo grembo commented Feb 11, 2022

When running a large number of pots, it gets hard to easily figure out which
epair interface was created for which pot, especially when debugging and if
the jail is not running anymore.

This change adds two attributes to all interfaces created by pot:

  1. A description, which is the pot name in case pots/epair interfaces and
    the bridge's purpose in case of bridges.
  2. The group "pot"

With the change, it's easy to find interfaces belonging to pot

$ ifconfig -g pot
bridge0
epair2a
epair3a
epair4a
epair5a
epair6a
epair7a
epair8a
epair9a

and also easier to figure out what their purpose is

$ ifconfig bridge0 | grep -B1 descr
bridge0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0...
    description: pot public bridge

$ ifconfig epair2a
epair2a: flags=8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> ...
        description: my-pot_96958fcf_1401fde2-d6e9-f12e-9c19-08baf0195561
        options=8<VLAN_MTU>
        ether 02:5d:2b:d4:4e:0a
        groups: epair pot
        media: Ethernet 10Gbase-T (10Gbase-T <full-duplex>)
        status: active
        nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>

$ ifconfig -g pot | xargs -n1 ifconfig | grep -B1 my-pot
epair2a: flags=8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> ...
        description: my-pot_96958fcf_1401fde2-d6e9-f12e-9c19-08baf0195561

The information contained in descriptions/groups could also be taken advantage
of when developing a more robust pot stop procedure.

@grembo grembo force-pushed the ifconfig-descr-group branch 3 times, most recently from 553ba2e to dad40e8 Compare February 11, 2022 15:32
@grembo grembo changed the title Add description and group when creating interfaces Label and group interfaces created by pot Feb 11, 2022
When running a large number of pots, it gets hard to easily figure out which
epair interface was created for which pot, especially when debugging and if
the jail is not running anymore.

This change adds two attributes to all interfaces created by pot:

1. A description, which is the pot name in case pots/epair interfaces and
   the bridge's purpose in case of bridges.
2. The group "pot"

With the change, it's easy to find interfaces belonging to pot

    $ ifconfig -g pot
    bridge0
    epair2a
    epair3a
    epair4a
    epair5a
    epair6a
    epair7a
    epair8a
    epair9a

and also easier to figure out what their purpose is

    $ ifconfig bridge0 | grep -B1 descr
    bridge0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0...
        description: pot public bridge

    $ ifconfig epair2a
    epair2a: flags=8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> ...
            description: my-pot_96958fcf_1401fde2-d6e9-f12e-9c19-08baf0195561
            options=8<VLAN_MTU>
            ether 02:5d:2b:d4:4e:0a
            groups: epair pot
            media: Ethernet 10Gbase-T (10Gbase-T <full-duplex>)
            status: active
            nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>

    $ ifconfig -g pot | xargs -n1 ifconfig | grep -B1 my-pot
    epair2a: flags=8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> ...
            description: my-pot_96958fcf_1401fde2-d6e9-f12e-9c19-08baf0195561

The information contained in descriptions/groups could also be taken advantage
of when developing a more robust `pot stop` procedure.
@pizzamig
Copy link
Collaborator

This is a great idea and stop can be way more selective on its implementation.
Also the _epair_cleanup function would benefit from it.

@pizzamig pizzamig merged commit 7ec2e0f into bsdpot:master Feb 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants