diff --git a/Guests/RTR-01.ps1 b/Guests/RTR-01.ps1 index c4882d0..f92bf62 100644 --- a/Guests/RTR-01.ps1 +++ b/Guests/RTR-01.ps1 @@ -11,29 +11,27 @@ echo "Shamefully made by Alexandre Simao. Pardon-me M. Stallman" Rename-computer RTR-01 Rename-NetAdapter -Name "Ethernet" -NewName "Arc-SRV" +netsh interface ip set address "Arc-SRV" static 192.168.8.254 255.255.255.0 + Rename-NetAdapter -Name "Ethernet 2" -NewName "Arc-CLI" +netsh interface ip set address "Arc-CLI" static 192.168.12.254 255.255.255.0 + Rename-NetAdapter -Name "Ethernet 3" -NewName "WAN" +netsh interface ip set address "WAN" static 192.168.255.8 255.255.255.0 192.168.255.254 +netsh interface ip set dns name="WAN" static 9.9.9.9 + # Install Routing and necessary linked roles Install-WindowsFeature RemoteAccess, RSAT-RemoteAccess-PowerShell, Routing -IncludeManagementTools #Install-remoteAccess -VpnType Vpn -Set-NetConnectionProfile -networkcategory private - -# Change IP and DNS - - -netsh interface ip set address "WAN" static 192.168.255.8 255.255.255.0 192.168.255.254 -netsh interface ip set address "Arc-CLI" static 192.168.12.254 255.255.255.0 -netsh interface ip set address "Arc-SRV" static 192.168.8.254 255.255.255.0 -netsh interface ip set dns name="WAN" static 9.9.9.9 - -# Display interfaces and active forwarding for all of thm via Regedit -netsh inter show inter -Set-ItemProperty -path 'HKLM:\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet` -\Services\Tcpip\Parameters' -Name 'IPEnableRouter' -Value '0x00000001' Set-NetConnectionProfile -NetworkCategory Private +$Params = @{ + "Name" = 'vm-monitoring-icmpv4' + "Action" = 'Allow' +} +Set-NetFirewallRule @Params # Activate NAT and DHCP Relay netsh routing ip relay install @@ -54,6 +52,8 @@ netsh -f ./Arc-CLI.conf netsh -f ./Arc-SRV.conf netsh -f ./WAN.conf +Set-NetConnectionProfile -networkcategory private + # Change ZoneAlarm rule to accept incoming ICMP ipv4 probes $Params = @{ "Name" = 'vm-monitoring-icmpv4' diff --git a/Guests/RTR-02.ps1 b/Guests/RTR-02.ps1 index e5b38c7..d80bbf0 100644 --- a/Guests/RTR-02.ps1 +++ b/Guests/RTR-02.ps1 @@ -24,10 +24,16 @@ Start-Service RemoteAccess # Display interfaces and active forwarding for all of thm via Regedit netsh inter show inter -Set-ItemProperty -path 'HKLM:\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet` -\Services\Tcpip\Parameters' -Name 'IPEnableRouter' -Value '0x00000001' + Set-NetConnectionProfile -NetworkCategory Private +$Params = @{ + "Name" = 'vm-monitoring-icmpv4' + "Action" = 'Allow' +} + +Set-NetFirewallRule @Params + # Activate NAT and DHCP Relay netsh routing ip relay install diff --git a/Guests/RTR-03.ps1 b/Guests/RTR-03.ps1 index c91fffd..a8784da 100644 --- a/Guests/RTR-03.ps1 +++ b/Guests/RTR-03.ps1 @@ -26,9 +26,9 @@ netsh interface ip set dns name="WAN" static 9.9.9.9 netsh routing ip nat install netsh routing ip nat add interface name="WAN" mode=PRIVATE netsh routing ip nat add interface name="Aston" mode=FULL -Set-NetConnectionProfile -networkcategory private # Change ZoneAlarm rule to accept incoming ICMP ipv4 probes + $Params = @{ "Name" = 'vm-monitoring-icmpv4' "Action" = 'Allow' @@ -36,6 +36,9 @@ $Params = @{ Set-NetFirewallRule @Params +Set-NetConnectionProfile -networkcategory private + + # Add routes route add -p 192.168.8.0/24 192.168.255.8