Skip to content

Add the ability to specify the TUN interface by name for windows #30

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -592,7 +592,7 @@ Aliases:

Flags:
--community string ID of community to join
--dev string Name to give to the TUN device (i.e. weron0) (default is auto-generated; only supported on Linux)
--dev string Name to give to the TUN device (i.e. weron0) (default is auto-generated)
--force-relay Force usage of TURN servers
-h, --help help for ip
--ice strings Comma-separated list of STUN servers (in format stun:host:port) and TURN servers to use (in format username:credential@turn:host:port) (i.e. username:credential@turn:global.turn.twilio.com:3478?transport=tcp) (default [stun:stun.l.google.com:19302])
Expand Down Expand Up @@ -625,7 +625,7 @@ Aliases:

Flags:
--community string ID of community to join
--dev string Name to give to the TAP device (i.e. weron0) (default is auto-generated; only supported on Linux and macOS)
--dev string Name to give to the TAP device (i.e. weron0) (default is auto-generated)
--force-relay Force usage of TURN servers
-h, --help help for ethernet
--ice strings Comma-separated list of STUN servers (in format stun:host:port) and TURN servers to use (in format username:credential@turn:host:port) (i.e. username:credential@turn:global.turn.twilio.com:3478?transport=tcp) (default [stun:stun.l.google.com:19302])
Expand Down
2 changes: 1 addition & 1 deletion cmd/weron/cmd/vpn_ethernet.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ func init() {
vpnEthernetCmd.PersistentFlags().String(keyFlag, "", "Encryption key for community")
vpnEthernetCmd.PersistentFlags().StringSlice(iceFlag, []string{"stun:stun.l.google.com:19302"}, "Comma-separated list of STUN servers (in format stun:host:port) and TURN servers to use (in format username:credential@turn:host:port) (i.e. username:credential@turn:global.turn.twilio.com:3478?transport=tcp)")
vpnEthernetCmd.PersistentFlags().Bool(forceRelayFlag, false, "Force usage of TURN servers")
vpnEthernetCmd.PersistentFlags().String(devFlag, "", "Name to give to the TAP device (i.e. weron0) (default is auto-generated; only supported on Linux and macOS)")
vpnEthernetCmd.PersistentFlags().String(devFlag, "", "Name to give to the TAP device (i.e. weron0) (default is auto-generated)")
vpnEthernetCmd.PersistentFlags().String(macFlag, "", "MAC address to give to the TAP device (i.e. 3a:f8:de:7b:ef:52) (default is auto-generated; only supported on Linux)")
vpnEthernetCmd.PersistentFlags().Int(parallelFlag, runtime.NumCPU(), "Amount of threads to use to decode frames")

Expand Down
2 changes: 1 addition & 1 deletion cmd/weron/cmd/vpn_ip.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ func init() {
vpnIPCmd.PersistentFlags().String(keyFlag, "", "Encryption key for community")
vpnIPCmd.PersistentFlags().StringSlice(iceFlag, []string{"stun:stun.l.google.com:19302"}, "Comma-separated list of STUN servers (in format stun:host:port) and TURN servers to use (in format username:credential@turn:host:port) (i.e. username:credential@turn:global.turn.twilio.com:3478?transport=tcp)")
vpnIPCmd.PersistentFlags().Bool(forceRelayFlag, false, "Force usage of TURN servers")
vpnIPCmd.PersistentFlags().String(devFlag, "", "Name to give to the TUN device (i.e. weron0) (default is auto-generated; only supported on Linux)")
vpnIPCmd.PersistentFlags().String(devFlag, "", "Name to give to the TUN device (i.e. weron0)")
vpnIPCmd.PersistentFlags().StringSlice(ipsFlag, []string{""}, "Comma-separated list of IP networks to claim an IP address from and and give to the TUN device (i.e. 2001:db8::1/32,192.0.2.1/24) (on Windows, only one IP network (either IPv4 or IPv6) is supported; on macOS, IPv4 networks are ignored)")
vpnIPCmd.PersistentFlags().Bool(staticFlag, false, "Try to claim the exact IPs specified in the --"+ipsFlag+" flag statically instead of selecting a random one from the specified network")
vpnIPCmd.PersistentFlags().Int(parallelFlag, runtime.NumCPU(), "Amount of threads to use to decode frames")
Expand Down
5 changes: 3 additions & 2 deletions pkg/wrtcip/netns_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@ func setupTUN(name string, ips []string) (*water.Interface, int, error) {
tun, err := water.New(water.Config{
DeviceType: water.TUN,
PlatformSpecificParams: water.PlatformSpecificParams{
ComponentID: "tap0901",
Network: ips[0],
ComponentID: "tap0901",
Network: ips[0],
InterfaceName: name,
},
})
if err != nil {
Expand Down