How to bind an IP address and a mac address to a vps instance

Source: Internet
Author: User
Tags vps

ECHO: import macaddress to ipconfig.txt ::::

:::: Get the machine's TCP/IP configuration

The code is as follows: Copy code
If exist ipconfig.txt del D: pichuliipconfig.txt
Ipconfig/all> D: pichuliipconfig.txt

:::: Detach the physical address of the machine and save it to the (phyaddr.txt) file.

The code is as follows: Copy code
If exist D: pichuliphyaddr.txt del D: pichuliphyaddr.txt
Find "Physical Address" D: pichuliipconfig.txt> D: pichuliphyaddr.txt

:::: Separate the IP address of the machine and save it to ip.txt.

The code is as follows: Copy code

If exist D: pichuliip.txt del D: pichuliip.txt
Find "IP Address" D: pichuliipconfig.txt> D: pichuliip.txt


Set SC = 2
Set scfile = D: pichuliphyaddr.txt
Set scfile2 = D: pichuliip.txt
Goto scan

: Scan

:::: Obtain the physical address string from the (D: pichuliphyaddr.txt) file and assign it to the variable "MacAddress"

The code is as follows: Copy code
For/f "skip = 2 tokens = 12" % M in (% scfile %) do set strMac = % M
For/f "skip = 2 tokens = 15" % I in (% scfile2 %) do set IPAddress = % I
If exist D: pichulimac.txt del D: pichulimac.txt
If exist D: pichuliip2.txt del D: pichuliGetIp.txt
ECHO target address MAC: % strMac %> D: pichulimac.txt
ECHO target address MAC: % IPAddress %> D: pichuliGetIp.txt

: China information port bound mac and ip

The code is as follows: Copy code
Arp-s % IPAddress % strMac %>

C: Documents and SettingsAdministrator start the ip_mac.cmdecho http://www.111cn.net

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.