StackHowTo

  • How To Set Static IP Address in Windows 10 using CMD

I n this tutorial, we are going to see how to set static IP address in Windows 10 using CMD . There are several methods to set a static IP address in Windows 10. In this tutorial, we will see together how to set a static IP address from the Command Prompt.

In Windows 10, setting a static IP address for your device is an essential configuration that may be required in a number of scenarios. For example, if you plan to share files or a printer on a local network, or when you try to set up port forwarding.

Using CMD may seem difficult for some users, yet it is one of the fastest ways to assign a static IP address in Windows 10.

assign ip address in cmd

  • IPv4 address
  • Subnet mask
  • Default gateway
  • DNS servers

assign ip address in cmd

  • Types of Ethernet Cable

How to Install CAB File in Windows 10 using Command Line

  • How to Change Multiple File Extensions at Once in Windows 10 Using PowerShell
  • How to Make Taskbar Buttons Smaller in Windows 10
  • How to Run AutoHotKey Script on Startup Windows 10
  • How to Remap Keyboard Keys in Windows 10
  • How to Search Files by Size in File Explorer on Windows 10
  • How to Check Internet Data Usage in Windows 10
  • How to Change Folder Background Color in Windows 10
  • How to Turn off Location on Laptop Windows 10
  • How to Disable Sleep Option from Windows 10 Start Menu
  • How to Wake Up Computer From Sleep Mode in Windows 10 with Mouse
  • How to Wake Up Computer From Sleep Mode in Windows 10 with Keyboard
  • Batch File To Display Popup Message in Windows 10
  • How to Display Popup Reminder in Windows 10
  • How to See PC Startup and Shutdown History in Windows 10
  • How to Record Your Screen with VLC on Windows 7/8/10
  • How to Change Paging File Size in Windows 10
  • How to Display Full Path in Title Bar of File Explorer on Windows 10
  • How to Cancel Shutdown on Windows 10
  • How to Schedule Auto Shutdown in Windows 10
  • How to Schedule a Scan in Windows Defender
  • How to Calculate Total Duration of Multiple Video Clips in Windows 10
  • How to Fix Drag and Drop Problems in Windows 10
  • How to Disable Power Throttling in Windows 10
  • How to Run Program as Administrator Without Password Prompt in windows 10
  • How to Limit Windows Defender CPU Usage
  • How to Check if Windows 10 is Activated
  • How to Fix Right Click on Desktop Not Working in Windows 10
  • Image Resizer on Right-click for Windows 10
  • How to Change Computer Name in Windows 10
  • How to Change Account Picture in Windows 10
  • How to Zoom in and out in CMD and PowerShell
  • How to Lock Screen After Inactivity on Windows 10
  • How to Sync Computer Time With Internet in Windows 10
  • Command To Check Open Ports in Windows
  • How to Keep a Window Always On Top on Windows 10
  • How to Increase Font Size in Windows 10
  • How to Change Cursor Color in Windows 10
  • How to Change Cursor Size in Windows 10
  • How to Change Default PDF viewer on Windows 10
  • How to Disable Security Questions in Windows 10
  • How to Pin Specific Settings to the Start Menu in Windows 10
  • How to Format USB Device When FAT32 Option is Not Available
  • How to Automatically Open a Web Page at a Specific Time
  • How to Restart explorer.exe in Windows 10 Using CMD
  • How to Restart Explorer.exe in Windows 10 [2 Methods]
  • How to Add Program Shortcut to Start Menu in Windows 10
  • Hibernate Option Not Showing In Windows 10
  • How To Delete Previous Version of Windows in Windows 10
  • How to Add Print Option in Right-Click Menu
  • How to Delay Startup Programs in Windows 10/8/7
  • How to Disable Task Manager on Windows 10
  • How to Turn on Network Discovery in Windows 10
  • How to Check if Virtualization is Enabled in Windows 10
  • How to Password Protect a Zip File on Windows 10
  • How To Change User Folder Name in Windows 10
  • How to Restore Drivers in Windows 10
  • How to Backup Drivers using PowerShell Command in Windows 10
  • How to Add Store Apps to Startup in Windows 10
  • How to Enable Fingerprint in Windows 10
  • How to Enable Autocorrect and Predictive Text in Windows 10
  • How To Open a Second File Explorer Window in Windows 10
  • How to Block Websites On Your Computer
  • Check Disk Command in Windows 10
  • How to Activate a Window by Hovering Over it with the Mouse in Windows 10
  • How to Control Volume for Individual Programs in Windows 10
  • How to Schedule Restart in Windows 10
  • How to Change Microsoft Store Region in Windows 10
  • How to Hide the Clock From Windows 10 Taskbar
  • How to Enable Number Pad on Keyboard Windows 10

How to Turn Off Taskbar Thumbnail Previews in Windows 10

  • How Can I See All Drives in CMD
  • How to Show All Drives in Windows 10 File Explorer
  • Windows 10 Privacy Settings to Turn Off
  • How to Change Desktop Icons in Windows 10
  • How to Force a Program to Open in Full Screen in Windows 10
  • How to Delete Temporary Files in Windows 10
  • How to Enable Startup Sound in Windows 10
  • How to Reset All Default Apps in Windows 10
  • How to Change Default Action on Connecting a USB Device Windows 10
  • How to Remove Old Drivers From Windows 10
  • Where is the Drivers Folder in Windows 10
  • How to Reset Windows Update in Windows 10
  • How to Format USB Using CMD on Windows 10
  • How To Check WiFi Signal Strength on Windows 10 Using CMD
  • How to Remove “Show Desktop” Button on Windows 10
  • How to Enable Remote Desktop on Windows 10
  • How To Open File Explorer To “This PC”
  • How to Stop the Screen From Turning Off on Windows 10
  • How to Change Default Folder Name in Windows 10
  • How to Display Day of Week in Windows 10 Taskbar
  • How To Display Windows 10 Start Menu in Full Screen
  • How to Create a New Library in Windows 10
  • How to Reset the Settings App in Windows 10
  • How To Disable Startup Programs in Windows 10
  • How to Enable Registry Backup in Windows 10
  • How to Remove Password at Windows 10 Startup
  • How to Reset Windows 10 To Factory Settings
  • How To Enable or Disable Night Light in Windows 10
  • How to Add Clocks to Start Menu on Windows 10
  • How to Disable Bing Web Search Results in Windows 10 Start Menu
  • How to check Bluetooth battery level on Windows 10
  • How To Find Out If a Program is 32 or 64-bit Windows 10
  • How To Check Bios Firmware Version in Windows 10
  • How To Activate Windows 10

How to enter UEFI (BIOS) on Windows 10

  • How to Boot From a USB Drive on Windows 10
  • How to Reinstall Microsoft Store in Windows 10
  • How to Enable Ultimate Performance Mode in Windows 10
  • How to Stop Apps From Running in the Background on Windows 10
  • How to Change Another User’s Password in Windows 10
  • How to Delete Local User Account using PowerShell in Windows 10
  • How to Create Local User Account using PowerShell in Windows 10
  • How to Disable User Account Control (UAC) in Windows 10
  • How to Block Inappropriate Websites on Windows 10
  • How to Set Up a Child Account in Windows 10?
  • How to Download Windows 10 ISO file (32 bits and 64 bits)
  • How to Change the Default Save Location in Windows 10
  • How to Add Open Command Prompt Here to right-click Menu in Windows 10
  • Add Open PowerShell Window Here as Administrator in Windows 10
  • How to Mount ISO Images on Windows 10
  • How to Clear DNS Cache on Windows 10
  • How to Change DNS Server in Windows 10
  • How to Change Temp Folder Location in Windows 10
  • How to Reduce the Size of the Search Bar in Windows 10
  • How to Force Close a Program on Windows Without Task Manager
  • How to Force Close a Program with Task Manager
  • How to Speed Up Windows 10 Startup
  • How to Enable Sandbox in Windows 10
  • How to Disable Automatic Installation of Suggested Apps in Windows 10
  • No Sounds on Windows 10? Here’s How to Fix It
  • No Audio Output Device Is Installed in Windows 10 Fix
  • Where is the Location of Startup Folder in Windows 10?
  • How to Create a Windows 10 Bootable USB
  • How To Run Computer Performance Test in Windows 10
  • How To Tell If Your Computer Is 32 Or 64-bit Windows 10
  • How to Remove Recycle Bin From Desktop on Windows 10
  • How to Show My Computer, Recycle Bin Icon on Windows 10
  • How To Enable Screen Saver In Windows 10
  • How to Enable or Disable Updates For Other Microsoft Products on Windows 10
  • How to Disable Windows 10 Startup Delay
  • How To Open Emoji Keyboard on Windows 10
  • How to Turn On File and Printer Sharing in Windows 10
  • How To Optimize Windows 10 For Gaming
  • How to Add Shortcuts to the “Send to” Menu in Windows 10
  • How to Change the Screen Refresh Rate of Your Monitor in Windows 10
  • How to Make a Program Run on Startup in Windows 10
  • How to Turn Off SmartScreen in Windows 10
  • How to Disable Telemetry in Windows 10
  • How to Disable Windows 10 Tracking
  • How to Disable Windows 10 Data Collection
  • How to Free Up Disk Space in Windows 10
  • Fast Way to Delete a Large Folder in Windows 10
  • How to Create a Printer Shortcut on Desktop Windows 10
  • How to Change Audio Output Device Per Application on Windows 10
  • How to Format a Hard Drive or SSD in Windows 10
  • How to Switch Between Windows in Windows 10 using Keyboard
  • How to Download and Install Windows Media Player for Windows 10
  • How to Create a Shortcut on Desktop Windows 10
  • How to Block reopening of Programs on startup Windows 10
  • How To Limit Windows Update Bandwidth in Windows 10
  • How to remove the 3D Objects folder from This PC in Windows 10
  • How to Remove Old User Account Pictures in Windows 10
  • How to Delete the Hibernation File hiberfil.sys
  • How to Show Seconds in System Clock in Windows 10
  • How to Open Files and Folders with Single Click in Windows 10
  • How to Reset Your Microsoft Account Password for Windows 10
  • How to Fix Corrupted Files in Windows 10
  • How To Export And Import Start Menu Layout In Windows 10
  • How to Stop Automatic Restart After Updating Windows 10
  • How to Remove Ads From the Start Menu in Windows 10
  • How to Create a Homegroup Network in Windows 10
  • How to Disable ads in File Explorer in Windows 10
  • How To Fix gpedit.msc Group Policy Editor Missing in Windows 10
  • How to Change the Network Connection Priority in Windows 10
  • How to Watch Videos While Working on Other Tasks on Windows 10 Computer
  • How to Create a System Repair Disk in Windows 10
  • How to Customize the Taskbar in Windows 10
  • How to Change Taskbar Icons in Windows 10
  • How to Show the Control Panel in File Explorer on Windows 10
  • How to Uninstall Updates in Windows 10
  • How to reset all Local Group Policy on Windows 10
  • How To Turn Windows 10 Computer Into a Wi-Fi Hotspot
  • How to Reset Network Settings in Windows 10 Using CMD
  • How to Disable the Game Bar in Windows 10
  • How to Clear Windows 10 Update Cache
  • How to Create an Invisible Folder without Any Name in Windows 10
  • How to Add Open With to Right-click Menu in Windows 10
  • How to Change Default Apps on Windows 10
  • How to Prevent Copying Files From USB to PC
  • How to Find Your WiFi Password on Windows 10
  • How to Hide Your Name and Email Address on Windows Login
  • How to Speed Up File Transfer in Windows 10
  • How to Remove Power or Shutdown Button from Lock Screen in Windows 10
  • How to Start Windows 10 in Safe Mode
  • How to Stop Lock Screen ads in Windows 10
  • How to Enable Guest Account in Windows 10 using CMD
  • How to Restore Windows 10 Image Backup From Hard Drive
  • How to Create a System Image in Windows 10
  • How to Disable Automatic Update on Windows 10
  • How to Stop Programs From Automatically Updating in Windows 10
  • How to Take a Screenshot on Windows 10
  • Windows 10: Start Menu And Taskbar Not Working
  • How to Rebuild a Broken Icon Cache in Windows 10
  • How to Turn Off Windows Security Notifications in Windows 10
  • How to Preview a File Without Opening it in Windows 10
  • How to Permanently Disable Windows Defender on Windows 10
  • How to Disable the Action Center in Windows 10
  • How To Reinstall Microsoft Edge In Windows 10
  • How to Uninstall Microsoft Edge in Windows 10
  • How to Change Start Menu and Taskbar Color in Windows 10
  • How to Get Windows 7 Start Menu on Windows 10 with Classic Shell
  • Why the Start Menu is Slow to Open in Windows 10
  • How to Change Login Screen Background on Windows 10
  • How to Restore Windows Photo Viewer in Windows 10
  • How to Fix Screen Flickering in Windows 10
  • How to Remove Windows 10’s Built-in Apps
  • How to Fix Black Screen on Windows 10
  • How to Remove Search Bar From Taskbar on Windows 10
  • How to Disable Windows 10 Peer-to-Peer Updates
  • How to Downgrade to Windows 7 From Windows 10
  • How to Fix Windows 10 Start Menu And Cortana Not Working
  • How to Backup and Restore Registry in Windows 10
  • How to Change the Default Installation Location on Windows Using Regedit
  • How to Force Restart Windows 10 with Keyboard
  • How to Remove Shortcut Arrow from Desktop Icons on Windows 10
  • How to Find Computer Specs on Windows 10
  • How To Move Your Libraries To Another Drive in Windows 10
  • How to Enable Numlock at Windows Startup
  • How to Change CMD Color in Windows 10
  • How To Increase Font Size In CMD
  • How To Assign Letter To Drive In CMD
  • How To Get MAC Address In CMD
  • How to Open File Explorer Using CMD on Windows 10
  • How To Run Batch File On Windows Startup
  • How To Run EXE From A Batch File
  • How To Run A Python Script From A Batch File
  • How to Run PowerShell Script From A Batch File
  • How to Run Multiple Batch Files From One Batch File
  • Batch File To Copy All Files From One Folder To Another
  • How To Compare Strings In Batch Files
  • How To Concatenate Variables In Windows Batch File
  • How To Clear A Variable In A Batch File
  • For Loop Counting From 1 To N in a Batch File
  • How to Run Batch File Automatically Every X Minutes
  • Batch File To Get and Set System Date
  • Batch File To Set Default Programs in Windows 10
  • Batch File To Get Computer Name
  • Batch File To Get Current Directory
  • Batch File To Get Input From User
  • Batch File To Get IP Address
  • Batch File To Get MAC Address
  • How to Add a Registry Key in a Batch File
  • Batch File To Create Local User Accounts
  • Batch File To Create a Text File
  • Batch File To Create a Folder
  • Batch File To Create Folders From a List
  • Batch File To Write Ping Results To a Text File
  • Batch File To Write Variable To a Text File
  • Batch File To Write To a Text File
  • Batch File To Read XML File
  • Batch File To Read CSV / XLS
  • Batch File To Read Text File Line By Line into A Variable
  • Batch File To List Folder Names
  • Batch File To List Folders and Subfolders
  • Batch File To List Filenames in a Specified Folder
  • Batch File to List All Files in a Folder and Subfolders
  • How to Check Internet Connection using Batch File
  • How to Check the Size of a File in a Windows Batch Script
  • How To Check Batch File Error
  • Batch File To Check If Folder Exists
  • How to Check If a Path is File or Directory using Batch
  • Batch File To Delete Folders Older Than N Days
  • Batch File To Delete All Files in Folder Older Than N Days
  • Batch File To Delete All Files In Folder
  • Batch File To Delete A File If Exists
  • Batch File To Check If Multiple Files Exist
  • Batch File To Check If File Exists
  • Batch File Commands List With Examples
  • 8 Batch File Commands You Should Know
  • How to Create a Batch File in Windows
  • How to Run Batch File in CMD
  • How to Run EXE File in CMD
  • How to Change the MAC Address on Windows 10
  • How to Create a Website Shortcut on Desktop In Windows 10
  • 29 Run Commands in Windows You Should Know
  • How to Ping IP Address in CMD
  • How to Get IP Address Using Ipconfig in CMD
  • How to Delete Folder Using CMD in Windows 10
  • CMD Commands List You Should Know
  • How to Change Lock Screen in Windows 10
  • How to Show My Computer Icon on Desktop in Windows 10
  • How to Change Compatibility Mode in Windows 10
  • How to Uninstall Internet Explorer in Windows 10
  • How to Add or Change Desktop Theme in Windows 10
  • How to Disable Transparency Effects in Windows 10
  • How to Delete and Uninstall Fonts in Windows 10
  • How to Install New Fonts in Windows 10
  • How to Disable Lock Screen on Windows 10 Using Registry
  • How to Customize Action Center in Windows 10
  • How to Disable Cortana in Windows 10 using Registry
  • Battery Icon Missing From Taskbar in Windows 10 [Solved]
  • How to Change Desktop Background in Windows 10
  • How to Increase Battery Life of Windows 10 Laptop
  • How to Turn off Notifications in Windows 10
  • How to Create Keyboard Shortcuts in Windows 10
  • How to Change Desktop Icon Size in Windows 10
  • How to Turn On Dark Mode on Opera
  • How to Turn On Dark Mode on Mozilla Firefox
  • How to Turn On Dark Mode on Google Chrome
  • How to Turn On Dark Mode on Microsoft Edge
  • How to Enable Dark Mode in Windows 10
  • How to Increase Mouse Sensitivity in Windows 10
  • How to Find Which Programs are Slowing Down Your Boot Time in Windows 10
  • How to Defrag the Hard Drive in Windows 10
  • How to Copy and Paste Into Command Prompt in Windows 10
  • How to Enable the On-Screen Keyboard in Windows 10
  • How to Check Laptop Battery Health in Windows 10
  • How to Use Offline Maps in Windows 10
  • How to Calibrate Your Monitor in Windows 10
  • How to Enable God Mode in Windows 10
  • How to Increase Processor Speed in Windows 10
  • How to Pin a Folder to Taskbar in Windows 10
  • How to Pin a Website to Taskbar in Windows 10
  • How to Switch Between Desktops in Windows 10
  • How to Make Windows 10 Boot Faster
  • How to Stop Windows 10 From Sleeping
  • How to Set an Alarm Clock on Windows 10
  • How to Go Directly to Desktop in Windows 10
  • How to Create a New Folder on Windows 10
  • How to Reduce Blue Light on Computer Screen on Windows 10
  • How to Turn on Speech Recognition in Windows 10
  • How to Sync My Settings in Windows 10
  • How to Change the Screen Resolution on Windows 10
  • How to Create a New User on Windows 10
  • How to Turn Off Tablet Mode in Windows 10
  • How to Uninstall a Program on Windows 10
  • How To Change Password In Windows 10
  • Top Keyboard Shortcuts in Windows 10
  • How to Speed Up Windows 10 Shutdown
  • How to Change Default Browser in Windows 10
  • How to Disable the Lock Screen in Windows 10
  • How to disable User Account Control in Windows 10
  • How to Hide File Extensions in Windows 10
  • How to Show Hidden Files and File Extensions in Windows 10
  • How to Create a Restore Point with System Protection Enabled in Windows 10
  • How to Delete Browsing History on Firefox in Windows 10
  • How to Delete Browsing History on Microsoft Edge in Windows 10
  • How to Delete Browsing History on Google Chrome in Windows 10

You May Also Like

How to Install CAB File in Windows 10 using Command Line

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Save my name, email, and website in this browser for the next time I comment.

How to Configure Windows 10 IP Address with CMD?

' data-src=

Configuring IP address in a Windows with CMD performed using netsh command line utility. The network shell ( netsh ) is a set of commands that help you configure any Windows operating system IP address, Network Interfaces, and Windows Firewall. The usage of the command line is for pro level Windows users. Those who are playing the network infrastructure configuration. But using the command line as normal Windows user indicate your expertise to Windows environment. If you are new to Windows command line, this article “configure IP address with command prompt in Windows 10” will help you begin using command line interface.

Configuring Windows IPv4 Networking with Netsh or Network Shell. Netsh is a command-line utility included in Microsoft’s Windows NT line of operating systems beginning with Windows 2000. It allows local or remote configuration of network devices such as the NICs.

Configure IP Address with Command Prompt in Windows 10

Before setting IP address with cmd in Windows 10, you need to know how to find your IP address on Windows 10. So before everything, you must know the network IP address configuration on your system.

Let’s learn the process of IP configuration step by step. I am going to explain it with an easy pictorial guide. If you don’t understand some part, just kindly comment us and ask your questions.

The process of Changing Windows 10 IP Address with Command Prompt: 

  • Find your IP address in Windows 10.
  • View network interfaces card.
  • Change IP address on Windows 10.
  • Change DNS IP address with the command line.
  • Reset IP address with Command Prompt.

How to Find your IP Address on Windows 10?

There are many options for finding IP address on Windows 10. The easy one is “ ipconfig ” command. To find your IP address on Windows 10, just type “ ipconfig ” in command prompt. To do this process:

  • Press Windows+R keys to open the Run .
  • Type “ cmd ” in the run and press enter.
  • Now type “ ipconfig ” to show the IP address.

The “ ipconfig ” command shows everything about your computer network interfaces. You might have many physical or virtual network interface card.

How to Find Your IP Address on Windows 10 - Technig

Here, I just have one network interface on my Windows 10 computer. The result of ipconfig command shows that the IP 169.254.29.130 with the mask of 255.255.255.0 is my current Windows IP address.

This is a class C “autoconfiguration IPv4”. When your system doesn’t find any DHCP Server or manual IP address, it obtains auto IP address. So let’s change it.

How to C hange  IP Address with  Command Prompt?

For change IP address, open command prompt or PowerShell. Both works the same and you can run all command prompt commends on Powershell as well. Ok, run cmd or Powershell as administrator. Netsh work in both command prompt and Powershell. I’m using Windows Powershell to change IP address on Windows 10 completely. Becuase the user interface and color’s of Powershell is better than Command prompt.

  • Type “ Powershell ” in Windows 10 search box to run Windows Powershell.
  • You need to run Powershell as administrator. Just press Windows+Shift the press enter to run Powershell as administrator. Or right-click the Powershell and click Run as administrator .

PowerShell Guide in Windows 10

To find the network interface with the command line, type the following command on Powershell.

Netsh Command to Check Network Adapter in Windows 10

The result shows two network interfaces. The Loopback and the Ethernet. The Loopback is Windows builtin network loopback interface, but our pointed network interface is the ethernet.

To find your IP address in Windows 10 with netsh command, just type the following command.

How to Find Your IP Address on Windows 10 with Netsh Command - Technig

It displays all the network interface configuration. The output result is clear and better than output result of “ ipconfig ” command on Command prompt. So to find an exact information of the network interface, just add the index ID of the network interface at the end of the command.

How to Find Windows 10 IP address with Command Line - Technig

That’s good. Let’s configure and change Windows 10 IP address with the command line. The command is bit long but easy to understand. No need to remember, just try to understand the netsh command structure.

To change the IP address of the “Ethernet0” network interface, type the following command.

Change IP Address in Windows 10 using Command Line - Technig

Once the command executed successfully, check the result with “ netsh interface ipv4 show config 2 ” command. Yes, the output result shows the exact IP address has set on the “ Ethernet0 ” network interface. Now the Windows IP address is 200.100.10.5 with the mask of 255.255.255.0 and default gateway is 200.100.10.1.

Note : You can’t change the default gateway separately with the following command. It will remove the IP address and just set the default gateway address.

That’s good and enough for IP address configuration in Windows 10 with the command line. Let’s change DNS IP address from the command line.

  • Related :  MCSA Lab Manual Articles .

How to Change DNS IP address from Command Prompt?

DNS IP address is the unique address in the network that resolves computer name to IP address and IP address to the computer name. In the network, finding a computer with a name is easy than 32-bit IPv4 address. To set or change the DNS IP address, just simply do it with the following command.

How to Change DNS IP address from Command Prompt - Technig

You might see some error on a simple local network, because of not having a DNS server. When you don’t have a DNS server, it’s not necessary to set DNS IP address on your computer.

Configure IP Address with command prompt in Windows - Technig

Finally, recheck the result with “ netsh interface ipv4 show config 2 ” command. The output netsh command should be displayed with DNS IP address.

Final World

Configure IP address with command prompt in Windows has tow benefits. The first benefit of working with Windows command line helps get you improve your skills in Windows environment. The second benefit is command line is faster than GUI. If you work with the command line, you will understand the power of command line.

The Windows command line interface has improved a lot in Windows 10. Now you can find some Linux commands that run in Windows 10 and works the same on Linux. Finally, hope you learn how to configure IP address with Command Prompt in Windows operating systems. If you don’t understand, please ask us about how to configure IP address with command prompt in Windows 10?

' data-src=

How to Restore Backup in Windows Server 2022

How to change DNS zone settings in Windows Server 2022?

How to Share Files Over Network (Share Permissions) on Windows 11

Deny Users Access to PC Settings and Control Panel using Group Policy

' data-src=

I am thankful to you for your articles.

' data-src=

i changed my ip address and need it back

' data-src=

You are the greatest! I have been banging my head trying to find information on how to do this. 2 days and the only information I changed was “connected” to “not connected”, thank you so much

Your email address will not be published.

Save my name, email, and website in this browser for the next time I comment.

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Accept Read More

Welcome, Login to your account.

Recover your password.

A password will be e-mailed to you.

How to configure a static IP on Windows 10 or 11

Do you need to switch from a dynamic to a static IP address configuration on Windows 11 or 10? Here's how.

Windows 11 static IP

  • Windows 11 static IP
  • Windows 10 static IP

On Windows, the router's Dynamic Host Configuration Protocol (DHCP) server is (usually) responsible for assigning a dynamic Transmission Control Protocol/Internet Protocol (TCP/IP) configuration to every device in the network, including to your computer running Windows 11 or Windows 10.

Although a dynamic IP address is the recommended configuration for most situations, you may need to change to a static IP address if you're thinking about setting up a printer or file sharing, or you have to configure port forwarding on the router to your computer.

The reason is that a dynamic network configuration can change at any time after the lease from the DHCP expires and if the address changes, network resources you may have configured will stop working. Setting a static IP address will always stay the same on the computer, allowing a more reliable experience sharing resources in the network or forwarding ports.

Whatever the reason, on Windows 10 and 11, you have many ways to configure a static TCP/IP address, including using the Settings app and Command Prompt.

This guide will walk you through the different ways to configure a static network configuration on Windows 11 and 10.

How to set a static TCP/IP network configuration on Windows 11

On Windows 11, you can change your computer's dynamic IP configuration to static in at least two ways through the Settings app or commands.

Configure IP from Settings app

To assign a permanent TCP/IP configuration on Windows 11, use these steps:

  • Open  Settings .
  • Click on  Network & internet .
  • (Optional) Click on Advanced network settings .
  • Under the "More settings" section, click on Hardware and connection properties.
  • Note the current IPv4 ,  Subnet mask ,  Default Gateway , and  DNS server addresses to determine the new configuration, as it has to be in the same network scope.
  • Click the  Ethernet  or  Wi-Fi  page on the right side from the "Network & internet." page.
  • Quick note:  If you select the Wi-Fi page, you need to click on the connection properties to access the network settings.
  • Click on the  Edit  button for the "IP assignment" setting.
  • Select the  Manual  option from the drop-down menu.
  • Turn on the  IPv4  toggle switch.
  • Confirm the IP address for the computer – for example, 10.1.4.90.
  • Confirm the subnet mask for the configuration – for example, 255.255.255.0.
  • Confirm the default gateway address (usually your router's IP) – for example, 10.1.4.1.
  • Confirm the preferred DNS address – for example, 10.1.4.1.
  •   Quick note:  In a home network, you may also be able to use the router's IP address for the DNS configuration. You can also use third-party DNS services like Google Public DNS, Cloudflare, Cisco's OpenDNS, and others. 
  • (Optional) Select the  "On (automatic template)"  option for the "DNS over HTTPS" setting and leave the  "Fallback to plaintext"  option disabled unless you want to encrypted as well as unencrypted traffic or you're troubleshooting connectivity.
  • Quick note:  DNS over HTTPS (DoH) is a feature that encrypts the DNS queries over the HTTPS protocol to improve security and privacy on the internet. You only want to enable this feature if the DNS server supports this feature.
  • Confirm the alternate DNS address (if applicable).
  • (Optional) Select the  "On (automatic template)"  option for the "DNS over HTTPS" setting and leave the  "Fallback to plaintext"  option disabled.
  • Click the  Save  button.

Once you complete the steps, the computer will start using the static network configuration. If everything has been configured correctly, you should be able to open the web browser to access the internet.

If you entered an address (such as the DNS address) and then changed it, you probably won't be able to save the settings. If this is the case, cancel the configuration, start over, enter the correct configuration, and then try to save the settings.

Configure IP from Command Prompt

To set a static TCP/IP configuration on Windows 11, use these steps:

  • Open  Start .
  • Search for  Command Prompt , right-click the top result, and select the  Run as administrator  option.
  • Type the following command to see your current networking configuration and press  Enter : ipconfig /all
  • Confirm the name of the adapter and the networking configuration, including the IPv4 , Subnet mask , Default Gateway , and DNS Servers .
  • Type the following command to configure a static TCP/IP address and press  Enter :  netsh interface ip set address name= "ADAPTER-NAME" static IP-ADDRESS SUBNET-ADDRESS DEFAULT-GATEWAY-ADDRESS

In the above command, replace  ADAPTER-NAME  with the name of your network adapter. Change  IP-ADDRESS SUBNET-ADDRESS    DEFAULT-GATEWAY-ADDRESS  with the device IP address, subnet mask, and default gateway addresses you want. For example, this command sets the 10.1.4.90, 255.255.255.0, 10.1.4.1 configuration:  netsh interface ip set address name="Ethernet 10Gb" static 10.1.4.90 255.255.255.0 10.1.4.1

  • Type the following command to set a DNS server address and press  Enter :  netsh interface ip set dns name="ADAPTER-NAME" static DNS-ADDRESS  

In the command, change  ADAPTER-NAME  with your adapter's name and  DNS-ADDRESS  with the DNS server address of the network. For example, this command sets the local router as the DNS server:  netsh interface ip set dns name="Ethernet 10Gb" static 10.1.4.1

  • Type the following command to set an alternate DNS server address and press  Enter :  netsh interface ip add dns name="ADAPTER-NAME" DNS-ADDRESS index=2

In the command, change  ADAPTER-NAME  with the adapter's name and  DNS-ADDRESS  with an alternate DNS server address. For example, netsh interface ip add dns name="Ethernet 10Gb" 1.1.1.1 index=2

After you complete the steps, the commands will set a static network configuration on Windows 11.

How to set a static TCP/IP network configuration on Windows 10

On Windows 10, you can also use the Settings app and Command Prompt to set up a static IP network configuration.

To assign a permanent TCP/IP configuration on Windows 10, use these steps:

  • Click on  Ethernet  or  Wi-Fi .
  • Click on the active connection on the right side.
  • Click the  Edit  button for the "IP assignment" setting.
  • Select the  Manual  option.
  • Confirm the subnet prefix length (subnet mask) for the configuration – for example, 24 to specify the 255.255.255.0 subnet mask.
  • Quick tip:  It's important to use the number that represents the network instead of the subnet mask. Otherwise, the configuration won't save. If you don't know the subnet prefix length for your subnet mask, you can use any  online subnet calculator  to find out.

Once you complete the steps, Windows 10 will start using the static IP configuration. If you lose network connectivity, restart the computer to regain access to the local network and internet.

To change from dynamic to static IP address with commands on Windows 10, use these steps:

In the command, change  ADAPTER-NAME  with your adapter's name and  DNS-ADDRESS  with the DNS server address of the network. For example, this command sets the local router as the DNS server:  netsh interface ip set dns name=" Ethernet 10Gb" static 10.1.4.1

In the command, change  ADAPTER-NAME  with the adapter's name and  DNS-ADDRESS  with an alternate DNS server address. For example, netsh interface ip add dns name="Ethernet0" 1.1.1.1 index=2

After you complete the steps, the network configuration will switch from dynamic to static on Windows 10.

Get the Windows Central Newsletter

All the latest news, reviews, and guides for Windows and Xbox diehards.

Mauro Huculak

Mauro Huculak is technical writer for WindowsCentral.com. His primary focus is to write comprehensive how-tos to help users get the most out of Windows 10 and its many related technologies. He has an IT background with professional certifications from Microsoft, Cisco, and CompTIA, and he's a recognized member of the Microsoft MVP community.

  • 2 The possibilities are (almost) endless with this Verizon Fios deal that gets you a $300 gift card
  • 3 Windows Central Podcast #340: Windows 11 version 24H2 confirmed!
  • 4 TODAY ONLY: Grab the best PC gaming handheld at a HUGE discount and enjoy the Xbox Game Pass ecosystem anywhere
  • 5 The Sticky Notes app just got the biggest update since Microsoft shipped Windows 11, and no it has nothing to do with AI-powered features or Copilot this time

assign ip address in cmd

site logo

Change IP Address and DNS Servers using the Command Prompt

Just because it's more fun

Author avatar

The Command Prompt application, sometimes referred to as command shell, is found in most Windows NT-based operating systems. Its purpose is to execute specific commands for troubleshooting or solving specific Windows issues, performing advanced administrative functions, and automating tasks via batch files and scripts.

That said, you can also use it to change your IP address when you want to spoof it to bypass geoblocks or online bans on sites that impose such restrictions on their content, or change your Domain Name System (DNS) servers for troubleshooting reasons or to make surfing more secure and faster.

Change IP Address and DNS Servers using the Command Prompt image 1

In this guide, we’re going to show you how to change your IP address and DNS servers using the Command Prompt in Windows 10.

How To Change IP Address Using Command Prompt

An IP address holds information about your device, location, your internet service provider (ISP), and browser information.

Changing it is useful when you have a malfunctioning router that’s providing addresses used by a different computer on the network or an invalid address is accidentally configured.  It’s also helpful when you want to install a new router and reconfigure your home network to use the default IP address range.

Change IP Address and DNS Servers using the Command Prompt image 2

The first step to changing your IP address is to find the network name for the interface you want to change. 

  • Open an elevated Command Prompt by typing CMD in the search bar and clicking on Run as Administrator .

Change IP Address and DNS Servers using the Command Prompt image 3

  • Next, type netsh interface ipv4 show config in the command prompt window, press Enter, and scroll down to the interface you want.

Change IP Address and DNS Servers using the Command Prompt image 4

In our case, we’ll be modifying the WiFi interface, but you can pick the correct interface for your case. Make note of the interface name.  

  • To change the IP address, type this command: netsh interface ipv4 set address name=”YOUR INTERFACE NAME” static IP_ADDRESS SUBNET_MASK GATEWAY

In our example, this command would look like this: netsh interface ipv4 set address name=”Wi-Fi” static 192.168.0.173 255.255.255.0 192.168.0.0

Change IP Address and DNS Servers using the Command Prompt image 5

This command will use the Wi-Fi interface, set the IP address to 192.168.0.173, set the subnet mask to 255.255.255.0 and set the default gateway to 192.168.0.0.

If you want to switch to using an IP address automatically assigned by a DHCP server instead of a static IP address, use the netsh interface ipv4 set address name=”YOUR INTERFACE NAME” source=dhcp command.

How To Change DNS Servers Using Command Prompt

 A DNS server holds public IP addresses and related hostnames in a database, and is used to resolve or translate the hostnames to IP addresses. The server does this by running special software to communicate with other servers through special protocols based on certain requests from the computer. 

The conversion process is thoroughly vetted and verified, and it happens quickly behind the scenes so as to obtain information corresponding to the server that the computer is looking for, and then tells the original connecting computer where to go so that it can connect to that server.  

Change IP Address and DNS Servers using the Command Prompt image 6

There are several reasons why you’d want to change your default DNS server , but the main ones are:

  • Boost your privacy when getting around a firewall, bypassing geoblocks or ISP blocks on a website
  • Increase security
  • Parental controls like blocking websites from your router
  • Speed your surfing, which your own ISP’s DNS servers may not offer because they’re not always reliable or up-to-date

Note : You can change DNS servers individually for your home network on your router or on computers, smartphone, and Chromebook, among other devices

How To Change DNS Servers With Command Prompt

Follow the steps below to learn how to change DNS servers using Command Prompt.

  • Open an elevated Command Prompt by typing CMD in the search bar, and clicking Run as Administrator .

Change IP Address and DNS Servers using the Command Prompt image 7

  • Type netsh and press Enter .

Change IP Address and DNS Servers using the Command Prompt image 8

  • Next, type interface ip show config and press Enter .

Change IP Address and DNS Servers using the Command Prompt image 9

  • Find the network interface whose DNS server you want to change, and enter the netsh interface ipv4 set dns name=”YOUR INTERFACE NAME” static DNS_SERVER . This will set your primary DNS server.

From our example above, we changed the IP address for the “Wi-Fi” interface, so we’ll use the same example to change DNS servers. 

For purposes of this guide, we’ll use Google’s primary public DNS server, 8.8.8.8. The command will look something like this: netsh interface ipv4 set dns name=”Wi-Fi” static 8.8.8.8

Change IP Address and DNS Servers using the Command Prompt image 10

  • Next, type the netsh interface ipv4 set dns name=”YOUR INTERFACE NAME” static DNS_SERVER index=2 command to set the secondary DNS server. Again, we’ll use Google’s public DNS secondary server, 8.8.8.8  as an example, which will look like this: netsh interface ipv4 set dns name=”Wi-Fi” static 8.8.4.4 index=2.

Change IP Address and DNS Servers using the Command Prompt image 11

Note : You can use the netsh interface ipv4 set dnsservers name”YOUR INTERFACE NAME” source=dhcp command if you want the network interface to automatically pick DNS settings from a DHCP server. Continuing with our example, this command would look like this: netsh interface ipv4 set dnsservers name”Wi-Fi” source=dhcp

Command Prompt is a great tool to use when you want to change IP addresses and DNS servers. It’s faster and saves you the hassle of having to click through several windows and dialog boxes from the Control Panel interface just to get to the IPv4 Properties dialog box to do the same thing. 

Was this guide helpful? Let us know by dropping your comment in the section below.

' src=

Elsie is a technology writer and editor with a special focus on Windows, Android and iOS. She writes about software, electronics and other tech subjects, her ultimate goal being to help people out with useful solutions to their daily tech issues in a simple, straightforward and unbiased style. She has a BCom degree in Marketing and currently pursuing her Masters in Communications and New Media. Read Elsie's Full Bio

Read More Posts:

assign ip address in cmd

  • 90% Refund @Courses
  • Trending Now
  • Data Structures & Algorithms
  • Foundational Courses
  • Data Science
  • Practice Problem
  • Machine Learning
  • System Design
  • DevOps Tutorial
  • Web Development
  • Web Browser

Related Articles

  • DSA to Development
  • Global Unicast Address in CCNA
  • Configuring RIP Versions 1 and 2 in Cisco
  • What is IPv6 Stateless Address Autoconfiguration ?
  • How to Configure IPv6 on CISCO Router?
  • How to Find Your Default Gateway IP Address?
  • Configure IP Address For an Interface in Cisco
  • Link Local Address
  • IPv6 EUI-64 (Extended Unique Identifier)
  • Configuring a Loopback Interface in Cisco
  • Setting IP Address Using GUI
  • Difference Between Source Port and Destination Port
  • Configure IP Address for Interface in Cisco Switches
  • IPv6 Addressing Scheme in Cisco Router
  • How to Simulate Heavy Traffic on Packet Tracer?
  • What is Hyperconvergence?
  • OSPF Implementation
  • Private IP Addresses in Networking
  • Email Protocols
  • What is an Endpoint in Security?

Setting IP Address Using ipconfig Command

Setting up an IP address using the ipconfig command is a simple process that can be performed from any computer with an internet connection. This article aims to provide a step-by-step guide on setting up an IP address using the default gateway and the DNS server. This can be useful if you cannot access the internet or need to change your IP address. It is also useful if you are unsure of what your current IP address is.

Steps to Configure IP address in devices using ipconfig command in Cisco packet tracer:

Step 1: Open the Cisco packet tracer desktop and create a network topology peer-to-peer connection between two PCs as shown below:

assign ip address in cmd

Step 2: Configure PC0 and PC1 using the ipconfig command:

  • First, click on PC0 and go to the command prompt terminal.
  • Then, type the ipconfig command and configure the PC0 as shown below the image.
  • and verify the IP address by again typing only ipconfig in the terminal.

assign ip address in cmd

Similarly with PC1:

  • First, click on PC1 and go to the command prompt terminal.

assign ip address in cmd

Step 3: Verifying connection by pinging the IP address of PC1 in the PC0 terminal:

assign ip address in cmd

Whether you're preparing for your first job interview or aiming to upskill in this ever-evolving tech landscape, GeeksforGeeks Courses are your key to success. We provide top-quality content at affordable prices, all geared towards accelerating your growth in a time-bound manner. Join the millions we've already empowered, and we're here to do the same for you. Don't miss out - check it out now !

Please Login to comment...

author

  • CCNA IP Addressing

Improve your Coding Skills with Practice

 alt=

What kind of Experience do you want to share?

How to change from static to dynamic IP address on Windows 10

Are you using a static IP address? Here are four ways to switch to a dynamic configuration on Windows 10.

Avatar for Mauro Huculak

On Windows 10, you can configure a network adapter to use a static IP address manually, or you can use an automatically assigned configuration using the local Dynamic Host Configuration Protocol (DHCP) server.

Although using a static IP address is recommended for devices that provide services to network users, as its configuration never changes, it may come a time when you may no longer need this configuration, and a dynamically assigned network configuration will be more suited.

If you use a static IP address and need to switch to a dynamic configuration, it’s possible to perform this task in several ways, including using the Settings app, Control Panel, Command Prompt, and even PowerShell.

In this guide , you’ll learn the steps to remove a static IP address configuration to obtain a dynamic configuration from the DHCP server on Windows 10 .

Change to dynamic IP address (DHCP) from Settings

Change to dynamic ip address (dhcp) from command prompt, change to dynamic ip address (dhcp) from powershell, change to dynamic ip address (dhcp) from control panel.

To enable DHCP to obtain a TCP/IP configuration automatically on Windows 10, use these steps:

Open Settings on Windows 10.

Click on Network & Internet .

Click on Ethernet or Wi-Fi .

Click the network connection.

Under the “IP settings” section, click the Edit button.

Edit IP settings on Windows 10

Use the Edit IP settings drop-down menu and select the Automatic (DHCP) option.

Enable automatic (DHCP) IP address using Settings app

Click the Save button.

Once you complete the steps, the networking stack configuration will reset, and your device will request an IP address from the DHCP server (usually your router).

To switch from a static TCP/IP configuration to a dynamically assigned configuration using DHCP with Command Prompt, use these steps:

Open Start .

Search for Command Prompt , right-click the top result, and select the Run as administrator option.

Type the following command to note the name of the network adapter and press Enter

Network adapter name using Command Prompt

Type the following command to configure the network adapter to obtain its TCP/IP configuration using DHCP and press Enter :

In the command, make sure to change “Ethernet1” for the adapter’s name that you want to configure.

Enable DHCP on Windows 10 using Command Prompt

After completing the steps, the network adapter will stop using a static IP address, and it’ll obtain a configuration automatically from the DHCP server.

To remove a static IP and DNS addresses to use a dynamic configuration using PowerShell, use these steps:

Search for PowerShell , right-click the top result, and select the Run as administrator option.

Type the following command to note the “InterfaceIndex” number for the network adapter and press Enter :

Network interface information using PowerShell

Type the following command to enable the network adapter to obtain its TCP/IP configuration using DHCP and press Enter :

In the command, make sure to change “Ethernet0” for the adapter’s name that you want to configure.

Type the following command to enable the network adapter to obtain its DNS configuration using DHCP and press Enter :

In the command, change “3” for the InterfaceIndex for the adapter to configure.

Enable DHCP for dynamic IP assignment using PowerShell

Once you complete the steps, the IP and DNS addresses will be reset from the adapter, and your computer will receive a new dynamic configuration from DHCP.

To configure a network adapter to use a dynamic IP address using Control Panel, use these steps:

Open Control Panel .

Click on Network and Internet .

Click on Network and Sharing Center .

On the left pane, click the “Change adapter settings” option.

Network and Sharing Center in Control Panel

Right-click the network adapter and select the  Properties option.

Select the “Internet Protocol Version 4 (TCP/IPv4)” option.

Click the Properties button.

Ethernet1 Properties on Windows 10

Select the “Obtain an IP address automatically” option.

Select the “Obtain the following DNS server address automatically” option.

Enable dynamic IP address (DHCP) using Control Panel

Click the OK button.

After completing the steps, the statically assigned TCP/IP configuration will no longer be available, and the computer will automatically request a dynamic network configuration from the network.

Avatar for Mauro Huculak

Mauro Huculak is a Windows expert and the Editor-in-Chief who started Pureinfotech in 2010 as an independent online publication. He is also been a Windows Central contributor for nearly a decade. Mauro has over 12 years of experience writing comprehensive guides and creating professional videos about Windows, software, and related technologies, including Android and Linux. Before becoming a technology writer, he was an IT administrator for seven years. In total, Mauro has over 20 years of combined experience in technology. Throughout his career, he achieved different professional certifications from Microsoft (MSCA), Cisco (CCNP), VMware (VCP), and CompTIA (A+ and Network+), and he has been recognized as a Microsoft MVP for many years. You can follow him on X (Twitter) , YouTube , LinkedIn and About.me .

  • Windows Subsystem for Android gets January 2023 update
  • How to access Advanced startup (WinRE) on Windows 10

We hate spam as much as you! Unsubscribe any time Powered by follow.it ( Privacy ), our Privacy .

How to Assign Static IP Address to Your Devices

IP address

By default, your router assigns dynamic IP Address to every device that connects to it. This is called DHCP (short for Dynamic Host Control Protocol). But sometimes, we need our devices to have the same IP address (i.e. Static IP) every time it connects to the network. Reason being,

  • Access your computer from the Internet.
  • Share data between two devices on the same network.
  • Quickly access your Network Printer or NAS.
  • Use your computer as a media server.
  • Or your work WiFi requires you to use Static IP address.

IP address

What IP address should you choose?

If two devices on the network have the same IP address, then there will be conflicts. The Internet won’t work on one of them or both, depending on your router. So, it’s important to assign a unique IP address to your computer. There are a couple of ways to pick an unused IP address.

For instance– first  find your device’s IP address , say it’s  192.168.1.7 ; then keep the first three values (i.e. 192.168.1) as it’s and replace the last digit with some far number like  192.168.1.222 . Though make sure the last digit should be between a  0-255  range.

Assigning Static IP address to most devices is easy, just go to its network settings, look for DHCP option and turn it OFF. Once you do that, you’ll see a text area to enter Static IP address. Enter the new IP address there, save changes and that’s it.

So let’s see how to Assign Static IP address to various Operating Systems

1. Assign IP Address on Windows 10/8/7

You can do this quickly through the command line. You will need to first find your subnet mask, default gateway, and network adapter name. In my case, I’m on a Wi-Fi network, so the adapter name is Wi-Fi. To find yours just type the following command.

Once you get the output, find for the Network Adapter which has IP listed under it. The adapter name is a one-word name suffixed to the end of the Network Title. You will also need the Subnet mask and the Default Gateway Address.

adapter_name_command_line

Once you have the adapter name, Subnet Mask and Default Gateway, run the following command.

Wherein, Wi-Fi should be replaced by your adapter name and the IP, subnet mask and gateway address according to your configuration.

staticIP_cmd

This will change your IP address from DHCP to manual with the static IP address you have specified.

In case you find it too confusing, you are not alone. You can do the same via GUI which is much more intuitive. You’ll need the  Subnet Mask and Default Gateway Address . You can refer to the above step on how to find these details. Once you have noted down the address, click on  Start  Menu and type in  Network and Sharing Center.  Click once you see the Network and Sharing Center Icon.

Network_Sharing_Center_Start_Menu

Alternatively, if you are in Windows 10 then you can right-click on the Start menu and click on “ Network Connections “.

RightClickOnStartMenu_Windows10

A new window will open, click on  Change Adapter Options.

Change_Adapter_Options

Right Click on your Current Network Adapter ( like WiFi)  and choose  Properties.

Right_Click_NetworkAdapter

When the new window pops up, select  Internet Protocol Version 4(TCP/IPv4)   and click on  Properties.

IPv4_Properties

Once you get the pop-up window, select “ Enter the IP address you want ” and fil the IP Address, For Subnet Mask , and Default Gateway Address enter the values that you have noted down previously. Next, click on OK to save changes.

Manual_IP_Settings

To switch to dynamic IP, click on Obtain the IP address automatically. Once this is enabled, your system will start picking an IP address dynamically from the router.

2. How to setup static IP on Ubuntu

On Ubuntu, you can set a static IP Address via the terminal or GUI. Firstly, let’s start with the command line. Right-click anywhere on the desktop to open the terminal.

OpenTerminal_Ubuntu

Once the terminal window opens, we need to run a command. We need the subnet mask and network adapter name in order to set a static IP and to get that, run the following command on the terminal.

assign ip address in cmd

Once you have the subnet mask noted down, in my case, it’s 255.255.255.0, we can proceed further.

It is pretty simple and straight forward. We need to open the Network Adapter settings. To do that, click on the Network Icon at the top right corner of the desktop.

GUI_Network

Now, navigate on the active network and click on the expand button for more options. Click on Wired Settings to open the Network menu.

Wired_Settings_GUI

Once you get the Wired Settings dialogue, make sure you are on the Network page. Click on the Settings icon beside the active network to open the adapter properties.

assign ip address in cmd

When you get the pop-up, navigate to the IPv4 tab to change the IP settings.

IPv4_Tab

On the IPv4 tab, select the radio button which says “ Manual “. Some text fields will appear, you need to enter the IP address, Netmask and Gateway accordingly. Once it is validated, you can click on the Apply button to register the changes.

static_IP_GUI_Ubunty

Again you need to restart the network for the changes to take effect. You can do it manually via command line or just switch off and switch on the Network adapter. Once done, run ifconfig on the terminal to check the IP address. It should be the same IP address which you have specified earlier.

changed_IP_Config

3. How to setup static IP on Mac

If you are on macOS, setting static IP is quite similar to that of Ubuntu. But, here you don’t need the subnet mask or Default Gateway Address. Right click on the apple icon at the top left corner of the desktop. Click on  System Preferences  from the dropdown list.

mac_systemPreferences

Once the System Preferences dialogue box displays, navigate to Network and click on it to open the Network Settings

Network_Symbol

Alternatively, you can also hit Cmd+Space to trigger the Spotlight search. Type “ Network ” in the search bar and click on the icon once it appears. This will directly navigate you to the Network Settings.

network_on_spotlight

From the pop-up window, select an active network interface. For example, I am connected to a WiFi network so my active network is  Wi-Fi. Make sure you are on the active network tab and then click on  Advanced .

Network_Settings_menu

A new window will open the configuration settings for that adapter. Move over to the IP settings by clicking on the TCP/IP tab .

TCP_IP_tab

From the Configure IPv4 menu, choose Using DHCP with manual address.  Enter a static IP address in the IPv4 Address and leave the Subnet Mask and Router field as default. Click Ok to save the changes.

change_tcp_ip_Settings

Now when you do an ifconfig, the system should be using the static IP you have defined in the previous times. If the IP’s have not changed, try restarting the Wi-Fi and it should fix it.

To switch back to dynamic IP, move back to “ Using DHCP ” from the Configure IPv4 menu.

4. How to setup static IP on Android

Settings_menu_Android

The network which you are connected to should be on top of the list. Tap on the settings icon beside the Wi-Fi network name.

Wifi_connected_network

Once the pop-up opens, you will see IP settings at the bottom of the menu. The default option is “DHCP”. Tap on it to change the IP configuration.

IP_Settings_Android

Select “ Static ” from the presented drop-down menu. Enter the desired IP address and leave the other options as default. Make sure that other devices are not using the same IP. You can see the IP address of the other devices in your network by using a small utility called Fing . For a detailed process, check our article on how to find the IP Address of any Device on your network . Once you have entered the IP, click on Save to register the change. Now, your Android phone should start using the desired IP Address.

Manual_IP_Android

In almost all the Android version, you get the option to set static IP Address. For some rare older Android versions, you can use a third-party app like  WiFi Static . It’s free and it doesn’t require ROOT.

To switch back to dynamic IP, repeat the same procedure and select “DHCP” from the IP settings instead.

5. How to setup static IP on iPhone and iPad

If you are using an iPhone or iPad, then you can set static IP Address natively. You would need the Subnet Mask of your network. This can be obtained from the Wi-Fi settings and we would see to it in the further steps. To get started, click on the Settings icon in the dock to get to the Settings menu.

ios_Settings

Now on the Settings menu page, tap on Wi-Fi to get to the Wi-Fi settings.

Settings_page_wifi_ios

On the Wi-Fi page, you should see your connected Wi-Fi network at the top. Click on the “i” button beside it. This will open the Wi-Fi configuration window.

i_button_ios_wifi

Once the Wi-Fi settings page appears, you will see an option called “ Configure IP “. By Default, this would be set to automatic. Just below this option, you will see “ Subnet Mask “, note it down as we will need it in the further steps. In order to set static IP, we need to change Configure IP it to Manual. Tap on it and it will open the IPv4 settings page.

Configure_ip_page

There should be 3 options available on the “Configure IPv4” page. Select “ Manual ” from it. As soon as Manual IP is enabled, you will get extra text fields at the bottom to enter the IP Address, Subnet Mask, Router. We need to fill in the IP Address of our choice and Subnet Mask which we noted down in the previous step. Now, after you fill both the fields, the save button at the top right corner will be enabled. Click on it to save the static IP configuration.

IPv4_Configuration_Menu

Now, when you return to the Wi-Fi settings page, you will see your device is using the Static IP address. This should be the same IP address we have set in the IP configuration menu.

ipaddr_ios

This static IP address will be applicable only to that particular Wi-Fi network. In case, you connect to some other Wi-Fi network the IP will change accordingly.

6. How to setup static IP to any Device from Router

Other network devices like your  Wireless Printer, PS4, NAS, IP Camera, Raspberry Pi , etc. do not have an Interface. Hence, in order to configure the network, either you have to connect remotely or use the router. If you have access to the router, setting Static IP for network devices is the easiest and convenient way. I would recommend this method over any other.

So, to assign a Static IP Address to any network device, you need to login to the web portal of the router. The web portal address, username, and password are mostly printed behind the router. In case you don’t have physical access to the router, the web portal URL is mostly the PC’s gateway address. To find that, open command prompt and type the following command.

Once you have the web portal loaded, log in with the credentials. Now every router has a different web UI, but the overall structure is the same. Basically,  you will have to link the IP Address to the Mac Address and Hostname of the device. So, we need to find the MAC address & Hostname of the network device. To do that, look for DHCP client list which should look something like the following screenshot.

MAC_address_Router

You can get your MAC Address & Hostname under DHCP Client list. Once, you have the MAC address & Hostname noted down, we can proceed further. On most of the routers, you will have the option to set a Static IP under the section  IP Mac binding or DHCP Static IP  option. In case you are on a custom ROM like dd-wrt, head over to Services tab and you will have DHCP Server . Under DHCP Server, add an entry for Static Leases by clicking on the Add button.

Static_leases_router

Clicking on the Add button will create a new row. You have to enter the MAC Address, Hostname, desired Static IP and Lease time . Lease time is a unit in minutes after which your IP will be renewed. Since we are adding only 1 entry for the particular host the IP will be the same even after the renewal. Once, done click on Save changes .

staticIPSetting_Router

Once you have configured successfully on the router, just restart the Wi-Fi on the device. When it connects it should start using the static IP. In case of issues, make sure that you have the correct MAC Address and Hostname. To check, just run the command ipconfig or look back again in the router’s DHCP client list.

ipconfig_newIP

These changes are written to the ROM so restarting the router won’t make changes to the static IP configuration. In order to get back to Dynamic IP, just remove the entry from the IP leases.

What’s next

Once you have started configuring the IPs on Router and network devices, you are good to go configure telnet and SSH. Have a look at our brief article on  How to Enable Telnet Server in Windows 10 ,  Best SSH clients for iOS To Manages Remote Servers and  6 Best FTP Clients For Android . A word of caution would be to note down the static IPs assigned to devices as assigning the same IP to two network devices would render them useless.

Also Read:  How To Change DNS on Windows|Mac|Android|iOS

' src=

Mrinal Saha

Mrinal is a tech geek who spends half of his day reading and writing about tech. While the nights are spent on shooting or editing YouTube videos. Feel free to geek out with him on-

You may also like

How to use travel mode on apple vision..., 10 fixes for tiktok couldn’t upload video error, 10 fixes for amazon fire tv stick stuck..., why am i getting notifications when someone posts..., top 7 fixes for too many attempts error..., how to create and share stickers on whatsapp, what do various icons and symbols mean in..., 7 fixes for tiktok not showing comments on..., how to edit sent messages on instagram, how to delete saved passwords from google chrome.

Stack Exchange Network

Stack Exchange network consists of 183 Q&A communities including Stack Overflow , the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

How to change IP address using script on Windows?

I need fixed IP in three wireless networks I log in frequently.

It is a pain to set those IP and gateway everytime I change networks.

I am willing to write a script to change my IP and gateway between those 3 fixed IPs and a choice to make it get IP automatically (when I´m in another network).

A plus feature to my script would be if it could discover the wireless network I am logged in and decide the IP automatically.

Is it even possible?

Diogo's user avatar

  • possible duplicate of How can I switch between multiple sets of network configurations on Windows XP? –  Breakthrough Nov 24, 2011 at 12:43

5 Answers 5

ipconfig /renew to get a new IP address or default gateway The NETSH command does this. check this .

See this example for setting DNS address manually via netsh command:

configure your NIC to dynamically obtain its DNS settings ( * Obtain DNS server address automatically ):

and to set the * Obtain an IP address automatically setting:

More info: read this Configure TCP/IP from the Command Prompt and How to change IP address from command prompt .

This is assuming 3 things.

1) The network adapter you're trying to change the IP for is "local area connection". It could also be "local area connection 2" or "wireless network connection". Look in your control panel for the correct name.

