Skip to content

I need some help #22

@g0lgs

Description

@g0lgs

I am trying to develop a bit of python code that will manipulate my wg0.conf to add extra peers and what I like to do is parse the exising file to find:

  • The Address, ListenPort and the effective PublicKey from the [Interface] Section (to create a wg0.conf for a peer)
  • All the AllowedIP's from all [Peers] section (so I can determine a free one)

So if I start with:

from wireguard_tools import WireguardConfig

with open("wg0.conf") as fh:
    config = WireguardConfig.from_wgconfig(fh)

How do I access these values ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions