Opened 9 years ago

Last modified 5 years ago

#584 new Feature Wish

Please add `ifconfig_netbits` environment variable for IPv4

Reported by: zackw Owned by:
Priority: minor Milestone:
Component: Generic / unclassified Version: OpenVPN 2.3.8 (Community Ed)
Severity: Not set (select this one, unless your'e a OpenVPN developer) Keywords:
Cc:

Description

The environment variables passed to --up scripts express the netmask differently for IPv4 and IPv6: for IPv4 you get

ifconfig_local=203.0.113.2
ifconfig_broadcast=203.0.113.255
ifconfig_netmask=255.255.255.0

but for IPv6 you get

ifconfig_ipv6_local=2001:DB80:0001::2
ifconfig_ipv6_netbits=64

The Linux network configuration tool ip wants to be told the netmask in /nn syntax for both IPv4 and IPv6. Calculating a /nn value from a dotted-quad netmask in a shell script is difficult. It would be nice, therefore, if we could have an ifconfig_netbits environment variable for IPv4.

Change History (3)

comment:1 Changed 5 years ago by tct

cc'ing -- I like this idea

comment:3 Changed 5 years ago by tct

Test email:
route-add.sh

Note: See TracTickets for help on using tickets.