-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathipchange.bat
More file actions
125 lines (113 loc) · 4.3 KB
/
ipchange.bat
File metadata and controls
125 lines (113 loc) · 4.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
cls
@ECHO off
MODE CON: LINES=28 COLS=100
:again
ECHO.
ECHO IP Config Script
REM *Enter Variables*
REM *Get NIC IP Info*
ECHO.
ECHO __________________________________________________________________________
ECHO [ ]
ECHO [ ]
ECHO [ [1] Change stack to static IP address, mask, and DNS Server(s) ]
ECHO [ ]
ECHO [ [2] Change stack to DHCP network configuration ]
ECHO [ ]
ECHO [ [3] Change stack to SB200 IP configuration ]
ECHO [ ]
ECHO [ [4] Change stack to SB600B IP configuration ]
ECHO [ ]
ECHO [ [5] Change stack to T_U configuration ]
ECHO [ ]
ECHO [ [6] Change stack to T_P configuration ]
ECHO [ ]
ECHO [ [7] Quit ]
ECHO [ ]
ECHO [__________________________________________________________________________]
ECHO.
ECHO.
set /p choice=Please choose a configuration 1-7:
ECHO.
if [%choice%]==[7] goto quit
if [%choice%]==[] goto again
if [%choice%]==[1] goto Static
if [%choice%]==[2] goto DHCP
if [%choice%]==[3] goto SB200
if [%choice%]==[4] goto SB600
if [%choice%]==[5] goto T_U
if [%choice%]==[6] goto T_P
CLS
ECHO.
ECHO INCORRECT CHOICE, CHOOSE AGAIN
goto again
ECHO.
:Static
REM *User input IP Address, Subnet Mask, and Gateway Addresses*
ECHO.
set /P Addy=IP Address:
set /P Sub_Mask=Subnet Mask:
set /P GW=Gateway IP Address:
REM *Get DNS Servers*
set /P DNS_1=Primary DNS Server:
set /P DNS_2=Secondary DNS Server:
REM *Set IP, Subnet Mask, and Gateway Addresses*
netsh interface ip set address "Local Area Connection" static %Addy% %Sub_Mask% %GW% 1
REM *Set DNS Server IP Addresses*
netsh interface ip delete dns "Local Area Connection" all
if not [%DNS_1%]==[] netsh interface ip set dns "Local Area Connection" static %DNS_1%
if not [%DNS_2%]==[] netsh interface ip add dns "Local Area Connection" %DNS_2% index=2
ECHO.
netsh interface ip show config
ECHO.
goto done
:DHCP
ECHO.
@ECHO Setting up Local Area Connection for DHCP Configuration
netsh interface ip set address "Local Area Connection" source=dhcp
netsh interface ip set dns "Local Area Connection" source=dhcp
ECHO.
ipconfig
ECHO.
goto done
:SB200
ECHO.
@ECHO 10.10.241.205
netsh interface ip delete dns "Local Area Connection" all
netsh interface ip set address "Local Area Connection" static 10.10.241.205 255.255.255.0 10.10.241.201 1
netsh interface ip show config
ECHO.
goto done
:SB600
ECHO.
@ECHO 192.168.0.102
netsh interface ip delete dns "Local Area Connection" all
netsh interface ip set address "Local Area Connection" static 192.168.0.102 255.255.255.0 192.168.0.1 1
netsh interface ip show config
ECHO.
goto done
:T_U
ECHO.
@ECHO 172.16.233.215
netsh interface ip delete dns "Local Area Connection" all
netsh interface ip set address "Local Area Connection" static 172.16.233.215 255.255.255.0 172.16.233.214 1
netsh interface ip show config
ECHO.
goto done
:T_P
ECHO.
@ECHO 10.10.10.10
netsh interface ip delete dns "Local Area Connection" all
netsh interface ip set address "Local Area Connection" static 10.10.10.10 255.255.255.0 10.10.10.1 1
netsh interface ip show config
ECHO.
goto done
:done
ECHO.
ECHO.
set /P Done=Hit enter key when finished:
cls
:exit
:quit
cls
:exit