Metadata-Version: 2.4
Name: vconfig-cli
Version: 0.1.0
Summary: vconfig wrapper for 'ip' to create vlans after deprecation of linux vconfig
Author-email: Liam Romanis <liamromanis101@btinternet.com>
License: MIT License
        
        Copyright (c) 2025 Liam Romanis
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: Homepage, https://github.com/liamromanis101/vconfig-cli
Project-URL: Issues, https://github.com/liamromanis101/vconfig-cli/issues
Keywords: vconfig,cli,vlan,ip
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

# vconfig

`vconfig` is being deprecated, and I’ll miss it. This is a drop-in style wrapper that uses `ip(8)` under the hood for those of us who are a bit old-skool.

> **Note:** The command name in the examples is `vconfig`. If your installed console script is different (e.g. `vconfig-cli`), substitute that name.

---

## Usage

`vconfig.py` — a `vconfig`-compatible wrapper implemented with `ip(8)`.

**Commands** (same as `vconfig -h`):

```
add             [interface-name] [vlan_id] [-name ifname]
rem             [vlan-name]
set_flag        [vlan-name] [flag-num] [0|1]
set_flag        [vlan-name] [0|1]                 # compatibility: reorder_hdr only
set_egress_map  [vlan-name] [skb_priority] [vlan_qos]
set_ingress_map [vlan-name] [skb_priority] [vlan_qos]
```

**Notes**

- Only creates/deletes VLAN links; it does not bring links up (mirrors `vconfig` behavior).
- `set_flag` supports: `1=reorder_hdr`, `2=gvrp`, `3=mvrp`, `4=loose_binding`.
- VLAN IDs are normalized to decimal (avoid octal/hex pitfalls).

---

## Example usage

> This script must be run as root. If `pip` installed the script into `~/.local/bin`, `sudo` may not see it due to a restricted `PATH`. You can run it like this:

```bash
sudo env "PATH=$PATH" vconfig
```
> Or copy the script into root's ~/.local/bin, or install it as root..

**Create `eth0.10` using current name-type (default: `DEV_PLUS_VID_NO_PAD`)**

```bash
sudo vconfig add eth0 10
```

**Remove it**

```bash
sudo vconfig rem eth0.10
```

**Match vconfig’s reorder header flag**

```bash
sudo vconfig set_flag eth0.10 1 1     # enable reorder_hdr
# (or simply: sudo vconfig set_flag eth0.10 1)
```

**QoS maps (same args as vconfig)**

```bash
sudo vconfig set_egress_map  eth0.10 5 3    # skb prio 5 -> VLAN PCP 3
sudo vconfig set_ingress_map eth0.10 4 2    # VLAN PCP 2 -> skb prio 4
```

**Naming style (persists in `/run`)**

```bash
sudo vconfig set_name_type VLAN_PLUS_VID_NO_PAD  # next add => vlan5
```
