Mac Manual Dhcp Connection

If you need to adjust network settings on your Mac, the quickest route is to do so through the OS X system preferences and menu extras. However, you can also make these changes -- adding and removing ports, creating new locations, switching to DHCP from manual configurations, changing MTU sizes, and managing 802.1x profiles, among others -- via the command line.

  1. Mac Manual Dhcp Connection Windows 10
  2. Dhcp Connection Failed
  3. Mac Manual Dhcp Connection System
  4. Mac Manual Dhcp Connection Password
  5. Mac Manual Dhcp Connection Download
  6. Mac Dhcp Server

The utility for doing this is the command 'networksetup,' which can be used to quickly apply a change to a specific network property. This tool covers every aspect of the Mac's network setup and you can look at all of its options by simply running networksetup by itself in Terminal to see a list of all supported command options. The list is quite extensive, but when it comes to basic Wi-Fi management, there are a few options that are relatively easy to remember and put to use.

“Internet Sharing” allows your Mac to act as a gateway, assuming it's connected to the Internet. To enable internet sharing, open System Preferences and click on the “Sharing” icon: Choose the “Internet Sharing” tab and select to share the AirPort connection to computers using the Ethernet connection. 6) But if I configure DHCP addresses to User1 and U ser2 PCs (Network and sharing center - Network Connection - Local Area connection for Windows users) the DHCP won't assign them the previously defined binding in the DHCP server switch. The DHCP server uses the MAC address (page 1092) of the system's Ethernet card (NIC) as an identifier. When you set up the server, you must know the MAC address of each system that requires a static IP address.

  • Turning Wi-Fi on or off
    With the following options, you can get the power status of the current Wi-Fi card and change it if needed:

    networksetup -getairportpower <device name>
    networksetup -setairportpower <device name> <on off>

  • Setting the AirPort network
    With these options you can change the network AirPort uses (see below for how to scan for Wi-Fi networks via the command line):

    networksetup -getairportnetwork <device name>
    networksetup -setairportnetwork <device name> <network> [password]

  • Managing preferred wireless networks
    These options can be used to list your preferred Wi-Fi networks, add or remove networks to the list, or clear the entire list:

    networksetup -listpreferredwirelessnetworks <device name>
    networksetup -addpreferredwirelessnetworkatindex <device name> <network> <index> <security type> [password]
    networksetup -removepreferredwirelessnetwork <device name> <network>
    networksetup -removeallpreferredwirelessnetworks <device name>

With these options, '<network>' is the name of the Wi-Fi network you are interested in, and the '<device name>' will likely be 'en1' (the default for the Wi-Fi card in Macs), but you can look this up by running the following command and noting the device name next to each network port listed:

networksetup -listnetworkserviceorder

Additional options
Though you can exercise the above options through the networksetup utility, the tool does have its limitations, such as the inability to scan for available Wi-Fi networks and adjust the Wi-Fi channel. To fill this gap, Apple offers a command called 'airport' that is hidden deep in the system's frameworks folder at the following location:

/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport

With the airport command you can change channels, disconnect from any Wi-Fi network, and get information on the current connection, but more importantly, you can scan for available Wi-Fi networks. If you don't want to go digging for this buried command every time, you can make an alias for it, create a link to it, or copy it from its location to a more convenient place, such as the /usr/bin/ directory. Here, though, we will change to the command's parent directory and run it from there by using the following:

cd /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/

Once at this directory, you can run various options in the command line to look up information and make changes to the Wi-Fi connection:

  1. Change channel

    ./airport -c CHANNEL

  2. Disconnect

    ./airport -z

  3. Get current connection info

    ./airport -I

  4. Scan for Wi-Fi networks

    ./airport -s

You can use both the output from the airport command and the networksetup utility to adjust properties such as connecting to a new Wi-Fi network. First, scan for networks with the 'airport -s' option and then use the SSID of the listed networks with the 'networksetup -setairportnetwork <device name> <network> [password]' command.


Questions? Comments? Have a fix? Post them below or e-mail us!
Be sure to check us out on Twitter and the CNET Mac forums.

  • Review
    Mac OS X 10.8 Mountain Lion
Active2 years, 3 months ago

In OS X there's an option for use DHCP with manual address: is there any way to do that (or something similar, with any program) in Windows?

image:

Here's my problem:

