Đặt ip tĩnh win 10

     

You can mix a static IP address manually on Windows 10 in several ways, and in this guide, you"ll learn using Command Prompt, PowerShell, Control Panel, and Settings.

Bạn đang xem: Đặt ip tĩnh win 10


*

*

*

On Windows 10, setting a static IP address to a computer is a configuration you may need khổng lồ configure in many scenarios. For example, if you plan to cốt truyện files, a printer on a local network, or configure port forwarding.

If you do not assign a static IP address, services or a port forwarding configuration will eventually stop working. The reason is that, by default, connected devices use dynamic IP addresses assigned by the Dynamic Host Configuration Protocol (DHCP) server (usually the router), which can change at any time, as soon as you restart the machine, or after the dynamically assigned configuration expires.

In this guide, you will learn the steps lớn set a static IP (version 4) address lớn a Windows 10 device when providing a service on the network or simply configuring port forwarding khổng lồ your device on the router. (You can also this đoạn phim tutorial with the walkthrough to lớn complete this task.)

How to assign static IP address using Command Prompt

Although using commands may be challenging for some users, this is one of the quickest ways to set a static IP address on Windows 10.

Use these steps khổng lồ set a static IP address on Windows 10 using Command Prompt:

Open Start on Windows 10.

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

Type the following command khổng lồ see your current networking configuration and press Enter:

ipconfig /allUnder the network adapter, note the name of the adapter as well as the following information in these fields:

IPv4Subnet maskDefault GatewayDNS Servers

*
Windows 10 ipconfig commandType the following command to lớn assign a static IP address on Windows 10 và press Enter:

netsh interface ip set address name="Ethernet0" static 10.1.2.220 255.255.255.0 10.1.2.1In the above command, replace Ethernet0 with the name of your network adapter. Change 10.1.2.220 255.255.255.0 10.1.2.1 with the device IP address, subnet mask, & default gateway address that corresponds khổng lồ your network configuration.

Type the following command to set a DNS server address & press Enter:

netsh interface ip set dns name="Ethernet0" static 10.1.2.1In the command, make sure to lớn change Ethernet0 with your adapter’s name và 10.1.2.1 with the DNS server address of the network.

Type the following command khổng lồ set an alternate DNS server address & press Enter:

netsh interface ip add dns name="Ethernet0" 8.8.8.8 index=2In the command, replace Ethernet0 with your adapter’s name and 8.8.8.8 with an alternate DNS server address.

*
Windows 10 netsh command to set static IP addressAfter you complete the steps, you can thử nghiệm the new configuration using the ping command (for example ping google.com) lớn see if the mạng internet is working. Alternatively, you can xuất hiện a website to lớn see if the configuration works.

Microsoft is in the process of retiring netsh from Windows 10. As a result, you should start using the “NetTCPIP” networking module available in PowerShell instead.

How to assign static IP address using Control Panel

If Command Prompt is not for you, it is possible to use Control Panel lớn change the IP settings on Windows 10.

Use these steps to lớn assign a static IP configuration using Control Panel:

Open Control Panel.

Click on Network và Internet.

Click on Network and Sharing Center.

Click the Change adapter settings option on the left navigation pane.

*
Control Panel Network & Sharing CenterRight-click the network adapter and select the Properties option.

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

Click the Properties button.

*
Control Panel’s network adapter propertiesSelect the Use the following IP address option.

Assign the static IP address – for example, 10.1.2.220.

Specify a Subnet mask. Typically, on a trang chủ network, the subnet mask is 255.255.255.0.

Specify a Default gateway. (Usually, your router’s IP address – for example, 10.1.2.1.)

Under the “Use the following DNS server addresses set Preferred DNS server” section, set the Preferred DNS hệ thống address, which is usually your router’s IP address or hệ thống IP address providing DNS resolutions (for example, 10.1.2.1).

(Optional) Specify an Alternative DNS server, which the computer will use if it cannot reach the preferred DNS server.

Click the OK button.

*
Windows 10 network adapter TCP/IPv4 propertiesClick the Close button again.

Once you complete the steps, you can mở cửa your website browser và load a website to see if the configuration works.


How lớn assign static IP address using PowerShell

