Use the doscommand to set IP addresses, gateways, and DNS.

Source: Internet
Author: User
Tags configuration settings

Use the doscommand to set the IP address and DNS

Set/modify the IP address, subnet mask, and gateway format:

Netsh interface IP Set address "Local Connection" static 10.25.35.35 255.255.255.0 10.25.35.7 auto

The command means to "connect locally"

Set the IP address to 10.25.35.35.

The subnet mask is 255.255.255.0.

Set the gateway to 10.25.35.7 and the number of automatic hops

Note: Modify the "local connection" according to your situation.

Set the DNS command format:

Netsh interface IP Set DNS "Local Connection" static 211.138.91.1

The command sets the "local connection" DNS to 211.138.91.1.

The command to delete IP addresses and DNS is

Netsh interface IP Set address "Local Connection" DHCP

Netsh interface IP Set DNS "Local Connection" DHCP

C: \> ipconfig (use the ipconfig command to check the IP address before the change)

Windows 2000 IP configuration

Ethernet Adapter local connection:

Connection-specific DNS suffix .:

IP address ......: 192.168.0.250 (the IP address before the local connection is changed)

Subnet Mask ......: 255.255.255.0

Default Gateway...: 192.168.0.1

PPP adapter dial-up connection:

Connection-specific DNS suffix .:

IP address ......: 211.149.128.147

Subnet Mask ......: 255.255.255.255

Default Gateway ......: 211.149.128.147

C: \> netsh (then execute the netsh command)

Netsh> interface (subcommand of the netsh command)

Interface> IP (subcommands of interface commands)

Interface ip> set (subcommand of interface ip command)

The following commands are valid:

Commands in this context:

Set address-set the IP address or default gateway of the specified interface.

Set DNS-set the DNS server mode and address.

Set wins-set the WINS server mode and address.

Interface ip> set address "Local Connection" static 192.168.0.2 255.255.255.0 192.168.0.1

1 (set IP address)

OK.

(Note: The above section does not look like a Cisco command .)

Interface ip> exit

C: \> ipconfig (use the ipconfig command to check whether the IP address is changed successfully)

Windows 2000 IP configuration

Ethernet Adapter local connection:

Connection-specific DNS suffix .:

IP address ......: 192.168.0.2 (the changed IP Address indicates that it is successful)

Subnet Mask ......: 255.255.255.0

Default Gateway...: 192.168.0.1

PPP adapter dial-up connection:

Connection-specific DNS suffix .:

IP address ......: 211.149.128.147

Subnet Mask ......: 255.255.255.255

Default Gateway ......: 211.149.128.147

C: \>

The netsh command has the following powerful functions:

C: \> netsh

Netsh>?

The following commands are valid:

Commands in this context:

...-Move to the context level of the previous layer.

? -Display the command list.

Aaaa-change to 'aaa' context.

Abort-discard the changes made in offline mode.

Add-Add a configuration item to the project list.

Alias-add an alias

Bye-exit the program.

Commit-submit the changes made in offline mode.

Delete-delete a configuration item from the project list.

DHCP-changed to the 'dhcp 'context.

Dump-displays a configuration script.

Exec-run a script file.

Exit-exit the program.

Help-display the command list.

Interface-changed to the 'interface' context.

Offline-set the current mode to offline.

Online-set the current mode to a VM instance.

Popd-open a context from the stack.

Pushd-push the current context into the stack.

Quit-exit the program.

Ras-changed to 'Ras 'context.

Routing-changed to the 'routing' context.

Set-Update Configuration Settings.

Show-display information

Unalias-delete an alias.

Wins-changed to the 'WINS 'context.

The following sub-contexts are available:

Routing interface Ras DHCP wins AAAA

If you need more help information, enter the command,

Followed ?.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.