chore: add RTR-03 commenting+end status
This commit is contained in:
parent
bed22fc6ce
commit
ef25577702
@ -9,72 +9,84 @@ echo "Shamefully made by Alexandre Simao. Pardon-me M. Stallman"
|
|||||||
|
|
||||||
### Change the poor machine name
|
### Change the poor machine name
|
||||||
|
|
||||||
echo "Renaming Computer"
|
echo "Renaming Computer as RTR-03"
|
||||||
Rename-computer RTR-03
|
Rename-computer RTR-03
|
||||||
|
echo "Done!"
|
||||||
|
|
||||||
#END
|
#END
|
||||||
|
|
||||||
### Rename Adapters by parsing the VM device name
|
### Rename Adapters by parsing the VM device name
|
||||||
|
|
||||||
echo "Renaming Computer"
|
echo "Renaming adapter"
|
||||||
$adapts = Get-NetAdapter
|
$adapts = Get-NetAdapter
|
||||||
foreach ($adapt in $adapts) {
|
foreach ($adapt in $adapts) {
|
||||||
$HVName = (Get-NetAdapterAdvancedProperty -name $adapt.name -DisplayName "Hyper-v Network Adapter Name").DisplayValue
|
$HVName = (Get-NetAdapterAdvancedProperty -name $adapt.name -DisplayName "Hyper-v Network Adapter Name").DisplayValue
|
||||||
Rename-Netadapter -name $adapt.name -NewName $HVName
|
Rename-Netadapter -name $adapt.name -NewName $HVName
|
||||||
}
|
}
|
||||||
|
echo "Done!"
|
||||||
|
|
||||||
#End
|
#End
|
||||||
|
|
||||||
### Pausing to let things settle
|
### Pausing to let things settle
|
||||||
|
|
||||||
echo "Sleeping 10s"
|
echo "Sleeping 10s"
|
||||||
Sleep 10
|
Sleep 10
|
||||||
|
echo "Done!"
|
||||||
### Général IP configure
|
|
||||||
|
|
||||||
echo "IP Configuration"
|
|
||||||
$MaskBits = 24 # This means subnet mask = 255.255.255.0
|
|
||||||
$IPType = "IPv4"
|
|
||||||
|
|
||||||
#WAN IP conf
|
#WAN IP conf
|
||||||
|
|
||||||
|
echo "IP configuration via netsh"
|
||||||
netsh interface ip set address name="WAN" static 192.168.255.254 255.255.255.0
|
netsh interface ip set address name="WAN" static 192.168.255.254 255.255.255.0
|
||||||
|
echo "Done!"
|
||||||
|
|
||||||
#Aston
|
#Aston
|
||||||
|
|
||||||
|
echo "Setting Aston interface as DHCP to be sure"
|
||||||
netsh interface ip set address name="Aston" DHCP
|
netsh interface ip set address name="Aston" DHCP
|
||||||
|
echo "Done!"
|
||||||
|
|
||||||
|
#END
|
||||||
|
|
||||||
### DNS Conf for all InterfaceAlias
|
### DNS Conf for all InterfaceAlias
|
||||||
|
|
||||||
echo "DNS conf"
|
echo "Setting 9.9.9.9 as default DNS on all interfaces"
|
||||||
foreach ($c in Get-NetAdapter) { write-host 'Setting DNS for' $c.interfaceName ; Set-DnsClientServerAddress -InterfaceIndex $c.interfaceindex -ServerAddresses ('9.9.9.9') }
|
foreach ($c in Get-NetAdapter) { write-host 'Setting DNS for' $c.interfaceName ; Set-DnsClientServerAddress -InterfaceIndex $c.interfaceindex -ServerAddresses ('9.9.9.9') }
|
||||||
|
echo "Done!"
|
||||||
|
|
||||||
#End
|
#End
|
||||||
|
|
||||||
### Install Routing and necessary linked roles
|
### Install Routing and necessary linked roles
|
||||||
|
|
||||||
#echo "installing VPN routing role"
|
#echo "installing Routing and Nat role+setting autostart"
|
||||||
|
|
||||||
Install-windowsFeature -Name Routing -IncludemanagementTools
|
Install-windowsFeature -Name Routing -IncludemanagementTools
|
||||||
Install-remoteAccess -VpnType Routingonly
|
Install-remoteAccess -VpnType Routingonly
|
||||||
set-service RemoteAccess -StartupType Automatic
|
set-service RemoteAccess -StartupType Automatic
|
||||||
Start-Service RemoteAccess
|
Start-Service RemoteAccess
|
||||||
|
echo "Done!"
|
||||||
|
|
||||||
# Configure NAT
|
# Configure NAT
|
||||||
|
|
||||||
|
echo "Activating and configuring 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
|
||||||
|
echo "Done!"
|
||||||
|
|
||||||
### Change ZoneAlarm rule to accept incoming ICMP ipv4 probes ###
|
### Change ZoneAlarm rule to accept incoming ICMP ipv4 probes ###
|
||||||
|
|
||||||
|
echo "changing firewall rule to accept ICMP probes"
|
||||||
Get-NetFirewallRule -name "*ICMP4-ERQ-In*" |Enable-NetFirewallRule
|
Get-NetFirewallRule -name "*ICMP4-ERQ-In*" |Enable-NetFirewallRule
|
||||||
|
echo "Done!"
|
||||||
|
|
||||||
#END
|
#END
|
||||||
|
|
||||||
#netsh -f ./WAN.conf
|
|
||||||
|
|
||||||
### Set connection as Private
|
### Set connection as Private
|
||||||
|
|
||||||
echo "Setting connection as private"
|
echo "Setting connection as private"
|
||||||
Get-NetAdapter | Set-NetConnectionProfile -NetworkCategory Private
|
Get-NetAdapter | Set-NetConnectionProfile -NetworkCategory Private
|
||||||
|
echo "Done!"
|
||||||
|
|
||||||
#End
|
#End
|
||||||
|
|
||||||
# Add routes
|
# Add routes
|
||||||
@ -84,7 +96,14 @@ route add -p 192.168.8.0/24 192.168.255.8
|
|||||||
route add -p 192.168.12.0/24 192.168.255.8
|
route add -p 192.168.12.0/24 192.168.255.8
|
||||||
route add -p 192.168.128.0/24 192.168.255.128
|
route add -p 192.168.128.0/24 192.168.255.128
|
||||||
route add -p 0.0.0.0/0 192.168.255.254
|
route add -p 0.0.0.0/0 192.168.255.254
|
||||||
|
echo "Done!"
|
||||||
|
|
||||||
|
# Renewing DHCP lease
|
||||||
|
|
||||||
|
echo "Renew DHCP Lease to be sure"
|
||||||
ipconfig /renew
|
ipconfig /renew
|
||||||
Read-Host "Finished???"
|
|
||||||
|
#reboot
|
||||||
|
|
||||||
|
Read-Host "Press enter to reboot"
|
||||||
Restart-Computer
|
Restart-Computer
|
||||||
|
Loading…
Reference in New Issue
Block a user