Advertisement
Guest User

LAN zmiana IP

a guest
Apr 10th, 2022
35
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.03 KB | None | 0 0
  1. @echo off
  2. :poczatek
  3.  
  4. echo Wybierz:
  5. echo.
  6. echo 1) Pobierz z DHCP
  7. echo 2) 192.168.0.69
  8. echo 3) 192.168.1.69
  9. echo 4) 192.168.88.12
  10. echo 5) 10.10.100.98
  11. echo 6) 10.90.100.69
  12. echo 7) 10.90.110.69
  13. echo 8) Inny (*/32)
  14. echo 9) ostatni IP: & more < "%UserProfile%\Desktop\lastIP.dat":IP & echo brama: & more <"%UserProfile%\Desktop\lastIP.dat":brama
  15. echo 0) KONIEC
  16.  
  17. echo.
  18. set /p opcja=wybierz:
  19.  
  20. if %opcja%==1 goto opcja1
  21. if %opcja%==2 goto opcja2
  22. if %opcja%==3 goto opcja3
  23. if %opcja%==4 goto opcja4
  24. if %opcja%==5 goto opcja5
  25. if %opcja%==6 goto opcja6
  26. if %opcja%==7 goto opcja7
  27. if %opcja%==8 goto opcja8
  28. if %opcja%==9 goto opcja9
  29. if %opcja%==0 exit
  30. goto zly_wybor
  31.  
  32. :opcja1
  33. netsh interface ip set address Ethernet source=dhcp
  34. netsh interface ip set dnsservers Ethernet source=dhcp validate=no
  35. exit
  36.  
  37. :opcja2
  38. netsh interface ip set address Ethernet static 192.168.0.69 255.255.255.0 192.168.0.1 1
  39. netsh interface ip set dnsservers Ethernet static 8.8.8.8 validate=no
  40. exit
  41.  
  42.  
  43. :opcja3
  44. netsh interface ip set address Ethernet static 192.168.1.69 255.255.255.0 192.168.1.1 1
  45. netsh interface ip set dnsservers Ethernet static 8.8.8.8 validate=no
  46. exit
  47.  
  48. :opcja4
  49. netsh interface ip set address Ethernet static 192.168.88.12 255.255.255.0 192.168.88.1 1
  50. netsh interface ip set dnsservers Ethernet static 8.8.8.8 validate=no
  51. exit
  52.  
  53. :opcja5
  54. netsh interface ip set address Ethernet static 10.10.100.98 255.255.255.0 10.10.100.1 1
  55. netsh interface ip set dnsservers Ethernet static 8.8.8.8 validate=no
  56. exit
  57.  
  58. :opcja6
  59. netsh interface ip set address Ethernet static 10.90.100.69 255.255.255.0 10.90.100.1 1
  60. netsh interface ip set dnsservers Ethernet static 8.8.8.8 validate=no
  61. exit
  62.  
  63. :opcja7
  64. netsh interface ip set address Ethernet static 10.90.110.69 255.255.255.0 10.90.110.1 1
  65. netsh interface ip set dnsservers Ethernet static 8.8.8.8 validate=no
  66. exit
  67.  
  68. :opcja8
  69. cls
  70. set /p ip=IP:
  71. echo.
  72. echo 30 - .252
  73. echo 29 - .248
  74. echo 28 - .240
  75. echo 27 - .224
  76. echo 26 - .192
  77. echo 25 - .128
  78. echo 24 - .0
  79. set /p cidr=Maska:
  80. set maska=0
  81.  
  82. if %cidr%==30 set maska=252
  83. if %cidr%==29 set maska=248
  84. if %cidr%==28 set maska=240
  85. if %cidr%==27 set maska=224
  86. if %cidr%==26 set maska=192
  87. if %cidr%==25 set maska=128
  88. if %cidr%==24 set maska=0
  89.  
  90. cls
  91. echo IP: %ip%
  92. echo %ip% > "%UserProfile%\Desktop\lastIP.dat":IP
  93. echo Maska: 255.255.255.%maska%
  94. echo %maska% > "%UserProfile%\Desktop\lastIP.dat":maska
  95. set /p brama=Brama:
  96. echo %brama% > "%UserProfile%\Desktop\lastIP.dat":brama
  97. netsh interface ip set address Ethernet static %ip% 255.255.255.%maska% %brama%
  98. netsh interface ip set dnsservers Ethernet static 8.8.8.8 validate=no
  99. pause
  100. exit
  101.  
  102.  
  103. :opcja9
  104. set /p ip= <"%UserProfile%\Desktop\lastIP.dat":IP
  105. set /p maska= <"%UserProfile%\Desktop\lastIP.dat":maska
  106. set /p brama= <"%UserProfile%\Desktop\lastIP.dat":brama
  107. netsh interface ip set address Ethernet static %ip% 255.255.255.%maska% %brama%
  108. netsh interface ip set dnsservers Ethernet static 8.8.8.8 validate=no
  109. exit
  110.  
  111. :zly_wybor
  112. echo OPCJA NIEZNANA.. WYBIERZ PONOWNIE!
  113. echo.
  114. echo.
  115. echo.
  116. goto poczatek
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement