rename -dhcp flag to -no-dhcp for cleaner UX
DHCP is on by default; use -no-dhcp to disable. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
8a3ea06c9e
commit
42f8333783
3 changed files with 7 additions and 7 deletions
|
|
@ -57,7 +57,7 @@ pkg/tap/
|
||||||
## CLI flags
|
## CLI flags
|
||||||
|
|
||||||
Required: `-host`, `-user`
|
Required: `-host`, `-user`
|
||||||
Optional: `-pass`, `-port` (443), `-hub` (DEFAULT), `-tap` (auto), `-mac`, `-plain-password`, `-insecure`, `-dhcp` (true), `-accept-default-gateway`, `-accept-static-routes`, `-accept-dns`, `-policy-route-table` (0=disabled), `-reconnect-delay` (5s)
|
Optional: `-pass`, `-port` (443), `-hub` (DEFAULT), `-tap` (auto), `-mac`, `-plain-password`, `-insecure`, `-no-dhcp`, `-accept-default-gateway`, `-accept-static-routes`, `-accept-dns`, `-policy-route-table` (0=disabled), `-reconnect-delay` (5s)
|
||||||
|
|
||||||
## SoftEther protocol pitfalls
|
## SoftEther protocol pitfalls
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,7 @@ func main() {
|
||||||
tapName := flag.String("tap", "", "TAP interface name (empty = kernel-assigned)")
|
tapName := flag.String("tap", "", "TAP interface name (empty = kernel-assigned)")
|
||||||
macAddr := flag.String("mac", "", "TAP interface MAC address (e.g. 5E:3B:6F:63:A8:3E)")
|
macAddr := flag.String("mac", "", "TAP interface MAC address (e.g. 5E:3B:6F:63:A8:3E)")
|
||||||
insecure := flag.Bool("insecure", false, "Skip TLS certificate verification")
|
insecure := flag.Bool("insecure", false, "Skip TLS certificate verification")
|
||||||
dhcpEnabled := flag.Bool("dhcp", true, "Run built-in DHCP client after connecting")
|
noDHCP := flag.Bool("no-dhcp", false, "Disable built-in DHCP client")
|
||||||
reconnectDelay := flag.Duration("reconnect-delay", 5*time.Second, "Delay between reconnection attempts")
|
reconnectDelay := flag.Duration("reconnect-delay", 5*time.Second, "Delay between reconnection attempts")
|
||||||
acceptDefaultGW := flag.Bool("accept-default-gateway", false, "Install DHCP-provided gateway as default route")
|
acceptDefaultGW := flag.Bool("accept-default-gateway", false, "Install DHCP-provided gateway as default route")
|
||||||
acceptStaticRoutes := flag.Bool("accept-static-routes", false, "Install DHCP classless static routes (option 121/249)")
|
acceptStaticRoutes := flag.Bool("accept-static-routes", false, "Install DHCP classless static routes (option 121/249)")
|
||||||
|
|
@ -89,7 +89,7 @@ func main() {
|
||||||
signal.Notify(sig, syscall.SIGINT, syscall.SIGTERM)
|
signal.Notify(sig, syscall.SIGINT, syscall.SIGTERM)
|
||||||
|
|
||||||
netOpts := netcfg.Options{
|
netOpts := netcfg.Options{
|
||||||
DHCP: *dhcpEnabled,
|
DHCP: !*noDHCP,
|
||||||
AcceptDefaultGW: *acceptDefaultGW,
|
AcceptDefaultGW: *acceptDefaultGW,
|
||||||
AcceptStaticRoutes: *acceptStaticRoutes,
|
AcceptStaticRoutes: *acceptStaticRoutes,
|
||||||
AcceptDNS: *acceptDNS,
|
AcceptDNS: *acceptDNS,
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@ softether-go [flags]
|
||||||
| `-mac` | *(auto)* | TAP interface MAC address (e.g. `5E:3B:6F:63:A8:3E`) |
|
| `-mac` | *(auto)* | TAP interface MAC address (e.g. `5E:3B:6F:63:A8:3E`) |
|
||||||
| `-plain-password` | `false` | Send password as plaintext (AuthType 2, for RADIUS/external auth) |
|
| `-plain-password` | `false` | Send password as plaintext (AuthType 2, for RADIUS/external auth) |
|
||||||
| `-insecure` | `false` | Skip TLS certificate verification |
|
| `-insecure` | `false` | Skip TLS certificate verification |
|
||||||
| `-dhcp` | `true` | Run built-in DHCP client after connecting |
|
| `-no-dhcp` | `false` | Disable built-in DHCP client |
|
||||||
| `-accept-default-gateway` | `false` | Install DHCP-provided gateway as default route |
|
| `-accept-default-gateway` | `false` | Install DHCP-provided gateway as default route |
|
||||||
| `-accept-static-routes` | `false` | Install DHCP classless static routes (option 121/249) |
|
| `-accept-static-routes` | `false` | Install DHCP classless static routes (option 121/249) |
|
||||||
| `-accept-dns` | `false` | Set `/etc/resolv.conf` from DHCP-provided DNS servers |
|
| `-accept-dns` | `false` | Set `/etc/resolv.conf` from DHCP-provided DNS servers |
|
||||||
|
|
@ -57,9 +57,9 @@ Sets a specific MAC address on the TAP interface before connecting. Useful for d
|
||||||
softether-go -host vpn.example.com -user admin -mac 5E:3B:6F:63:A8:3E
|
softether-go -host vpn.example.com -user admin -mac 5E:3B:6F:63:A8:3E
|
||||||
```
|
```
|
||||||
|
|
||||||
### `-dhcp`
|
### `-no-dhcp`
|
||||||
|
|
||||||
Enabled by default. Runs the built-in DHCP client through the VPN tunnel after connecting. Disable with `-dhcp=false` if the TAP interface will be configured manually or by an external DHCP client.
|
Disables the built-in DHCP client. Use this if the TAP interface will be configured manually or by an external DHCP client.
|
||||||
|
|
||||||
### `-accept-default-gateway`
|
### `-accept-default-gateway`
|
||||||
|
|
||||||
|
|
@ -117,7 +117,7 @@ softether-go \
|
||||||
|
|
||||||
No DHCP (manual configuration):
|
No DHCP (manual configuration):
|
||||||
```bash
|
```bash
|
||||||
softether-go -host vpn.example.com -user admin -pass secret -dhcp=false -tap vpn0
|
softether-go -host vpn.example.com -user admin -pass secret -no-dhcp -tap vpn0
|
||||||
```
|
```
|
||||||
|
|
||||||
## Docker
|
## Docker
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue