-
Notifications
You must be signed in to change notification settings - Fork 45
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
fixing VPN server problem with multiple network interface #1156
fixing VPN server problem with multiple network interface #1156
Conversation
internal/vpn/server.go
Outdated
} | ||
netIfcs, isMultiple := s.checkingNetworkInterface(defaultNetworkIfcs) | ||
if isMultiple { | ||
return nil, fmt.Errorf("multiple default network interface detected, please set once in setting or be single: %v", netIfcs) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"multiple default network interfaces detected...set a default one for VPN server or remove one: %v"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe
ifcs, hasMultiple := s.hasMutipleNetworkInterfaces(...)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
internal/vpn/server.go
Outdated
} | ||
defaultNetworkIfc = defaultNetworkIfcs | ||
} else { | ||
defaultNetworkIfc = cfg.NetworkInteface |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NetworkInterface
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
Haven't tested it myself, but if it works, its almost good to go. |
We need to add a check for the value of
and it works.
|
We should also add this error
to proc errors just like the vpn-client adds it's errors. |
Because mostly usage of vpn-server is on instances without GUI, I think this feature is not urgent for this release, so I make ticket for this [#1163]. |
Did you run
make format && make check
? YesFixes #1145
Changes:
-netifc
How to test this PR:
ip r
command, if not make it.make build
[2022-04-19T04:45:50+04:30] INFO (STDERR) [proc:vpn-server:8ba78bc35b91411081c546dbb5ca1edd]: time="2022-04-19T04:45:50+04:30" level=fatal msg="Error creating VPN server" error="multiple default network interface detected, please set once in setting or be single: [enp0s20u3 wlp7s0]"
-netifc
argument in vpn-server part of configskywire-cli config update vpns --netifc xxx
[Not work now, get an errorFATAL []: Failed to parse config. error="open : no such file or directory"
, need handle by @0pcom help ]