Using networksetup to connect to WPA2 Enterprise with AD not authenticating
When using networksetup to connect to a WiFi network, the WiFi symbol appears with an exclamation mark over it. It also shows that there is no 802.1x authentication in the network preferences.
I have tried the following command:
networksetup -setairportnetwork $INTERFACE "$SSID"
I have tried unlocking the keychain prior to setting the network and tried adding the password as the last parameter.
I have also tried setting the password in the keychain to allow all applications access to it with no restrictions.
I expect the network to be connected in the same way as when manually switching networks. However, when looking in the network preferences after connecting via networksetup, the authentication does not appear to be there.
Under network preferences, after switching manually, the status is Connected and has the message "Wi-Fi is connected to XXXX and has the IP address XXXXXXX". It also shows "802.1X: Default" and "Authenticated via EAP-PEAP (MSCHAPv2)
However, after switching with the script, the status is "On" and has the message "Wi-Fi does not have an IP address and cannot connect to the internet." There is also no message regarding 802.1X authentication.
networking macos wireless-networking bash terminal
add a comment |
When using networksetup to connect to a WiFi network, the WiFi symbol appears with an exclamation mark over it. It also shows that there is no 802.1x authentication in the network preferences.
I have tried the following command:
networksetup -setairportnetwork $INTERFACE "$SSID"
I have tried unlocking the keychain prior to setting the network and tried adding the password as the last parameter.
I have also tried setting the password in the keychain to allow all applications access to it with no restrictions.
I expect the network to be connected in the same way as when manually switching networks. However, when looking in the network preferences after connecting via networksetup, the authentication does not appear to be there.
Under network preferences, after switching manually, the status is Connected and has the message "Wi-Fi is connected to XXXX and has the IP address XXXXXXX". It also shows "802.1X: Default" and "Authenticated via EAP-PEAP (MSCHAPv2)
However, after switching with the script, the status is "On" and has the message "Wi-Fi does not have an IP address and cannot connect to the internet." There is also no message regarding 802.1X authentication.
networking macos wireless-networking bash terminal
add a comment |
When using networksetup to connect to a WiFi network, the WiFi symbol appears with an exclamation mark over it. It also shows that there is no 802.1x authentication in the network preferences.
I have tried the following command:
networksetup -setairportnetwork $INTERFACE "$SSID"
I have tried unlocking the keychain prior to setting the network and tried adding the password as the last parameter.
I have also tried setting the password in the keychain to allow all applications access to it with no restrictions.
I expect the network to be connected in the same way as when manually switching networks. However, when looking in the network preferences after connecting via networksetup, the authentication does not appear to be there.
Under network preferences, after switching manually, the status is Connected and has the message "Wi-Fi is connected to XXXX and has the IP address XXXXXXX". It also shows "802.1X: Default" and "Authenticated via EAP-PEAP (MSCHAPv2)
However, after switching with the script, the status is "On" and has the message "Wi-Fi does not have an IP address and cannot connect to the internet." There is also no message regarding 802.1X authentication.
networking macos wireless-networking bash terminal
When using networksetup to connect to a WiFi network, the WiFi symbol appears with an exclamation mark over it. It also shows that there is no 802.1x authentication in the network preferences.
I have tried the following command:
networksetup -setairportnetwork $INTERFACE "$SSID"
I have tried unlocking the keychain prior to setting the network and tried adding the password as the last parameter.
I have also tried setting the password in the keychain to allow all applications access to it with no restrictions.
I expect the network to be connected in the same way as when manually switching networks. However, when looking in the network preferences after connecting via networksetup, the authentication does not appear to be there.
Under network preferences, after switching manually, the status is Connected and has the message "Wi-Fi is connected to XXXX and has the IP address XXXXXXX". It also shows "802.1X: Default" and "Authenticated via EAP-PEAP (MSCHAPv2)
However, after switching with the script, the status is "On" and has the message "Wi-Fi does not have an IP address and cannot connect to the internet." There is also no message regarding 802.1X authentication.
networking macos wireless-networking bash terminal
networking macos wireless-networking bash terminal
asked Jan 24 at 14:55
James B.James B.
11
11
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
I ended up solving this using Applescript inside a bash script instead. This mimicks the way that the user would manually switch a WiFi network.
In case anyone else has this problem in the future, here's the bash function I created to do this for me.
switchWiFi () {
osascript
-e'tell application "System Events"'
-e 'tell process "SystemUIServer"'
-e 'click (menu bar item 1 of menu bar 1 whose description contains "Wi-Fi")'
-e "click menu item $1 of menu 1 of result"
-e 'end tell'
-e 'end tell'
}
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "3"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1397946%2fusing-networksetup-to-connect-to-wpa2-enterprise-with-ad-not-authenticating%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
I ended up solving this using Applescript inside a bash script instead. This mimicks the way that the user would manually switch a WiFi network.
In case anyone else has this problem in the future, here's the bash function I created to do this for me.
switchWiFi () {
osascript
-e'tell application "System Events"'
-e 'tell process "SystemUIServer"'
-e 'click (menu bar item 1 of menu bar 1 whose description contains "Wi-Fi")'
-e "click menu item $1 of menu 1 of result"
-e 'end tell'
-e 'end tell'
}
add a comment |
I ended up solving this using Applescript inside a bash script instead. This mimicks the way that the user would manually switch a WiFi network.
In case anyone else has this problem in the future, here's the bash function I created to do this for me.
switchWiFi () {
osascript
-e'tell application "System Events"'
-e 'tell process "SystemUIServer"'
-e 'click (menu bar item 1 of menu bar 1 whose description contains "Wi-Fi")'
-e "click menu item $1 of menu 1 of result"
-e 'end tell'
-e 'end tell'
}
add a comment |
I ended up solving this using Applescript inside a bash script instead. This mimicks the way that the user would manually switch a WiFi network.
In case anyone else has this problem in the future, here's the bash function I created to do this for me.
switchWiFi () {
osascript
-e'tell application "System Events"'
-e 'tell process "SystemUIServer"'
-e 'click (menu bar item 1 of menu bar 1 whose description contains "Wi-Fi")'
-e "click menu item $1 of menu 1 of result"
-e 'end tell'
-e 'end tell'
}
I ended up solving this using Applescript inside a bash script instead. This mimicks the way that the user would manually switch a WiFi network.
In case anyone else has this problem in the future, here's the bash function I created to do this for me.
switchWiFi () {
osascript
-e'tell application "System Events"'
-e 'tell process "SystemUIServer"'
-e 'click (menu bar item 1 of menu bar 1 whose description contains "Wi-Fi")'
-e "click menu item $1 of menu 1 of result"
-e 'end tell'
-e 'end tell'
}
answered Jan 28 at 9:05
James B.James B.
11
11
add a comment |
add a comment |
Thanks for contributing an answer to Super User!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1397946%2fusing-networksetup-to-connect-to-wpa2-enterprise-with-ad-not-authenticating%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown