Skip to content
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

Can't unset exit-node after setting it. #9

Open
krptg0 opened this issue Aug 3, 2022 · 6 comments
Open

Can't unset exit-node after setting it. #9

krptg0 opened this issue Aug 3, 2022 · 6 comments
Labels
bug Something isn't working

Comments

@krptg0
Copy link

krptg0 commented Aug 3, 2022

Hi,

The extension allows me to select an exit node and proceeds to connect to it upon clicking, but when I want to get back to normal behavior, it asks for my password, but does nothing. Clicking on the tray icon still shows my exit node selected (and working).

The only logs i could find are in syslog :

Aug  3 10:15:22 HOSTNAME tailscaled[1375]: magicsock: ReSTUN("link-change-minor") ignored; stopped, no private key
Aug  3 10:15:23 HOSTNAMEtailscaled[1375]: open-conn-track: timeout opening (TCP 192.168.1.XXX:39842 => XXX.XXX.XXX.XXX in netmap but unknown to WireGuard

Thank you :)

@krptg0
Copy link
Author

krptg0 commented Aug 4, 2022

I'm adding more info on that :
Seems that it's tailscale own way of doing things: it remembers your last used arguments to re-run it when you type tailscale up
In essence :

- sudo tailscale up #does connect to tailscale
- sudo tailscale down #does disconnect from tailscale
- sudo tailscale up --exit=node=blabla #does connect using exit node blabla
- sudo tailscale down #does disconnect from tailscale
- sudo tailscale up #does connect using exit node blabla from save previous argument !

The only way to reset exit-node is to run tailscale up --exit-node=, yes, an empty string.
May that help you :)

@maxgallup
Copy link
Owner

I did in fact use "tailscale up --exit-node=", but there was a bug that prevented it from being used properly. But thanks for the detailed comments! Update to the latest version to have the changes committed :)

@krptg0
Copy link
Author

krptg0 commented Aug 7, 2022

@maxgallup it works ! I didn't test it right now but since you used a --reset arg, would it conflict when disabling exit node, it'll also disable accept routes option ?

@maxgallup
Copy link
Owner

@krptg0 You are exactly correct. I plan on finding a solution that doesn't use --reset, however this will require more digging around in the Tailscale docs, since at the moment I can't find a way to see if --accept-routes (for example) is turned on through the command line. tailscale status --json doesn't seem to offer that information so I might have to use tailscale's API? Suggestions welcome!

@krptg0
Copy link
Author

krptg0 commented Aug 11, 2022

Understood.
Could you leave this issue open since your last commit wasn't the perfect solution ?

@maxgallup maxgallup reopened this Aug 14, 2022
@maxgallup maxgallup added the bug Something isn't working label Nov 2, 2022
@Aiq0
Copy link

Aiq0 commented Dec 29, 2022

It seems like you can use localapi - if you look in source code, you can find /localapi/v0/prefs
endpoint and you can retrieve info from it like this:

curl --unix-socket /run/tailscale/tailscaled.sock --header 'Host: ' http://localhost/localapi/v0/prefs

Output:

{
	"ControlURL": "https://controlplane.tailscale.com",
	"RouteAll": false,
	"AllowSingleHosts": true,
	"ExitNodeID": "",
	"ExitNodeIP": "",
	"ExitNodeAllowLANAccess": false,
	"CorpDNS": true,
	"RunSSH": false,
	"WantRunning": true,
	"LoggedOut": false,
	"ShieldsUp": false,
	"AdvertiseTags": null,
	"Hostname": "",
	"NotepadURLs": false,
	"AdvertiseRoutes": null,
	"NoSNAT": false,
	"NetfilterMode": 2,
	"OperatorUser": "user name",
	"Config": {
		"PrivateMachineKey": "privkey:a lot of numbers",
		"PrivateNodeKey": "privkey:a lot of numbers",
		"OldPrivateNodeKey": "privkey:a lot of numbers",
		"Provider": "some provider",
		"LoginName": "email",
		"UserProfile": {
			"ID": "some number",
			"LoginName": "email",
			"DisplayName": "user name",
			"ProfilePicURL": "url",
			"Roles": []
		},
		"NetworkLockKey": "nlpriv:a lot of numbers",
		"NodeID": "some node id"
	}
}

(we must set host to empty string, else you will get invalid localapi request)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants