From 3bdcffc001ad1037d50142ff7095ad4a9adbff2d Mon Sep 17 00:00:00 2001 From: Winston Smith Date: Tue, 20 Apr 2021 15:25:09 +0200 Subject: [PATCH] Fix interface edition and DHCP relay --- Guests/Arc-SRV.conf | 2 -- Guests/Bou-LAN.conf | 2 -- Guests/RTR-01.ps1 | 4 +--- Guests/RTR-02.ps1 | 2 -- Guests/RTR-03.ps1 | 1 + Guests/SRV-01_DHCP.ps1 | 1 + Guests/WAN.conf | 2 -- Host/Infra-Standard.ps1 | 22 +++++++++++++++++----- 8 files changed, 20 insertions(+), 16 deletions(-) diff --git a/Guests/Arc-SRV.conf b/Guests/Arc-SRV.conf index be46510..7dfc071 100644 --- a/Guests/Arc-SRV.conf +++ b/Guests/Arc-SRV.conf @@ -5,9 +5,7 @@ Install set global loglevel = ERROR add dhcpserver 192.168.8.1 - add interface name = "Arc-SRV" - set interface name = "Arc-SRV" relaymode = enable maxhop = 6 minsecs = 6 popd diff --git a/Guests/Bou-LAN.conf b/Guests/Bou-LAN.conf index 11b18a0..6e29141 100644 --- a/Guests/Bou-LAN.conf +++ b/Guests/Bou-LAN.conf @@ -5,9 +5,7 @@ Install set global loglevel = ERROR add dhcpserver 192.168.8.1 - add interface name = "Bou-LAN" - set interface name = "Bou-LAN" relaymode = enable maxhop = 6 minsecs = 6 popd diff --git a/Guests/RTR-01.ps1 b/Guests/RTR-01.ps1 index 9a20bd5..c4882d0 100644 --- a/Guests/RTR-01.ps1 +++ b/Guests/RTR-01.ps1 @@ -6,8 +6,6 @@ # Change the poor machine name -Read-host "Script for RTR-01" -Read-host "WARNING: Plug-in in this order Arc-SRV, Arc-CLI and WAN" echo "Shamefully made by Alexandre Simao. Pardon-me M. Stallman" Rename-computer RTR-01 @@ -23,7 +21,7 @@ Install-WindowsFeature RemoteAccess, RSAT-RemoteAccess-PowerShell, Routing -Incl 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 diff --git a/Guests/RTR-02.ps1 b/Guests/RTR-02.ps1 index 96e0877..e5b38c7 100644 --- a/Guests/RTR-02.ps1 +++ b/Guests/RTR-02.ps1 @@ -4,8 +4,6 @@ # Script to install and configure a Fuckdows Server 2016 as a router # RTR-02 Only -Read-host "Script for RTR-02" -Read-host "WARNING: Plug-in in this order Bou-LAN and WAN" echo "Shamefully made by Alexandre Simao. Pardon-me M. Stallman" # Change the poor machine name diff --git a/Guests/RTR-03.ps1 b/Guests/RTR-03.ps1 index b59348b..c91fffd 100644 --- a/Guests/RTR-03.ps1 +++ b/Guests/RTR-03.ps1 @@ -5,6 +5,7 @@ # Script to install and configure a Fuckdows Server 2016 as a router # RTR-03 Only +echo "Shamefully made by Alexandre Simao. Pardon-me M. Stallman" # Change the poor machine name Rename-computer "RTR-03" diff --git a/Guests/SRV-01_DHCP.ps1 b/Guests/SRV-01_DHCP.ps1 index 9a8d38e..54a6273 100644 --- a/Guests/SRV-01_DHCP.ps1 +++ b/Guests/SRV-01_DHCP.ps1 @@ -5,6 +5,7 @@ # TODO : exclusion/attribution fields # Rename interfaces # +echo "Shamefully made by Alexandre Simao. Pardon-me M. Stallman" #Rename this piece of garbage Rename-computer "SRV-1" diff --git a/Guests/WAN.conf b/Guests/WAN.conf index afc8f78..01cd16e 100644 --- a/Guests/WAN.conf +++ b/Guests/WAN.conf @@ -6,8 +6,6 @@ set global loglevel = ERROR add dhcpserver 192.168.8.1 -add interface name = "WAN" - set interface name = "WAN" relaymode = enable maxhop = 6 minsecs = 6 popd diff --git a/Host/Infra-Standard.ps1 b/Host/Infra-Standard.ps1 index 954d54a..ccffacb 100644 --- a/Host/Infra-Standard.ps1 +++ b/Host/Infra-Standard.ps1 @@ -1,4 +1,7 @@ ## Tool to automate VM creation +echo "Shamefully made by Alexandre Simao. Pardon-me M. Stallman" + +# SRV-01 $VMName = "SRV-01" cp D:\VHD\Base_dif\Base_server_g2.vhdx D:\VHD\$VMName.vhdx @@ -20,6 +23,8 @@ $vms = @{ New-VM @vms Set-VMMemory $VMName -DynamicMemoryEnabled $true -MinimumBytes 512MB -StartupBytes 1024MB -MaximumBytes 2GB +# RTR-01 + $VMName = "RTR-01" cp D:\VHD\Base_dif\Base_server_g2.vhdx D:\VHD\$VMName.vhdx @@ -33,15 +38,17 @@ $vms = @{ Generation = '2' MemoryStartupBytes = 1024Mb VHDPath = "d:\VHD\$VMName.vhdx" - SwitchName = 'Arc-Cli' + SwitchName = 'Arc-SRV' } New-VM @vms Set-VMMemory $VMName -DynamicMemoryEnabled $true -MinimumBytes 512MB -StartupBytes 1024MB -MaximumBytes 2GB -Add-VMSwitch -Name "Arc-SRV" -ResourcePoolName "Arc-SRV" -Add-VMSwitch -Name "WAN" -ResourcePoolName "WAN" +Add-VMNetworkAdapter -VMName $VMName -SwitchName "Arc-CLI" +Add-VMNetworkAdapter -VMName $VMName -SwitchName "WAN" + +# RTR-02 $VMName = "RTR-02" cp D:\VHD\Base_dif\Base_server_g2.vhdx D:\VHD\$VMName.vhdx @@ -62,7 +69,10 @@ $vms = @{ New-VM @vms Set-VMMemory $VMName -DynamicMemoryEnabled $true -MinimumBytes 512MB -StartupBytes 1024MB -MaximumBytes 2GB -Add-VMSwitch -Name "WAN" -ResourcePoolName "WAN" +#Add-VMSwitch -Name "WAN" -ResourcePoolName "WAN" +Add-VMNetworkAdapter -VMName $VMName -SwitchName "WAN" + +# RTR-03 $VMName = "RTR-03" cp D:\VHD\Base_dif\Base_server_g2.vhdx D:\VHD\$VMName.vhdx @@ -83,5 +93,7 @@ $vms = @{ New-VM @vms Set-VMMemory $VMName -DynamicMemoryEnabled $true -MinimumBytes 512MB -StartupBytes 1024MB -MaximumBytes 2GB -Add-VMSwitch -Name "Aston" -ResourcePoolName "Aston" +Add-VMNetworkAdapter -VMName $VMName -SwitchName "Aston" +Start-VM -Name RTR* +Start-VM -Name SRV*