At my school there's a wifi with proxy, I can connect my iPhone, my Mac, phones running Android, but I can't connect computers using Windows to it, I thinks it's cause I couldn't find an option like that on Windows, does anybody knows of something else I could do?

If there's no way to do that on windows, any Linux solution?

EDIT: Turned out that after trying the answers below a lot of times, I accidentally put the wrong subnet mask (DHCP gives 10.244.49.220 and it was inserted as 10.255.49.220) and it connected. Black magic.

Pierre.Vriens
1,2876 gold badges13 silver badges19 bronze badges
GBF_GabrielGBF_Gabriel

2 Answers

Manual

Question 1:

Windows does not natively have an option to take a DHCP lease and override the IP address

Mac Manual Dhcp Connection Windows 10

Question 2:

You can accept a DHCP lease then reconfigure your network based upon the information provided in the DHCP lease - more information after break

Question 3:

Leaving open to others to answer but linux is very open-ended it would be better to ask if there are any linux distros that support this functionality

Assumptions:

OP has basic understanding of CLI and windows command prompt

Tools needed

Windows command prompt

Okay we're going to start up Command prompt and start typing commands and noting down some basic information from the output

ipconfig /all

From the output you need to identify which adapter you want to be working with eg: Local Area Connection going forward I will refer to this selection as foo

Next commands:

netsh interface ip set address name='foo' dhcp

ipconfig /release

ipconfig /renew

ipconfig /all

This will set your foo interface to release any current leases ten request and accept a DHCP then lastly display the config from that DHCP lease

From here you will need to make note of your foo interfaces DNS Servers, Default Gateway and Subnet Mask

Going forward I will refer to these as follows

  • The static IP address you want = x
  • Subnet Mask = y
  • Default Gateway = z
  • DNS Server 1 = a
  • DNS Server 2 = b

From here we have all the information we need so we can finish this in 3 more commands

netsh interface ip set address name='foo' static x y z

netsh interface ip set dns 'foo' static a

netsh interface ip add dns 'foo' b INDEX=2

If you would like a better understanding of how these commands work you can read up on the technet KB items

50-350-3
3,7393 gold badges16 silver badges27 bronze badges

Short answer: If it's something you need to get things done, then talk to campus network support. If that's the case, they may already have a process for you to follow

If it's NOT for classwork then on windows 7 you can try the following. But read the whole thing first, and understand the caveats:

  1. click start > run
  2. type cmd, Enter
  3. type ipconfig, Enter
  4. you may have to read through the output, but you can find the adapter in use and an entry for 'IPv4 Address'. Yours will likely be 192.168.x.x (not a guarantee). mine says 192.168.1.120. so we'll use that for the example going forward. Leave this window open.
  5. go to Start > Control Panel > Network and Sharing Center
  6. in the 'View your active networks' section, right side, it shows your connection. Click that.
  7. click Properties
  8. highlight (single click) 'Internet Protocol Version 4 (TCP/IPv4)'
  9. click Properties

Dhcp Connection Failed

In this window, you can select 'Use the following IP address:' and set the 'IP address' field to match the IPv4 Address shown in the ipconfig output. You must also set the Subnet mask and Default gateway to match those entries from the ipconfig output.

You will likely not have any problems with this, but I wouldn't trust it. It doesn't affect your dynamic ip address leases. So, depending on the config of the network you're on, it may force release of your ip at anytime, take your ip lease from you and give it to someone else. In that case, it will most likely prefer the person with the full dynamic config (because their station accepted it outright) and leave you with no network connection... forcing you to call support and give them a chance to chastise you for TRYING TO HACK OUR SYSTEM!!1 or some nonsuch.

50-3 said basically the same thing, but using the command line while I directed you through the graphical user interface. The problem is much the same: your system is dependent upon how the network treats ip leases. A lot of networks don't bother them, but colleges can be pretty anal about people doing 'illicit things' over their networks, and employ all kinds of non-standard practice to thwart them.

Mac Manual Dhcp Connection System

On a technical level, though, there's nothing in either of our posts that could floob your machine beyond use. The worst thing that could happen is that you randomly lose internet at the worst time and have to call someone.

Mac Manual Dhcp Connection Password

50-3
3,7393 gold badges16 silver badges27 bronze badges
Mac Manual Dhcp Connectionmonstomonsto

Mac Manual Dhcp Connection Download

4802 gold badges4 silver badges13 bronze badges

Mac Dhcp Server

Not the answer you're looking for? Browse other questions tagged networkingdhcp or ask your own question.