Fully functionnal

This commit is contained in:
Alex 2021-04-19 17:06:39 +02:00
parent 20176c7375
commit 4cb743028a
3 changed files with 16 additions and 8 deletions

View File

@ -12,6 +12,8 @@ Rename-computer $name
Install-WindowsFeature RemoteAccess, RSAT-RemoteAccess-PowerShell, Routing -IncludeManagementTools Install-WindowsFeature RemoteAccess, RSAT-RemoteAccess-PowerShell, Routing -IncludeManagementTools
#Install-remoteAccess -VpnType Vpn #Install-remoteAccess -VpnType Vpn
Set-NetConnectionProfile -networkcategory private
# Change IP and DNS # Change IP and DNS
# #

View File

@ -1,6 +1,8 @@
# Alexandre SIMAO # Alexandre SIMAO
# GPLv3 # GPLv3
### TODO ?
# Script to install and configure a Fuckdows Server 2016 as a router # Script to install and configure a Fuckdows Server 2016 as a router
# RTR-03 Only # RTR-03 Only
@ -8,19 +10,23 @@
$name = Read-host "Nouveau nom d'hôte?" $name = Read-host "Nouveau nom d'hôte?"
Rename-computer $name Rename-computer $name
Set-NetConnectionProfile -NetworkCategory Private
# Install Routing and necessary linked roles # Install Routing and necessary linked roles
Install-WindowsFeature RemoteAccess -IncludeManagementTools Install-WindowsFeature RemoteAccess, RSAT-RemoteAccess-PowerShell, Routing -IncludeManagementTools
set-service RemoteAccess -StartupType Automatic set-service RemoteAccess -StartupType Automatic
Start-Service RemoteAccess Start-Service RemoteAccess
netsh interface ip set address "WAN" static 192.168.255.254 255.255.255.0 netsh interface ip set address "WAN" static 192.168.255.254 255.255.255.0
netsh interface ip set dns name="WAN" static netsh interface ip set dns name="WAN" static 9.9.9.9
# Activate NAT # Activate NAT
netsh routing ip nat install netsh routing ip nat install
netsh routing ip nat add interface name="WAN" mode=PRIVATE netsh routing ip nat add interface name="WAN" mode=PRIVATE
netsh routing ip nat add interface name="Aston" mode=FULL netsh routing ip nat add interface name="Aston" mode=FULL
Set-NetConnectionProfile -networkcategory private
# Change ZoneAlarm rule to accept incoming ICMP ipv4 probes # Change ZoneAlarm rule to accept incoming ICMP ipv4 probes
$Params = @{ $Params = @{

View File

@ -1,6 +1,8 @@
# Alexandre Simao # Alexandre Simao
# GPL v3 # GPL v3
# SRV-01 ONLY
#Rename this piece of garbage #Rename this piece of garbage
$name = Read-host "Nom d'hôte?" $name = Read-host "Nom d'hôte?"
Rename-computer $name Rename-computer $name
@ -43,20 +45,19 @@ Add-DhcpServerv4Scope -name "Arc-SRV" -StartRange 192.168.8.1 -EndRange 192.168.
Add-DhcpServerv4ExclusionRange -ScopeID 192.168.8.0 -StartRange 192.168.8.1 -EndRange 192.168.8.63 Add-DhcpServerv4ExclusionRange -ScopeID 192.168.8.0 -StartRange 192.168.8.1 -EndRange 192.168.8.63
Add-DhcpServerv4ExclusionRange -ScopeID 192.168.8.0 -StartRange 192.168.8.240 -EndRange 192.168.8.254 Add-DhcpServerv4ExclusionRange -ScopeID 192.168.8.0 -StartRange 192.168.8.240 -EndRange 192.168.8.254
Set-DhcpServerv4OptionValue -ScopeId 192.168.8.0 -OptionID 3 -Value 192.168.8.254 Set-DhcpServerv4OptionValue -ScopeId 192.168.8.0 -OptionID 3 -Value 192.168.8.254
Set-DhcpServerv4OptionValue -ScopeId 192.168.8.0 -DnsServer 9.9.9.9
Add-DhcpServerv4Scope -name "Arc-CLI" -StartRange 192.168.12.1 -EndRange 192.168.12.254 -SubnetMask 255.255.255.0 -State Active Add-DhcpServerv4Scope -name "Arc-CLI" -StartRange 192.168.12.1 -EndRange 192.168.12.254 -SubnetMask 255.255.255.0 -State Active
Add-DhcpServerv4ExclusionRange -ScopeID 192.168.12.0 -StartRange 192.168.12.1 -EndRange 192.168.12.63 Add-DhcpServerv4ExclusionRange -ScopeID 192.168.12.0 -StartRange 192.168.12.1 -EndRange 192.168.12.63
Add-DhcpServerv4ExclusionRange -ScopeID 192.168.12.0 -StartRange 192.168.12.240 -EndRange 192.168.12.254 Add-DhcpServerv4ExclusionRange -ScopeID 192.168.12.0 -StartRange 192.168.12.240 -EndRange 192.168.12.254
Set-DhcpServerv4OptionValue -ScopeId 192.168.12.0 -OptionID 3 -Value 192.168.12.254 Set-DhcpServerv4OptionValue -ScopeId 192.168.12.0 -OptionID 3 -Value 192.168.12.254
Set-DhcpServerv4OptionValue -ScopeId 192.168.8.0 -DnsServer 9.9.9.9
Add-DhcpServerv4Scope -name "Bou-LAN" -StartRange 192.168.128.1 -EndRange 192.168.128.254 -SubnetMask 255.255.255.0 -State Active Add-DhcpServerv4Scope -name "Bou-LAN" -StartRange 192.168.128.1 -EndRange 192.168.128.254 -SubnetMask 255.255.255.0 -State Active
Add-DhcpServerv4ExclusionRange -ScopeID 192.168.128.0 -StartRange 192.168.128.1 -EndRange 192.168.128.63 Add-DhcpServerv4ExclusionRange -ScopeID 192.168.128.0 -StartRange 192.168.128.1 -EndRange 192.168.128.63
Add-DhcpServerv4ExclusionRange -ScopeID 192.168.128.0 -StartRange 192.168.128.240 -EndRange 192.168.128.254 Add-DhcpServerv4ExclusionRange -ScopeID 192.168.128.0 -StartRange 192.168.128.240 -EndRange 192.168.128.254
Set-DhcpServerv4OptionValue -ScopeId 192.168.128.0 -OptionID 3 -Value 192.168.128.254 Set-DhcpServerv4OptionValue -ScopeId 192.168.128.0 -OptionID 3 -Value 192.168.128.254
Set-DhcpServerv4OptionValue -ScopeId 192.168.8.0 -DnsServer 9.9.9.9
# Global DHCP options
Set-DhcpServerv4OptionValue -DnsServer 9.9.9.9
# Change ZoneAlarm rule to accept incoming ICMP ipv4 probes # Change ZoneAlarm rule to accept incoming ICMP ipv4 probes
@ -72,5 +73,4 @@ Set-NetFirewallRule @Params
route add -p 192.168.12.0/24 192.168.8.254 route add -p 192.168.12.0/24 192.168.8.254
route add -p 192.168.255.0/24 192.168.8.254 route add -p 192.168.255.0/24 192.168.8.254
route add -p 192.168.128.0/24 192.168.8.254 route add -p 192.168.128.0/24 192.168.8.254
route add -p 192.168.8.0/24 192.168.8.2 route add -p 0.0.0.0/0 192.168.8.254
route add -p 0.0.0.0/0 192.168.8.254