2) The IP you want to set is 192.168.0.101, change this to whatever IP to want to use.

3) The default gateway and dns are the same IP. If you are using some kind of router they usually are. Change this to match your network config found with the command ipconfig /all

Here is example of batch file that I have created for your problem solutions: just change the command after the con1: type labels

How to create batch file: paste this code in notepad and save it as "test.bat"

Note: Change your connection names "local area connection" to your "wireless connection" name

Hope this help you.. for more reference check this Set Your IP Address Via Batch File

David d C e Freitas's user avatar

  • I get Adapter is not enabled for DHCP when trying ipconfig /renew "Wireless Network Connection" –  Hrvoje T Mar 28, 2018 at 8:10
  • I used this netsh interface ip set address "Wireless Network Connection" dhcp and this for auto dns netsh interface ip set dns "Wireless Network Connection" dhcp –  Hrvoje T Mar 28, 2018 at 8:26
  • 1 To set dns manualy, I had to use netsh interface ipv4 add dnsserver "Wireless Network Connection" address=8.8.8.8 index=1 from here stackoverflow.com/questions/18620173/… –  Hrvoje T Mar 28, 2018 at 9:10

You can make a .bat script file that contains the configuration commands based on "netsh" command, for example :

This changes the IP address and Default Gateway: "netsh int ip set address "local area connection" static {192.168.0.101} 255.255.255.0 {192.168.0.254} 1" This changes DNS: "netsh int ip set dns "local area connection" static {192.168.0.254} primary"

