This batch is automatically set to the MAC of the local Nic and the MAC of the gateway. It runs automatically at each startup.
Batch Processing is automatically obtained!
Code:
@ Echo off
If % ~ N0 = ARP exit
If % ~ N0 = ARP exit
If % ~ N0 = ARP exit
ECHO is obtaining local information .....
: IP
For/F "Skip = 13 tokens = 15 usebackq" % I in ('ipconfig/all') do set IP = % I & goto Mac
: Mac
Echo IP: % IP %
For/F "Skip = 13 tokens = 12 usebackq" % I in ('ipconfig/all') do set MAC = % I & goto custom IP
: Elastic IP
Echo Mac: % Mac %
ARP-d
ARP-S % IP % Mac %
ECHO is obtaining gateway information .....
For/F "Skip = 17 tokens = 13 usebackq" % I in ('ipconfig/all') do set multicast IP = % I & goto encrypt Mac
: Running Mac
Echo IP: % gateip %
Ping % gateip %
For/F "Skip = 3 tokens = 2 usebackq" % I in ('Arp-A % Taobao IP % ') do set hosts MAC = % I & goto start
: Start
Echo Mac: % running Mac %
ARP-S % gateip % gatemac %
Echo operation completed !!!
Exit
*****************************
@ Echo off
If % ~ N0 = ARP exit
If % ~ N0 = ARP exit
If % ~ N0 = ARP exit
ECHO is obtaining local information .....
: IP
For/F "Skip = 13 tokens = 15 usebackq" % I in ('ipconfig/all') do set IP = % I & goto Mac
: Mac
Echo IP: % IP %
For/F "Skip = 13 tokens = 12 usebackq" % I in ('ipconfig/all') do set MAC = % I & goto custom IP
: Elastic IP
Echo Mac: % Mac %
ARP-S % IP % Mac %
Set destination IP = Route IP
: Running Mac
Echo IP: % gateip %
For/F "Skip = 3 tokens = 2 usebackq" % I in ('Arp-A % Taobao IP % ') do set hosts MAC = % I & goto start
: Start
Echo Mac: % running Mac %
ARP-d
ARP-S % gateip % gatemac %
Echo operation completed !!!
Exit
*********************
@ Echo off
If % ~ N0 = ARP exit
If % ~ N0 = ARP exit
If % ~ N0 = ARP exit
ECHO is obtaining local information .....
: IP
For/F "Skip = 13 tokens = 15 usebackq" % I in ('ipconfig/all') do set IP = % I & goto Mac
: Mac
Echo IP: % IP %
For/F "Skip = 13 tokens = 12 usebackq" % I in ('ipconfig/all') do set MAC = % I & goto custom IP
: Elastic IP
Echo Mac: % Mac %
ARP-S % IP % Mac %
Set destination IP = Route IP
Set ingress MAC = route Mac
ARP-d
ARP-S % gateip % gatemac %
Echo operation completed !!!
Exit