wheatevo / wslroutesvc

Simple service to remove VPN-created routes that conflict with WSL
MIT License
6 stars 2 forks source link

Just a note: Depends on locale. #4

Open 573 opened 2 years ago

573 commented 2 years ago

To run this service on systems where the locale is not en_US, all string occurences regarding netsh calls at least would have to be translated.

To give an example:

>netsh interface ipv4 show interfaces "vEthernet (WSL)"

Parameter für die Schnittstelle "vEthernet (WSL)"
-------------------------------------------------------------
Schnittstellen-LUID                   : ethernet_NNNNNN
Schnittstellenindex                   : 55
Zustand                               : connected
Metrik                                : 15
Link-MTU                              : 1500 Bytes
Erreichbare Zeit                      : 27000 ms
Basiswert für erreichbare Zeit        : 30000 ms
Intervall für die erneute Übertragung : 1000 ms
DAD-Übertragungen                     : 3
Standortpräfixlänge                   : 64
Standort-ID                           : 1
Weiterleitung                         : disabled
Ankündigung                           : disabled
Nachbarsuche                          : enabled
Nachbar-Nichterreichbarkeitserkennung : enabled
Routersuche                           : dhcp
Verwaltete Adresskonfiguration        : enabled
Andere zustandsbehaftete Konfiguration  : enabled
Schwacher Host sendet                 : disabled
Schwacher Host empfängt               : disabled
Automatische Metrik verwenden         : enabled
Standardrouten ignorieren             : enabled
Angekündigte Routerlebensdauer        : 1800 Sekunden
Standardroute ankündigen              : disabled
Aktuelles Hoplimit                    : 0
ARPND-Reaktivierungsmuster erzwingen  : disabled
Gerichtete MAC-Reaktivierungsmuster  : disabled
ECN-Funktion                          : application
RA-basierte DNS-Konfiguration (RFC 6106)     : disabled
Koexistenz von DHCP/statischer IP         : disable
wheatevo commented 2 years ago

en_US locale for comparison:

Interface vEthernet (WSL) Parameters
----------------------------------------------
IfLuid                             : ethernet_32775
IfIndex                            : 44
State                              : connected
Metric                             : 5000
Link MTU                           : 1500 bytes
Reachable Time                     : 43500 ms
Base Reachable Time                : 30000 ms
Retransmission Interval            : 1000 ms
DAD Transmits                      : 3
Site Prefix Length                 : 0
Site Id                            : 1
Forwarding                         : disabled
Advertising                        : disabled
Neighbor Discovery                 : enabled
Neighbor Unreachability Detection  : enabled
Router Discovery                   : dhcp
Managed Address Configuration      : enabled
Other Stateful Configuration       : enabled
Weak Host Sends                    : disabled
Weak Host Receives                 : disabled
Use Automatic Metric               : disabled
Ignore Default Routes              : disabled
Advertised Router Lifetime         : 1800 seconds
Advertise Default Route            : disabled
Current Hop Limit                  : 0
Force ARPND Wake up patterns       : disabled
Directed MAC Wake up patterns      : disabled
ECN capability                     : application
RA Based DNS Config (RFC 6106)     : disabled
DHCP/Static IP coexistence         : disabled

Impacted commands that are parsed:

netsh interface ipv4 show interfaces "vEthernet (WSL)"
netsh interface ipv4 show config "vEthernet (WSL)"
netsh interface ipv4 show route

Minimal changes needed without refactoring:

Ideally this would instead interact more directly in a manner similar to the WireGuard for Windows approach.