Windows 10 also includes the PowerShell command line platform that allows you to use the “NetTCPIP” module khổng lồ manage networking settings, including the ability to change the IP address settings of your computer.

To set a static IP address with PowerShell, use these steps:

Open Start.

Search for PowerShell, right-click the result, và select the Run as administrator option.

Type the following command khổng lồ view your current network configuration và press Enter:

Get-NetIPConfigurationAfter running the command, chú ý the following information: 

InterfaceIndexIPv4AddressIPv4DefaultGatewayDNSServer

*
PowerShell Get-NetIPConfiguration commandType the following command lớn set a static IP address & press Enter:

New-NetIPAddress -InterfaceIndex 4 -IPAddress 10.1.2.220 -PrefixLength 24 -DefaultGateway 10.1.2.1

*
PowerShell New-NetIPAddress commandIn the command, replace the InterfaceIndex number (4) with the corresponding number of your adapter. Change IPAddress with the static IP address you want to lớn assign lớn your device. If necessary, change PrefixLength (subnet mask) with the correct bit number. Typically on a trang chủ network, the setting is 24. Also, change the DefaultGateway option with the default gateway address of the network.

Type the following command lớn assign a DNS vps address and press Enter:

Set-DnsClientServerAddress -InterfaceIndex 4 -ServerAddresses 10.1.2.1

*
PowerShell Set-DNSClientServerAddress commandIf you need to lớn set a secondary DNS hệ thống address, use a comma to use the same command with another address. For example:

Set-DnsClientServerAddress -InterfaceIndex 4 -ServerAddresses 10.1.2.1, 8.8.8.8In the command, replace the InterfaceIndex number (4) with your network adapter’s corresponding number. Also, change ServerAddresses with the DNS IP address.

Xem thêm: Bài Hát Lời Bài Hát Lời Tỏ Tình Dễ Thương 2, Lời Tỏ Tình Dễ Thương

After you complete the steps, you can chạy thử the new configuration by opening your website browser & navigating lớn a website.

How to lớn assign static IP address using Settings

On Windows 10, you can also change the IP address settings using the Settings tiện ích for wireless and wired adapters.

Assign static IP address for Wi-Fi adapter

To assign a static IP address configuration to a Wi-Fi adapter, use these steps:

Open Settings.

Click on Network và Internet.

Click on Wi-Fi.

Click on the current network connection.

*
Wi-Fi settingsUnder the “IP settings” section, click the Edit button.

*
Wi-Fi IP settings on Windows 10Using the drop-down menu, select the Manual option.

*
Wi-Fi static IP optionTurn on the IPv4 toggle switch.

*
Wi-Fi edit IP address settingsSet a static IP address to use by the Windows 10 computer.

Specify a Subnet prefix length (subnet mask). If the subnet mask is 255.255.255.0, then the subnet prefix length in bits is 24.

Specify a Default Gateway address.

Specify a Preferred DNS address.

Specify an Alternate DNS address (if applicable).

Click the Save button.

*
Wi-Fi TCP/IPv4 static configurationOnce you complete the steps, you can test your settings using your web browser to xuất hiện a website.

Assign static IP address for Ethernet adapter

To assign a static IP address configuration lớn an Ethernet (wired) adapter, use these steps:


Important: The ability to lớn change networking protocol settings on an Ethernet adapter is available starting with Windows 10 version 1903, May 2019 Update, và later releases.

Open Settings.

Click on Network & Internet.

Click on Ethernet.

Click on the current network connection.

*
Ethernet settingsUnder the “IP settings” section, click the Edit button.

*
Ethernet IP settings on Windows 10Using the drop-down menu, select the Manual option.

*
Ethernet static IP optionTurn on the IPv4 toggle switch.

*
Ethernet edit IP address settingsSet the static IP address.

Specify the Subnet prefix length (subnet mask). If your subnet mask is 255.255.255.0, then the subnet prefix length in bits is 24.

Specify the Default Gateway address.

Specify the Preferred DNS address.

Specify the Alternate DNS address (if applicable).

Click the Save button.

*
Ethernet TCP/IPv4 static configurationAfter you complete the steps, you can test your settings using your website browser to mở cửa a website.