Community's user avatar

I know this is very old thread but still it can be useful to many like me.

As per the op asked for WiFi, I have created a batch script for Wi-Fi. It will fetch current Wi-Fi connected and based on that set Static IP or DHCP.

Here is the script -

You should save this a batch file and run that batch file as %% in for command will not work in command prompt.

TIP: You can also add this in Task Scheduler with Trigger as below and Action with above batch path

In Windows 10 & 11, you can set the IP configuration as well as DHCP / Static settings for each Saved WiFi network also.

Sachin's user avatar

Run this on CMD as admin:

back to dhcp:

"Local Area Connection" can be different in your case

Toto's user avatar

in this cmd how to set dns netsh interface ip set address name = "Local Area Connection" static 192.168.1.1 255.255.255.0

vijaiprabu's user avatar

  • As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center . –  Community Bot Nov 23, 2021 at 10:08

You must log in to answer this question.

Not the answer you're looking for browse other questions tagged windows-7 ..

  • The Overflow Blog
  • Would you trust an AI bot to find the fix for vulnerabilities in your code?
  • Who owns this tool? You need a software component catalog
  • Featured on Meta
  • Site maintenance - Saturday, February 24th, 2024, 14:00 - 22:00 UTC (9 AM - 5...
  • Upcoming privacy updates: removal of the Activity data section and Google...

Hot Network Questions

  • Is it okay for a co-author to share an unfinished manuscript with others?
  • How may I reproduce chemical structure drawings?
  • Strings without twin letters
  • Can I walk to the Netherlands from Weeze, Germany (NRN)?
  • Conveying 'So bad it's good' talking about movies, TV shows
  • Is it bad practice to cite online news articles in solely because it's not a "reputable" source (i.e journal articles or even books)?
  • What was the ‘obvious’ new answer to Asimov’s Pâté de Foie Gras made possible by scientific advance?
  • The meaning of 我看你呀
  • A co--ection of images
  • Could Israel's PM Netanyahu get an arrest warrant from the ICC for war crimes, like Putin did because of Ukraine?
  • How "Zero" is this supposedly Zero-TCR resistor? And how much better is it than this other one?
  • How to optimally bet on a biased coin?
  • What legal rights does a german landlord have over you if you stop paying rent?
  • Can you use two weapon fighting on a bonus action after casting a spell with war caster?
  • Early computer art - reproducing Georg Nees "Schotter" and "K27"
  • How to easily avoid circular dependencies
  • What is this Bottom Bracket tool called?
  • Effectiveness of sdmem on a VPS?
  • What is the best, or most logical way to have my dragon breath lightning
  • How to deal with failing ideas?
  • Why is the SSH server asking for a password even if I specify a valid key?
  • The Devil's Shell Game
  • BJT as current buffer for op amp
  • What is the difference between 本性 and 正体?

assign ip address in cmd

This browser is no longer supported.

Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.

Set-Net IPAddress

Modifies the configuration of an IP address.

Description

The Set-NetIPAddress cmdlet modifies IP address configuration properties of an existing IP address.

To create an IPv4 address or IPv6 address, use the New-NetIPAddress cmdlet.

Example 1: Modify an IP address

This command adds the IP address 192.168.0.1 to the interface located at index 12.

The PrefixLength parameter may also be specified as part of the Set-NetIPAddress cmdlet.

Example 2: Modify an IP address and set the valid lifetime

The first command creates a new TimeSpan object of one day, and stores it in the variable named $Timesp.

The second command then uses the TimeSpan object to set the preferred lifetime of the IP address located at interface 12 to one day.

-AddressFamily

Specifies an array of IP address families. The cmdlet modifies the IP address configuration that matches the families. The acceptable values for this parameter are:

-- IPv4 -- IPv6

-AddressState

Specifies an array of duplicate address detection (DAD) state values for the IP address. The acceptable values for this parameter are:

  • Invalid. IP address configuration information for addresses that are not valid and will not be used.
  • Tentative. IP address configuration information for addresses that are not used for communication, as the uniqueness of those IP addresses is being verified.
  • Duplicate. IP address configuration information for addresses for which a duplicate IP address has been detected and the current IP address will not be used.
  • Deprecated. IP address configuration information for addresses that will no longer be used to establish new connections, but will continue to be used with existing connections.
  • Preferred. IP address configuration information for addresses that are valid and available for use.

Runs the cmdlet as a background job. Use this parameter to run commands that take a long time to complete.

-CimSession

Runs the cmdlet in a remote session or on a remote computer. Enter a computer name or a session object, such as the output of a New-CimSession or Get-CimSession cmdlet. The default is the current session on the local computer.

Prompts you for confirmation before running the cmdlet.

-IncludeAllCompartments

Indicates that the cmdlet includes addresses from all configured network compartments. If you do not specify this parameter, the cmdlet modifies only addresses in the default network compartment.

-InputObject

Specifies the input object that is used in a pipeline command.

-InterfaceAlias

Specifies an array of aliases of network interfaces. The cmdlet modifies IP addresses that match the aliases.

-InterfaceIndex

Specifies an array of indexes of network interfaces. The cmdlet modifies IP addresses that match the indexes.

Specifies an array of IPv4 or IPv6 addresses.

Returns an object representing the item with which you are working. By default, this cmdlet does not generate any output.

-PolicyStore

Specifies a PolicyStore value. The acceptable values for this parameter are:

-- ActiveStore. The IP address information is valid. -- PersistentStore. The computer saves IP address information across restarts. When the computer restarts, it copies the saved settings to the ActiveStore.

The default value is ActiveStore. Specify ActiveStore only.

If you do not specify this parameter, the default entries are created in both the ActiveStore and the PersistentStore.

-PreferredLifetime

Specifies a preferred lifetime, as a TimeSpan object, for an IP address. To obtain a TimeSpan object, use the New-TimeSpan cmdlet.

-PrefixLength

Specifies a prefix length. This parameter defines the local subnet size, and is also known as a subnet mask.

-PrefixOrigin

ps_deprecate_para

-SkipAsSource

Indicates whether an address is a primary IP address. This parameter identifies the primary IP address for outgoing traffic in a multiple IP address scenario. If this parameter is set to True, the address is not used for outgoing traffic and is not registered in DNS.

-SuffixOrigin

Specifies an array of origins for address suffixes. IP addresses are divided into two parts, the prefix and the suffix. The address prefix identifies the network portion of an IP address, and the address suffix identifies the host portion. The acceptable values for this parameter are:

-- Manual. The IP address suffix was manually specified. -- WellKnown. The IP address suffix is from a well-known source. -- DHCP. The IP address suffix was provided by DHCP settings. -- Link. The IP address suffix was obtained from the link-layer address. -- Random. The IP address suffix was obtained from a random source.

-ThrottleLimit

Specifies the maximum number of concurrent operations that can be established to run the cmdlet. If this parameter is omitted or a value of 0 is entered, then Windows PowerShell® calculates an optimum throttle limit for the cmdlet based on the number of CIM cmdlets that are running on the computer. The throttle limit applies only to the current cmdlet, not to the session or to the computer.

Specifies an array of IP address types. The acceptable values for this parameter are:

-- Unicast -- Anycast

The default value is Unicast.

-ValidLifetime

Specifies a valid lifetime, as a TimeSpan object, for an IP address. To obtain a TimeSpan object, use the New-TimeSpan cmdlet.

Shows what would happen if the cmdlet runs. The cmdlet is not run.

CimInstance

The Microsoft.Management.Infrastructure.CimInstance object is a wrapper class that displays Windows Management Instrumentation (WMI) objects. The path after the pound sign ( # ) provides the namespace and class name for the underlying WMI object.

Related Links

  • New-TimeSpan
  • Get-NetIPAddress
  • New-NetIPAddress
  • Remove-NetIPAddress

Was this page helpful?

Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see: https://aka.ms/ContentUserFeedback .

Submit and view feedback for

Additional resources

Tecmint: Linux Howtos, Tutorials & Guides

How to Use IP Command in Linux [24 Useful Examples]

Brief: In this guide, we will discuss some practical examples of the ip command. By the end of this guide, users will be able to perform networking tasks efficiently in Linux from the command line interface.

System administrators often need to perform networking tasks on Linux servers. There are a variety of graphical and command-line tools available in the market. However, most Linux users prefer to use the ip command due to its simplicity and rich functionality.

The ip command is a new networking command-line utility that is used to assign an IP address to a network interface or configure/update useful network variables on a Linux system.

It is a part of the iproute2 package and offers several network administration tasks such as bringing up or down network interfaces, assigning and removing IP addresses and routes, managing ARP cache, and much more.

The ip command is much similar to the old ifconfig command , but it is greatly more powerful with more functions and capabilities added to it.

[ You might also like: Deprecated Linux Networking Commands and Their Replacements ]

The ifconfig command has been deprecated and replaced by the ip command in all modern Linux distributions. However, the ifconfig command is still works and available for most Linux distributions .

[ You might also like: ifconfig vs ip: What’s Difference and Comparing Network Configuration ]

Table of Contents

Note: Please take a configuration file backup before doing any changes.

1. Permanently Configure Static IP Address in Linux

To permanently configure a static IP address in Linux, you need to update or edit the network configuration file to assign a static IP address to a system. You must be a superuser with a su (switch user) command from the terminal or command prompt.

Set Static IP Address in RHEL Systems

Open and edit the network configuration files for ( eth0 or eth1 ) using your favorite text editor . For example, assigning IP Address to eth0 interface as follows on RHEL-based distributions .

Configure Static IP in RHEL Systems

Set Static IP Address in Debian Systems

To configure the permanent static IP address, you need to modify your network interface configuration file /etc/network/interfaces to make permanent changes as shown below for Debian-based distributions .

Configure Static IP in Debian Systems

Next, restart network services after entering all the details using the following command.

[ You might also like: How to Configure Network Connection Using ‘nmcli’ Tool ]

2. Temporary Configure Static IP Address in Linux

For temporary network configurations, you can use the ip command to assign an IP address to a specific interface ( eth2 ) on the fly.

Note: Unfortunately all these settings will be lost after a system restart.

3. How to Display All Network Interfaces

In ip command , the link object represents the network interface. We can use the show command with it to display all network interfaces.

Now, let’s display all network interfaces using the following command:

Check IP Addresses of Network Interfaces

The above output shows the details of all network interfaces, such as interface name, flags, status, link address, broadcast address, etc.

4. How to Check an IP Address of a Specific Network Interface

To get the depth information of your individual network interface like IP Address, and MAC Address information, use the following command as shown below.

Check IP Address of Network Interface

So far, we used the link object shows detailed information about the network interfaces. However, it doesn’t show the IP address associated with the network interface. To overcome this limitation, we can use the addr object with the ip command.

Let’s understand this with an example.

Check IP Address of Interface

Here, we can see that, now output shows the IP addresses of all network interfaces along with other details.

To display the IP address of the individual network interface, just need to provide the network interface name as an argument to the command.

5. How to Display IP Address in Colored Output

The ip command shows detailed information about the network objects. However, sometimes we need to take a look at the limited information. In such cases, we can enable the colored output. This option highlights important details in different colors.

Let’s use the --color option of the command to display the output in different colors:

Show IP Address in Color Output

In the above output, we can see that the interface name, ethernet address, and state are highlighted in different colors.

6. How to Display IP Address in JSON Format

In the previous examples, we saw that the ip command shows meaningful information. However, it is not an easy task to parse the raw output and extract meaningful information using rudimentary scripts. In such cases, we can instruct the ip command to generate the output in a JSON format.

So, let’s use the -j option with the command to display the same output in a JSON format:

Show IP Address in JSON Format

This method comes in handy while doing automation because JSON is a widely accepted format and there are many JSON parser libraries/tools available in various programming languages.

7. How to Make JSON Output More Readable

In the previous example, we used the -j option to display output in a JSON format. This default JSON format is compact and space efficient. However, the output is not easy to read due to a lack of indentation.

To overcome this limitation, we can use the -p option which makes the output more readable by indenting it. Let’s understand this with the below example:

Show IP Address in Readable Format

Here, we can see that the same output is much more readable as compared to the previous examples.

8. How to Remove an IP Address From the Network Interface

In the previous example, we used the add sub-command to assign an IP address. In a similar way, we can use the del sub-command to remove a particular IP address.

The following command will remove an assigned IP address from the given interface ( eth2 ).

Now, let’s verify that the IP address has been removed:

Remove Network IP Address in Linux

In the above output, we can see that the now eth2 network interface has only one IP address.

9. How to Enable the Network Interface

The “ up ” flag with interface name ( eth2 ) enables a network interface. For example, the following command will activate the eth2 network interface.

Now, let’s check the updated status:

Enable Network Interface in Linux

10. How to Disable the Network Interface

The “ down ” flag with interface name ( eth2 ) disables a network interface. For example, the following command will De-activates the eth2 network interface.

Now, let’s check the status of the eth2 network interface:

Disable Network Interface in Linux

The above output shows the modified state of the network interface.

11. How to Flush IP Addresses of Network Interface

In the previous example, we saw how to use a del sub-command to remove an IP address. However, sometimes we need to remove all IP addresses of the particular network interface. In such cases, we can use the flush sub-command.

First, use the flush sub-command to remove all the IP addresses of the eth2 network interface:

Now, let’s check that all IP addresses of the eth2 network interface have been removed:

Flush Network IP Addresses in Linux

In the above output, the addr_info field shows the empty JSON array. This indicates there isn’t any IP address associated with the eth2 network interface.

12. How Do I Check Routing Table

A routing table stores the necessary information to forward a network packet to the correct destination. We can use the route object of the ip command to display the routing rules.

Let’s use the below command to list the all rules of the routing table:

Check Network Routing Table

In the above output, the first column represents the destination whereas the last column represents the source IP address.

13. How Do I Add New Static Route

Why do you need to add static routes or manual routes, because the traffic must not pass through the default gateway? We need to add static routes to pass traffic from the best way to reach the destination.

Now, let’s verify that the entry has been added successfully:

Add Network Route in Linux

15. How to Remove Static Route

The del sub-command removes a particular entry from the routing table. For example, the below command removes the entry of the eth2 device route:

Now, let’s verify that the entry has been removed successfully:

Remove Network Route in Linux

16. How Do I Add Permanent Static Routes

All the above routes will be lost after a system restart. To add a permanent static route, edit file /etc/sysconfig/network-scripts/route-eth2 (We are storing static route for ( eth2 ). By default, the route-eth2 file will not be there and need to be created.

Set Permanent Route in RHEL Systems

and add the following lines and save and exit.

Set Permanent Route in Debian Systems

Open the file /etc/network/interfaces and at the end add the persistence static routes. IP Addresses may differ in your environment.

17. How Do I Add the Default Gateway

In networking, the default gateway plays an important role. It gets used when the routing table doesn’t contain any information about the destination.

The default gateway can be specified globally or for interface-specific config files. The advantage of the default gateway is that we have more than one NIC present in the system. You can add the default gateway on the fly as shown below the command.

First, let’s add an eth0 network interface as a default gateway:

Now, let’s verify the default gateway setting using the following command:

Add Network Gateway in Linux

Please note that we have executed this command on a test machine. Be careful while using this command in the production environment.

18. How to Remove a Default Gateway

We can use the following command to remove the default gateway:

Now, let’s list the routing table to verify the default gateway has been removed:

Remove Network Gateway in Linux

19. How to Display ARP Cache

ARP stands for the Address Resolution Protocol , which is used to find the MAC address associated with the particular IP address.

We can use the neigh object with the ip command to display the ARP cache:

Check ARP Cache in Linux

In the above command, the neigh represents neighboring objects.

20. How to Add an ARP Entry

To create a new ARP entry, we can use the add sub-command with the neigh object.

Now, let’s list the ARP cache entries:

Add ARP Cache in Linux

In the above output, we can see the new entry for the eth2 network interface.

21. How to Remove an ARP Entry

Like other network objects, we can use the del sub-command to remove the ARP entry. For example, the below command removes the ARP entry of the eth2 network interface:

Now, let’s verify that the entry has been removed by listing the ARP cache:

Remove ARP Cache in Linux

22. How to Flush the ARP Entries

We can use the flush sub-command to remove multiple ARP entries. To understand this, first, add a few ARP entries with the STALE state:

Next, verify that the new entries have been added successfully:

Then, flush all the entries using the below command:

Finally, verify that all the entries have been removed:

Flush ARP in Linux

23. How to Set MTU for Network Interface

MTU stands for Maximum Transmission Unit , which represents the largest packet size that can be transmitted in a single transaction. We can manipulate the MTU size as per our performance requirements.

First, let’s find the MTU of the eth2 network interface:

Next, update the MTU size of the eth2 network interface to 3000 :

Finally, verify that the MTU has been updated successfully:

Set Network MTU in Linux

24. How to Change the Network Mac Address

The ip command allows us to change the MAC address of the network interface. To achieve this, we can use the set sub-command with the link object:

First, list the current MAC address of the eth2 network interface:

Next, change the MAC address of the network interface using the below command:

Finally, verify that the MAC address has been changed:

Change Network MAC Address in Linux

Please refer manual page doing man ip from the terminal/command prompt to know more about IP Command.

In this article, we discussed some common examples of the ip command . One can use these examples in day-to-day life to perform network administration.

Do you know of any other best example of the ip command in Linux? Let us know your views in the comments below.

Previous article:

Next article:

Photo of author

Each tutorial at TecMint is created by a team of experienced Linux system administrators so that it meets our high-quality standards.

Related Posts

Extract Linux Tar Files Different or New Directory

How to Extract Tar Files to Specific or Different Directory in Linux

Debian Goodies Utilities to Manage Debian Packakges

8 Useful ‘Debian Goodies Utilities’ for Package Management

Delete User Accounts with Home Directory in Linux

How to Delete User Accounts and Their Home Directories in Linux

Find and Kill Running Processes in Linux

How to Find and Kill Running Processes in Linux

Set System Time, Date and Timezone in Linux

How to Set Time, Timezone and Synchronize System Clock in Linux

FFMPEG Command Examples in Linux

15 Must-Know FFmpeg Commands for Video, Audio & Image Conversion

36 thoughts on “How to Use IP Command in Linux [24 Useful Examples]”

I have Debian buster on my laptop. It defaults to nm. But I used network/interfaces years ago.

Calm down. Netplan is not in charge yet here, in Ubuntu 18 bionic beaver desktop. We may also run into trouble with resolvconf.

grep ‘^ *renderer: *NetworkManager’ /etc/netplan/01-network-manager-all.yaml && { [do stuff] } || echo netplan has superseded NetworkManager here\, \”man netplan\”

Your info is deprecated. For example:

There is netplan in Ubuntu now.

To add permanent Static route, edit file /etc/sysconfig file. There is no /etc/sysconfig directory at all.

Do you know why Ubuntu has implemented netplan? Is it across all Debian distro’s?

We are quite rapidly heading towards 2 distinct branches of Linux; RH based for enterprise, and Ubuntu/Debian for developers.

I think you should ask Canonical about this but not me. I’m usually remove this and configuring network by networkd.

September 9, 2018, Ubuntu bionic beaver desktop, netplan is not in charge here:

grep ‘^ *renderer: *NetworkManager’ /etc/netplan/01-network-manager-all.yaml && { sudo /etc/init.d/networking stop sudo ip addr add 192.168.1.1/24 dev $eth1

} || echo netplan may be in charge\, \”man netplan\”

A big thank’s

Problem with setting static IP.

Done static route through GUI and on reboot I get no WAN. Also my “ eth0 ” shows up as “ enp2s0 ” not sure how it got that way. (wired only, wireless off, set IPv6 as Link Local Only) Does Linux Mint 18.3 require IPv6 to connect to WAN ? The only way to restore my network is set to Auto DHCP and restart.

Thank you .

Your process was clean and tidy and it worked.

May I ask: I have taken over a slightly mis-configured system in my new position, and found some ifcfg-*** files that have quotation marks around some of the parameters.

I am wondering if these quotes have an affect on the system, or if they are simply one persons preference?

Please see below:

I don’t find any problem with the quotes but wonder why they are there.

Thanks it’s really a useful tutorial. May I ask, how can i config wireless network in red hat 6?

Thanks for this great post, but may I have two questions, not related directly to your article, but I think you can help me.

1. How to change IP address to another IP “Say I am from Egypt and I need ip from USA”

2. Is there any way to know the current speed of my internet connection.

Looking for your reply, Mohamed Elhosary

Most welcome to ask any queries, we love to help you out, regarding your first question.

1. I didn’t understand what you mean here? I think you want to change IP address of the server? if yes read this article:

How to Set Static IP Address in Linux

2. There are tons of online speed test tools, one the most popular one is: http://www.speedtest.net/

Thanks for this, any chance you could write something to show how to set up home network, for noobs, when you are trying to access shares from a win 7 machine from a Linux machine?

Hi That was so practical and useful, thank you.

in my centos 6.5, I am using two interfaces. eth0 for public ip and eth1 private ip. I have made default gateway to public ip. But for other purpose, I need private ip for connetion to other system.

I have added static routes but they are lost when system reboots. So I add persistent route

# vi /etc/sysconfig/network-scripts/route-eth1 192.168.20.0/24 via 192.168.50.100 dev eth1

when I save this , then the system indicates that eth1 is disconnected. Any suggestion?

To keep this route at system boot you should add this entry to /etc/rc.local file, this file executes when system boots so whatever you add this will auto start at system reboot..

Very good article. Could you please suggest me on the following ?

I have a requirement where I have a Ubuntu system and many devices wants to talk to this and this system wants to talk to them. Some are having different subnet though they are connected to same layer-2 switch. I am in dilemma, whether to use ip aliasing or vlan. Any suggestion please.

Thanks, Subbarao

@Venkata, Better I suggest you to assign same network range to all machines or either do a routing..

Hi Sir! i have follow by your command line successful , i’m so thank you so much !! :D

Very usefull post ;-)

Compact size tutorial – good work! I used it once already. Thanks.

great tutorial

Very good article with simple steps

hello, thank you for tutorial that you & your team made they are so good please i have a problem i have already a public @ IP assigned to my dedicated server but i bought another failover @ip please how can i add it to my dedicated server so i can assign to it a domain name

Best regards,

PS: my interface file : # This file describes the network interfaces available on your system # and how to activate them. For more information, see interfaces(5).

# The loopback network interface auto lo iface lo inet loopback

# The primary network interface auto em1 iface em1 inet dhcp

Ubuntu 14.04.1

In your instructions above, the first time you mention to restart the network services you have:

# /etc/init.d/networking restart

$ sudo /etc/init.d/networking restart

This should be

# /etc/init.d/network restart

$ sudo /etc/init.d/network restart

like you have near the end of the article.

I noticed that these two commands behave differently:

ip link set eth0 down & ip link set dev eth0 down

When dev is not used, the link state is brought down and stays down. Otherwise it will come up again soon after executing the command. The difference between the commands does not appear to be documented anywhere. Would you happen to know exactly what happens when running the commands and where the difference in behaviour stems from?

great article as always

but quick question thou what’s the difference between ifup and ip link set ???

Bro, ifup command is used to up network interface and ip command is used to assign IP address, Netmask, Gateway etc..

hello, can we tweak keyboard keys at user level. we use Redhat 5.9 64 bit workstations. For example i want Num Lock as Tab & so on…..

Thanks in advance

Nice one…

Okk if some one change my ip address ,subnet mask or try to play with it can i view the trail logs or anything simillar ????

Use history command to view last executed commands.

My static ipv4 address was not showing on eth0 but it is showing on ifconfig… I want to change my ip address how it is possible without eth0.

Superb article……

Great article first of all !

This command is very much similar to “IFCONFIG”. “sudo ifconfig eth1 up” replaced by “sudo ip link set eth1 up”.

That’s really cool !

provide tips for gcov and lcov in linux

Never heard about these tools, but we do try our best to provide you an how-to soon. Please stay updated..

Got something to say? Join the discussion. Cancel reply

Thank you for taking the time to share your thoughts with us. We appreciate your decision to leave a comment and value your contribution to the discussion. It's important to note that we moderate all comments in accordance with our comment policy to ensure a respectful and constructive conversation.

Rest assured that your email address will remain private and will not be published or shared with anyone. We prioritize the privacy and security of our users.

Save my name, email, and website in this browser for the next time I comment.

Show Contents

Assign an IP address from the command-line interface

Use the set network command to configure an IP address from the command line. The set network command includes the following parameters:

  • ip = device ip : The IP address for the device.
  • gateway = gateway : The network gateway IP address.
  • garp= seconds : The frequency of Gratuitous ARP (GARP) announcements, in seconds, which are a broadcast announcement to the network of a device’s MAC address and the IP address.
  • submask = device submask : The device subnet mask for the IPaddress.
  • dhcp=off : Turns off use of the Dynamic Host Configuration Protocol (DHCP), so that the IP address assigned is permanent.
  • static=on : Specifies that the IP address is static, and will remain as the specified IP address, gateway, and submask.

For example:

To configure the Digi Connect SP through the command line, you must change the DIP switches. See Set DIP switches on Digi Connect SP\Wi-SP for an illustration of the DIP switch settings.

© 2022 Digi International Inc. All rights reserved. Assign an IP address from the command-line interface updated on 23 Jan 2024 10:24 AM

How-To Geek

How to use the ip command on linux.

It is time to break up with ifconfig.

Quick Links

How the ip command works, using ip with addresses, display only ipv4 or ipv6 addresses, display information for a single interface, adding an ip address, deleting an ip address, using ip with network interfaces, starting and stopping links, using ip with routes, display information for a single route, adding a route, taken route, not taken root, key takeaways.

  • The ip command has replaced the older ifconfig command in modern versions of Linux.
  • The ip command allows you to configure IP addresses, network interfaces, and routing rules on the fly without rebooting.
  • Run "ip addr" in the Terminal to get your PC's local IP address.

You can configure IP addresses, network interfaces, and routing rules on the fly with the Linux ip command. We'll show you how you can use this modern replacement of the classic (and now deprecated) ifconfig .

With the ip command, you can adjust the way a Linux computer handles IP addresses, network interfaces controllers (NICs), and routing rules . The changes also take immediate effect — you don't have to reboot. The ip command can do a lot more than this, but we'll focus on the most common uses in this article.

The ip command has many subcommands, each of which works on a type of object, such as IP addresses and routes. There are, in turn, many options for each of these objects. It's this richness of functionality that gives the ip command the granularity you need to perform what can be delicate tasks. This isn't ax work — it calls for a set of scalpels.

We'll look at the following objects:

  • Address : IP addresses and ranges.
  • Link : Network interfaces, such as wired connections and Wi-Fi adapters.
  • Route : The rules that manage the routing of traffic sent to addresses via interfaces ( links ).

Obviously, you first have to know the settings you're dealing with. To discover which IP addresses your computer has, you use the ip command with the object address . The default action is show , which lists the IP addresses. You can also omit show and abbreviate address as "addr" or even "a."

The following commands are all equivalent:

ip address show

ip addr show

ip address show in a terminal window

We see two IP addresses, along with a lot of other information. IP addresses are associated with network interface controllers (NICs). The ip command tries to be helpful and provides a bunch of information about the interface, too.

The first IP address is the (internal) loopback address used to communicate within the computer. The second is the actual (external) IP address the computer has on the local area network (LAN).

Let's break down all the information we received:

  • lo : The network interface name as a string.
  • <LOOPBACK,UP,LOWER_UP>: This is a loopback interface. It's UP , meaning it's operational. The physical networking layer (layer one) is also up.
  • mtu 65536: The maximum transfer unit. This is the size of the largest chunk of data this interface can transmit.
  • qdisc noqueue: A qdisc is a queuing mechanism. It schedules the transmission of packets. There are different queuing techniques called disciplines. The noqueue discipline means "send instantly, don't queue." This is the default qdisc discipline for virtual devices, such as the loopback address.
  • state UNKNOWN: This can be DOWN (the network interface is not operational), UNKNOWN (the network interface is operational but nothing is connected), or UP (the network is operational and there is a connection).
  • group default: Interfaces can be grouped logically. The default is to place them all in a group called "default."
  • qlen 1000: The maximum length of the transmission queue.
  • link/loopback: The media access control (MAC) address of the interface.
  • inet 127.0.0.1/8: The IP version 4 address. The part of the address after the forward-slash ( / ) is Classless Inter-Domain Routing notation (CIDR) representing the subnet mask. It indicates how many leading contiguous bits are set to one in the subnet mask. The value of eight means eight bits. Eight bits set to one represents 255 in binary, so the subnet mask is 255.0.0.0.
  • scope host: The IP address scope. This IP address is only valid inside the computer (the "host").
  • lo: The interface with which this IP address is associated.
  • valid_lft: Valid lifetime. For an IP version 4 IP address allocated by Dynamic Host Configuration Protocol (DHCP), this is the length of time the IP address is considered valid and able to make and accept connection requests.
  • preferred_lft: Preferred lifetime. For an IP version 4 IP address allocated by DHCP, this is the amount of time the IP address can be used with no restrictions. This should never be larger than the valid_lft value.
  • inet6 : The IP version 6 address, scope , valid_lft , and preferred_lft .

The physical interface is more interesting, as we'll show below:

  • enp0s3: The network interface name as a string. The "en" stands for ethernet, "p0" is the bus number of the ethernet card, and "s3" is the slot number.
  • <BROADCAST,MULTICAST,UP,LOWER_UP>: This interface supports broad- and multicasting , and the interface is UP (operational and connected). The hardware layer of the network (layer one) is also UP .
  • mtu 1500: The maximum transfer unit this interface supports.
  • qdisc fq_codel: The scheduler is using a discipline called "Fair Queuing, Controlled Delay." It's designed to provide a fair share of the bandwidth to all the traffic flows that use the queue.
  • state UP: The interface is operational and connected.
  • group default: This interface is in the "default" interface group.
  • link/ether: The MAC address of the interface.
  • inet 192.168.4.26/24: The IP version 4 address. The "/24" tells us there are 24 contiguous leading bits set to one in the subnet mask. That's three groups of eight bits. An eight-bit binary number equates to 255; therefore, the subnet mask is 255.255.255.0.
  • brd 192.168.4.255: The broadcast address for this subnet.
  • scope global: The IP address is valid everywhere on this network.
  • dynamic: The IP address is lost when the interface goes down.
  • noprefixroute: Do not create a route in the route table when this IP address is added. Someone has to add a route manually if he wants to use one with this IP address. Likewise, if this IP address is deleted, don't look for a route to delete.
  • enp0s3: The interface with which this IP address is associated.
  • valid_lft: Valid lifetime. The time the IP address will be considered valid; 86,240 seconds is 23 hours and 57 minutes.
  • preferred_lft: Preferred lifetime. The time the IP address will operate without any restrictions.
  • inet6: The IP version 6 address, scope , valid_lft , and preferred_lft .

If you want to limit the output to the IP version 4 addresses, you can use the -4 option, as follows:

ip -4 addr in a terminal window

If you want to limit the output to the IP version 6 addresses, you can use the -6 option, as follows:

ip -6 addr in a terminal window

If you want to see the IP address information for a single interface, you can use the show and dev options, and name the interface, as shown below:

ip addr show dev lo

ip addr show dev enp0s3

ip addr show dev lo in a terminal window

You can also use the -4 or -6 flag to further refine the output so you only see that in which you're interested.

If you want to see the IP version 4 information related to the addresses on interface enp0s3 , type the following command:

ip -4 addr show dev enp0s3

ip -4 addr show dev enp0s3 in a terminal window

You can use the add and dev options to add an IP address to an interface. You just have to tell the ip command which IP address to add, and to which interface to add it.

We're going to add the IP address 192.168.4.44 to the enp0s3 interface. We also have to provide the CIDR notation for the subnet mask.

We type the following:

sudo ip addr add 192.168.4.44/24 dev enp0s3

sudo ip addr add 192.168.4.44/24 dev enp0s3 in a terminal window

We type the following to take another look at the IP version 4 IP addresses on this interface:

ip -4 addr show dev enp0s3 in a terminal window

The new IP address is present on this network interface. We jump on another computer and use the following command to see if we can ping the new IP address :

ping 192.168.4.44

ping 192.168.4.44  in a terminal window

The IP address responds and sends back acknowledgments to the pings. Our new IP address is up and running after one simple ip command.

To delete an IP address, the command is almost the same as the one to add one, except you replace add with del , as shown below:

sudo ip addr del 192.168.4.44/24 dev enp0s3

sudo ip addr del 192.168.4.44/24 dev enp0s3 in a terminal window

If we type the following to check, we see the new IP address has been deleted:

ip -4 addr show dev enp0s3 in a terminal window

You use the link object to inspect and work with network interfaces. Type the following command to see the interfaces installed on your computer:

ip link show

ip link show: in a terminal window

To see a single network interface, just add its name to the command, as shown below:

ip link show enp0s3

ip link show enp0s3 in a terminal window

You can use the set option with either up or down to stop or start a network interface option. You also have to use sudo , as shown below:

sudo ip link set enp0s3 down

sudo ip link set enp0s3 down in a terminal window

We type the following to take a look at the network interface:

ip link show enp0s3 in a terminal window

The state of the network interface is DOWN . We can use the up option to restart a network interface, as shown below:

sudo ip link set enp0s3 up

sudo ip link set enp0s3 up in a terminal window

We type the following to do another quick check on the state of the network interface:

ip link show enp0s3 in a terminal window

The network interface was restarted, and the state is shown as UP .

With the route object, you can inspect and manipulate routes. Routes define to where network traffic to different IP addresses is forwarded, and through which network interface.

If the destination computer or device shares a network with the sending computer, the sending computer can forward the packet directly to it.

However, if the destination device is not directly connected, the sending computer forwards the packet to the default router. The router then decides where to send the packet.

To see the routes defined on your computer, type the following command:

ip route in a terminal window

Let's take a look at the info we received:

  • default: The default rule. This route is used if none of the other rules match what's being sent.
  • via 192.168.4.1: Routes the packets via the device at 192.168.4.1. This is the IP address of the default router on this network.
  • dev enp0s3: Use this network interface to send the packets to the router.
  • proto dhcp: The routing protocol identifier. DHCP means the routes will be determined dynamically.
  • metric 100: An indication of the preference of the route compared to others. Routes with lower metrics are preferentially used over those with higher metrics. You can use this to give preference to a wired network interface over a Wi-Fi one.

The second route governs traffic to the IP range of 169.254.0.0/16. This is a zero-configuration network , which means it tries to self-configure for intranet communication. However, you can't use it to send packets outside the immediate network.

The principle behind zero-configuration networks is they don't rely on DHCP and other services being present and active. They only need to see TCP/IP in order to self-identify to each of the other devices on the network.

Let's take a look:

  • 169.254.0.0/16: The range of IP addresses this routing rule governs. If the computer communicates on this IP range, this rule cuts in.
  • dev enp0s3: The network interface the traffic governed by this route will use.
  • scope link : The scope is link , which means the scope is limited to the network to which this computer is directly connected.
  • metric 1000 : This is a high metric and isn't a preferred route.

The third route governs traffic to the IP address range of 192.168.4.0/24. This is the IP address range of the local network to which this computer is connected. It's for communication across, but within, that network.

Let's break it down:

  • 192.168.4.1/24: The range of IP addresses this routing rule governs. If the computer communicates within this IP range, this rule triggers and controls the packet routing.
  • dev enp0s3: The interface through which this route will send packets.
  • proto kernel: The route created by the kernel during auto-configuration.
  • scope link: The scope is link , which means the scope is limited to the immediate network to which this computer is connected.
  • src 192.168.4.26: The IP address from which packets sent by this route originate.
  • metric 100: This low metric indicates a preferred route.

If you want to focus on the details of a particular route, you can add the list option and IP address range of the route to the command as follows:

ip route list 192.168.4.0/24

ip route list 192.168.4.0/24 in a terminal window

We just added a new network interface card to this computer. We type the following and see it's showing up as enp0s8 :

ip link show in a terminal window

We'll add a new route to the computer to use this new interface. First, we type the following to associate an IP address with the interface:

sudo ip addr add 192.168.121.1/24 dev enp0s8

sudo ip addr add 192.168.121.1/24 dev enp0s8 in a terminal window

A default route using the existing IP address is added to the new interface. We use the delete option, as shown below, to delete the route and provide its details:

sudo ip route delete default via 192.168.4.1 dev enp0s8

sudo ip route delete default via 192.168.4.1 dev enp0s8 in a terminal window

We'll now use the add option to add our new route. The new interface will handle network traffic in the 192.168.121.0/24 IP address range. We'll give it a metric of 100; because it will be the only route handling this traffic, the metric is pretty much academic.

sudo ip route add 192.168.121.0/24 dev enp0s8 metric 100

sudo ip route add 192.168.121.0/24 dev enp0s8 metric 100 in a terminal window

Now, we type the following to see what it gives us:

ip route in a terminal window

Our new route is now in place. However, we still have the 192.168.4.0/24 route that points to interface enp0s8 — we type the following to remove it:

sudo ip route delete 192.168.4.0/24 dev enp0s8

sudo ip route delete 192.168.4.0/24 dev enp0s8 in a terminal window

We should now have a new route that points all traffic destined for IP range 192.168.121.0/24 through interface enp0s8 . It should also be the only route that uses our new interface.

We type the following to confirm:

ip route in a terminal window

The great thing about these commands is they're not permanent. If you want to clear them, just reboot your system. This means you can experiment with them until they work the way you want. And it's a very good thing if you make a terrible mess of your system — a simple reboot will restore order.

On the other hand, if you want the changes to be permanent, you have to do some more work. Exactly what varies depending on the distribution family, but they all involve changing config files.

This way, though, you can test-drive commands before you make anything permanent.

ncesc-gaming-pedia

How do I assign a static IP address?

featured

  • Access the Control Panel. In the Windows search bar, type in “ncpa. …
  • Select the Network Adapter. …
  • Select Properties. …
  • Select Internet Protocol Version 4 (TCP/IPv4) …
  • Manually enter IP address and subnet mask. …
  • Save Settings. …
  • Revert Back to DHCP. …

How do I set my IP address to static?

  • Open “Settings” and select “Connections” > “Wi-Fi.”
  • Select the gear icon which appears beside your current network.
  • Select “IP settings” > “Static.”
  • Input your static IP address.
  • Select “Save.”

How do I manually assign an IP address?

Click Start > Settings > Network & Internet. Under your local area connection, click Properties. Under IP assignment, click Edit. Choose Manual, toggle on IPv4, and enter the IP address.

What does it mean to assign a static IP address?

When a device is assigned a static IP address, the address does not change. Most devices use dynamic IP addresses, which are assigned by the network when they connect and change over time.

How do I assign an IP address to my router?

Select ‘Advanced’ at the top of the page. Choose left for ‘Network’, followed by ‘DHCP server’. You’ll now find the option ‘Add’ under ‘Address reservation’. Enter your MAC address, choose an IP address, and describe your appliance in a way you’ll recognize it later.

How to Assign a Static IP Address in Windows 10

Should I set my router to static IP?

Most users don’t need static IP addresses. Static IP addresses normally matter more when external devices or websites need to remember your IP address. One example is VPN or other remote access solutions that trust (whitelists) certain IPs for security purposes.

Does modem or router assign IP address?

By default, the cable modem router acts as a Dynamic Host Configuration Protocol (DHCP) server. The cable modem router assigns IP, DNS server, and default gateway addresses to all computers connected to the LAN. The assigned default gateway address is the LAN address of the cable modem router.

Which device should be assigned a static IP address?

While most network-connected devices receive their IP addresses dynamically through DHCP, it’s common to reserve part of the network address space for use as static IP addresses for devices such as routers, printers, FTP servers, and DHCP servers.

How do I know if my IP is static or dynamic?

On a Windows computer, type ipconfig /all within a command prompt. Find the “DHCP Enabled” text. If it says NO, you have a static IP address. If it says YES, you have a dynamic IP address.

What are the disadvantages of a static IP address?

However, using static IP addresses also has some drawbacks. One of them is that they are less secure and more vulnerable to hacking or spoofing. Since static IP addresses do not change, they are easier to track and target by malicious actors.

What is an example of a static IP address?

For example, I have my home server set to 192.168. 1.10, my main desktop to 192.168. 1.11, and so on—easy to remember, sequential, and unchanging. You can assign these static IP addresses on the device itself—using, say, Windows’ network settings on each computer—or you can do it at the router level.

What are the two ways to assign IP address?

There are 2 ways how you can assign an IP address to your device: (1) dynamically via DHCP or (2) statically by manually assigning an IP address yourself.

Should IP settings be DHCP or static?

Static IP allocation ensures seamless IP allocation and management of these devices. For mobile devices that frequently move between networks, DHCP IP allocation is more convenient since it can automatically assign IP addresses regardless of the network.

How can I tell if my IP address is static?

Can you set static ip on wifi.

Assigning a static IP address to a wireless computer always allows it to use the same IP address. This is in contrast to having a router assign a dynamic IP address to your computer where the IP address changes every time you connect and reconnect to the WiFi.

Is static IP the same as IP address?

The static IP meaning refers to an IP address that is assigned to a device and remains constant, as opposed to a dynamic IP address that changes each time the device connects to the internet. Users assign them to individual devices or resources. The address then applies for as long as users desire.

What are the benefits of a static IP address?

One of the main benefits of using static IP addresses is that they are easier to manage and troubleshoot. You can configure your devices with specific settings and preferences, and you do not have to worry about conflicts or errors caused by changing IP addresses.

How do I get a static IP address from an ISP?

To obtain a static IP address from an internet provider requires signing up for a special service plan and paying extra fees. IP addresses for mobile devices connecting to public Wi-Fi hotspots also change regularly.

Why do routers have 2 IP addresses?

If there’s only one computer in your office, your router has a total of two IP addresses: one public and one private. These enable the router to forward packets of data destined for the Internet to the modem, and to the data’s destination IP address outside your office.

Does IP address depend on WIFI or device?

The internet knows your IP address because it’s assigned to your device and is required to browse the internet. Your IP address changes, though, every time you connect to a different Wi-Fi network or router.

How many IP addresses can a router assign?

Most home routers aren’t even capable of creating multiple subnets, but we will assume you have a really nice home router that can. Your router will only have 254 usable network addresses on a typical home network. Most routers have a network IP address of 192.168. 1.

What are 2 commonly used IP addresses?

There are two versions of IP addresses in common use: IPv4 and IPv6.

What is the difference between static and DHCP?

Can you assign any ip address.

Instead of letting your router assign whatever IP address is free at any given time, you can assign specific IP addresses to the devices you access frequently. For example, I have my home server set to 192.168. 1.10, my main desktop to 192.168. 1.11, and so on—easy to remember, sequential, and unchanging.

When should you use a static IP address?

When static IPs are needed. Most users don’t need static IP addresses. Static IP addresses normally matter more when external devices or websites need to remember your IP address. One example is VPN or other remote access solutions that trust (whitelists) certain IPs for security purposes.

About The Author

Genevieve reed, leave a comment cancel reply.

Your email address will not be published. Required fields are marked *

Save my name, email, and website in this browser for the next time I comment.

IMAGES

  1. Assign IP address to your computer using cmd

    assign ip address in cmd

  2. Setting IP Address Using ipconfig Command

    assign ip address in cmd

  3. How To Assign IP Address Using CMD in WIndows 10

    assign ip address in cmd

  4. CMD : How To Find Your Public IP Addresses With 1 Command

    assign ip address in cmd

  5. How to change IP Address from Command Prompt

    assign ip address in cmd

  6. how to configure ip address in windows 7 in command prompt

    assign ip address in cmd

VIDEO

  1. Command to Show IP Address Information #ccna #ciscoccna #technology #shorts#viral #youtubeshorts

  2. How to Assign IP Address in your computer using CMD

  3. HOW TO ASSIGN IP ADDRESS ON MIKROTIK ROUTER INTERFACE

  4. IP Address using CMD

  5. How to find any website IP address using CMD? command prompt hidden tricks

  6. How to assign IP Address and Hostname to Cisco Routers and Switches#cisco#ccna#router#IP#cmd

COMMENTS

  1. How To Set Static IP Address in Windows 10 using CMD

    Default gateway DNS servers Step 3: Type the following command to assign a static IP address and press Enter. Of course, in the command below, make sure to change Ethernet to the name of your network card, but also change 192.168.1.128, 255.255.255.0, and 192.168.1.2, subnet mask, and default gateway address that matches your configuration.

  2. How to Change Your IP Address From the Command Prompt in Windows

    To launch Command Prompt (or PowerShell) as Admin, open up the Start Menu, search "cmd," hover over the result, then click "Run as Administrator." In Windows 10 or Windows 11, you can also right-click the Start menu (or press Windows+X on your keyboard) to open the Power User Menu and choose "PowerShell (Admin)."

  3. How to change the IP address in Windows 10 and Windows 11 (4 ways)

    In both Windows 11 and Windows 10, you can also change your IP address from the Control Panel. Open the Control Panel and click or tap on "View network status and tasks" under "Network and Internet.". In the Network and Sharing Center, click or tap on your internet connection from the "View your active networks" area.

  4. How to Configure Windows 10 IP Address with CMD?

    Networking Windows How to Configure Windows 10 IP Address with CMD? By Shams Last updated Mar 29, 2020 3 Configuring IP address in a Windows with CMD performed using netsh command line utility. The network shell ( netsh) is a set of commands that help you configure any Windows operating system IP address, Network Interfaces, and Windows Firewall.

  5. How to Assign a Static IP Address in Windows 10 or Windows 11

    Key Takeaways To set a static IP address in Windows 10 or 11, open Settings -> Network & Internet and click Properties for your active network. Choose the "Edit" button next to IP assignment and change the type to Manual. Flip the IPv4 switch to "On", fill out your static IP details, and click Save.

  6. How to configure a static IP on Windows 10 or 11

    How-to By Mauro Huculak published 8 November 2022 Do you need to switch from a dynamic to a static IP address configuration on Windows 11 or 10? Here's how. Windows 11 static IP (Image...

  7. How to Assign IP Address to Computer CMD

    To assign an IP address using the Command Prompt in Windows 10, you can use the netsh (Network Shell) command. You can either set a static IP address or configure your network...

  8. Change IP Address and DNS Servers using the Command Prompt

    The first step to changing your IP address is to find the network name for the interface you want to change. Open an elevated Command Prompt by typing CMD in the search bar and clicking on Run as Administrator. Next, type netsh interface ipv4 show config in the command prompt window, press Enter, and scroll down to the interface you want.

  9. How to Set Up a Static IP Address

    Choose Network. Pick the network connection you wish to use. Click the Details button next to the network (or the Advanced button at the bottom). Select the TCP/IP tab in the window that appears ...

  10. How to set static IP address on Windows 10

    Set static IP address on Windows 10 from Settings. To assign a static IP address on Windows 10, use these steps: Open Settings on Windows 10. Click on Network & Internet. Click on "Wi-Fi" or "Ethernet.". Click on the current network connection. Under the "IP settings" section, click the Edit button. Using the drop-down menu, select ...

  11. Setting IP Address Using ipconfig Command

    Step 1: Open the Cisco packet tracer desktop and create a network topology peer-to-peer connection between two PCs as shown below: Step 2: Configure PC0 and PC1 using the ipconfig command: command : ipconfig <ip address> <subnet mask> <default gateway> First, click on PC0 and go to the command prompt terminal.

  12. Configure TCP/IP from the Command Prompt

    In order to configure TCP/IP settings such as the IP address, Subnet Mask, Default Gateway, DNS and WINS addresses and many other options you can use Netsh.exe. Netsh.exe is a command-line ...

  13. How to set a static IP address on Windows 11

    To set a static IP address on Windows 11 with Command Prompt, use these steps: Open Start on Windows 11. Search for Command Prompt, right-click the top result, and select the Run as administrator option. Type the following command to see your current networking configuration and press Enter: ipconfig /all.

  14. How To Assign IP Address Using CMD in WIndows 10

    How To Assign IP Address Using CMD in WIndows 10 Tricknology 175K subscribers Join Subscribe Subscribed 402 63K views 5 years ago In this Video I Will show you guys how to change or assign ip...

  15. How to Find Your IP Address From CMD (Command Prompt)

    To find your local (or private) IP address, run the "ipconfig" command in the Command Prompt. To find your public IP address, run the "curl ifcfg.me" command or alternative methods like "curl icanhazip.com" or "nslookup myip.opendns.com". PowerShell and Bash shell have similar commands for finding your public IP address.

  16. How to change from static to dynamic IP address on Windows 10

    To enable DHCP to obtain a TCP/IP configuration automatically on Windows 10, use these steps: Open Settings on Windows 10. Click on Network & Internet. Click on Ethernet or Wi-Fi. Click the network connection. Under the "IP settings" section, click the Edit button. Use the Edit IP settings drop-down menu and select the Automatic (DHCP) option.

  17. How to Assign Static IP Address to Your Devices

    1. Assign IP Address on Windows 10/8/7 You can do this quickly through the command line. You will need to first find your subnet mask, default gateway, and network adapter name. In my case, I'm on a Wi-Fi network, so the adapter name is Wi-Fi. To find yours just type the following command. ipconfig

  18. How to change IP address using script on Windows?

    ipconfig /renew to get a new IP address or default gateway The NETSH command does this. check this. See this example for setting DNS address manually via netsh command: netsh interface ip set dns "Local Area Connection" static 192.168..200 configure your NIC to dynamically obtain its DNS settings ( * Obtain DNS server address automatically ):

  19. How to Set a Static IP Address in Windows 11

    Right-click on your network adapter and select Properties. Click Internet Protocol Version 4 (TCP/IPv4). Click Properties. Select Use the Following IP Address and enter the IP Address, Subnet Mask ...

  20. Set-NetIPAddress (NetTCPIP)

    Example 1: Modify an IP address. PowerShell. PS C:\> New-NetIPAddress -InterfaceIndex 12 -IPAddress 192.168..1 PS C:\> Set-NetIPAddress -InterfaceIndex 12 -IPAddress 192.168..1 -PrefixLength 24. This command adds the IP address 192.168..1 to the interface located at index 12. The PrefixLength parameter may also be specified as part of the ...

  21. 24 Useful "IP" Commands to Configure Network Interfaces

    1. Permanently Configure Static IP Address in Linux Set Static IP Address in RHEL Systems Set Static IP Address in Debian Systems 2. Temporary Configure Static IP Address in Linux 3. How to Display All Network Interfaces 4. How to Check an IP Address of a Specific Network Interface 5. How to Display IP Address in Colored Output 6.

  22. Assign an IP address from the command-line interface

    Use the set network command to configure an IP address from the command line. The set network command includes the following parameters: ip=device ip: The IP address for the device. gateway=gateway: The network gateway IP address. garp=seconds: The frequency of Gratuitous ARP (GARP) announcements, in seconds, which are a broadcast announcement ...

  23. How to Use the ip Command on Linux

    Adding a Route Taken Route, Not Taken Root Key Takeaways The ip command has replaced the older ifconfig command in modern versions of Linux. The ip command allows you to configure IP addresses, network interfaces, and routing rules on the fly without rebooting. Run "ip addr" in the Terminal to get your PC's local IP address.

  24. How do I assign a static IP address?

    On a Windows computer, type ipconfig /all within a command prompt. Find the "DHCP Enabled" text. If it says NO, you have a static IP address. If it says YES, you have a dynamic IP address. ... There are 2 ways how you can assign an IP address to your device: (1) dynamically via DHCP or (2) statically by manually assigning an IP address ...