Last version before end of week.
Need to refactor routing conf (via netsh) and reboots.
This commit is contained in:
parent
7db3533a5d
commit
44cf01520a
@ -40,31 +40,16 @@ $IPType = "IPv4"
|
|||||||
|
|
||||||
#Arc-SRV IP conf
|
#Arc-SRV IP conf
|
||||||
|
|
||||||
$adapter = Get-NetAdapter | ? {$_.Name -eq "Arc-SRV"}
|
netsh interface ip set address name="Arc-SRV" static 192.168.8.254 255.255.255.0
|
||||||
$IP = "192.168.8.254"
|
|
||||||
$adapter | New-NetIPAddress `
|
|
||||||
-AddressFamily $IPType `
|
|
||||||
-IPAddress $IP `
|
|
||||||
-PrefixLength $MaskBits
|
|
||||||
|
|
||||||
#Arc-CLI conf
|
#Arc-CLI conf
|
||||||
|
|
||||||
$adapter = Get-NetAdapter | ? {$_.Name -eq "Arc-CLI"}
|
netsh interface ip set address name="Arc-CLI" static 192.168.12.8 255.255.255.0
|
||||||
$IP = "192.168.12.254"
|
|
||||||
$adapter | New-NetIPAddress `
|
|
||||||
-AddressFamily $IPType `
|
|
||||||
-IPAddress $IP `
|
|
||||||
-PrefixLength $MaskBits `
|
|
||||||
|
|
||||||
### WAN conf
|
### WAN conf
|
||||||
|
|
||||||
$adapter = Get-NetAdapter | ? {$_.Name -eq "WAN"}
|
netsh interface ip set address name="WAN" static 192.168.255.8 255.255.255.0`
|
||||||
$IP = "192.168.255.8"
|
192.168.255.254
|
||||||
$adapter | New-NetIPAddress `
|
|
||||||
-AddressFamily $IPType `
|
|
||||||
-IPAddress $IP `
|
|
||||||
-PrefixLength $MaskBits `
|
|
||||||
-DefaultGateway "192.168.255.254"
|
|
||||||
|
|
||||||
|
|
||||||
### DNS Conf for all InterfaceAlias ###
|
### DNS Conf for all InterfaceAlias ###
|
||||||
|
@ -34,21 +34,12 @@ $IPType = "IPv4"
|
|||||||
|
|
||||||
#Bou-LAN IP conf
|
#Bou-LAN IP conf
|
||||||
|
|
||||||
$adapter = Get-NetAdapter | ? {$_.Name -eq "Bou-LAN"}
|
netsh interface ip set address name="Bou-LAN" static 192.168.128.254 255.255.255.0
|
||||||
$IP = "192.168.128.254"
|
|
||||||
$adapter | New-NetIPAddress `
|
|
||||||
-AddressFamily $IPType `
|
|
||||||
-IPAddress $IP `
|
|
||||||
-PrefixLength $MaskBits
|
|
||||||
|
|
||||||
#WAN
|
#WAN
|
||||||
|
|
||||||
$adapter = Get-NetAdapter | ? {$_.Name -eq "WAN"}
|
netsh interface ip set address name="WAN" static 192.168.255.128 255.255.255.0`
|
||||||
$IP = "192.168.255.254"
|
192.168.255.254
|
||||||
$adapter | New-NetIPAddress `
|
|
||||||
-AddressFamily $IPType `
|
|
||||||
-IPAddress $IP `
|
|
||||||
-PrefixLength $MaskBits `
|
|
||||||
|
|
||||||
# END
|
# END
|
||||||
|
|
||||||
|
@ -19,7 +19,7 @@ echo "Renaming Computer"
|
|||||||
$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
|
||||||
}
|
}
|
||||||
#End
|
#End
|
||||||
|
|
||||||
@ -36,18 +36,11 @@ $IPType = "IPv4"
|
|||||||
|
|
||||||
#WAN IP conf
|
#WAN IP conf
|
||||||
|
|
||||||
$adapter = Get-NetAdapter | ? {$_.Name -eq "WAN"}
|
netsh interface ip set address name="WAN" static 192.168.255.254 255.255.255.0
|
||||||
$IP = "192.168.255.254"
|
|
||||||
$adapter | New-NetIPAddress `
|
|
||||||
-AddressFamily $IPType `
|
|
||||||
-IPAddress $IP `
|
|
||||||
-PrefixLength $MaskBits
|
|
||||||
|
|
||||||
#Aston
|
#Aston
|
||||||
|
|
||||||
$adapter = Get-NetAdapter | ? {$_.Name -eq "Aston"}
|
netsh interface ip set address name="Aston" DHCP
|
||||||
$IP = "192.168.255.254"
|
|
||||||
$adapter | Set-NetIPInterface -Dhcp Enabled
|
|
||||||
|
|
||||||
### DNS Conf for all InterfaceAlias
|
### DNS Conf for all InterfaceAlias
|
||||||
|
|
||||||
@ -102,4 +95,5 @@ 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
|
||||||
|
|
||||||
|
ipconfig /renew
|
||||||
Read-Host "Finished???"
|
Read-Host "Finished???"
|
||||||
|
@ -17,8 +17,11 @@ Rename-computer "SRV-1"
|
|||||||
### Rename interfaces by parsing VM device name
|
### Rename interfaces by parsing VM device name
|
||||||
|
|
||||||
echo "Renaming adapters"
|
echo "Renaming adapters"
|
||||||
$HVName = (Get-NetAdapterAdvancedProperty -name "Ethernet" -DisplayName "Hyper-v Network Adapter Name").DisplayValue
|
$adapts = Get-NetAdapter
|
||||||
Rename-Netadapter -name Ethernet -NewName $HVName
|
foreach ($adapt in $adapts) {
|
||||||
|
$HVName = (Get-NetAdapterAdvancedProperty -name $adapt.name -DisplayName "Hyper-v Network Adapter Name").DisplayValue
|
||||||
|
Rename-Netadapter -name $adapt.name -NewName $HVName
|
||||||
|
}
|
||||||
#End
|
#End
|
||||||
|
|
||||||
# Pausing to let things settle
|
# Pausing to let things settle
|
||||||
@ -31,17 +34,8 @@ Sleep 10
|
|||||||
|
|
||||||
#Arc-SRV
|
#Arc-SRV
|
||||||
|
|
||||||
$adapter = Get-NetAdapter | ? {$_.Name -eq "Arc-SRV"}
|
netsh interface ip set address name="Arc-SRV" static 192.168.8.1 255.255.255.0`
|
||||||
|
192.168.8.255
|
||||||
$IP = "192.168.8.1"
|
|
||||||
$MaskBits = 24 # This means subnet mask = 255.255.255.0
|
|
||||||
$IPType = "IPv4"
|
|
||||||
|
|
||||||
$adapter | New-NetIPAddress `
|
|
||||||
-AddressFamily $IPType `
|
|
||||||
-IPAddress $IP `
|
|
||||||
-PrefixLength $MaskBits `
|
|
||||||
-DefaultGateway 192.168.8.255
|
|
||||||
|
|
||||||
### DNS Conf for all InterfaceAlias ###
|
### DNS Conf for all InterfaceAlias ###
|
||||||
|
|
||||||
|
@ -12,8 +12,8 @@ cp D:\VHD\Base_dif\Base_server_g2.vhdx D:\VHD\SRV-01.vhdx
|
|||||||
|
|
||||||
Mount-VHD d:\VHD\SRV-01.vhdx
|
Mount-VHD d:\VHD\SRV-01.vhdx
|
||||||
Copy-Item d:\Unattend\SRV-01.xml -Destination e:\Windows\Panther\Unattend.xml
|
Copy-Item d:\Unattend\SRV-01.xml -Destination e:\Windows\Panther\Unattend.xml
|
||||||
mkdir c:\Scripts
|
mkdir e:\Tools\Scripts
|
||||||
Copy-items d:\Scripts\Guests\SRV-01.ps1
|
Copy-item d:\Scripts\Guests\SRV-01.ps1 E:\Tools\scripts
|
||||||
Dismount-VHD d:\VHD\SRV-01.vhdx
|
Dismount-VHD d:\VHD\SRV-01.vhdx
|
||||||
|
|
||||||
$vms = @{
|
$vms = @{
|
||||||
@ -23,7 +23,6 @@ $vms = @{
|
|||||||
MemoryStartupBytes = 1024Mb
|
MemoryStartupBytes = 1024Mb
|
||||||
VHDPath = "d:\VHD\SRV-01.vhdx"
|
VHDPath = "d:\VHD\SRV-01.vhdx"
|
||||||
SwitchName = "Arc-SRV"
|
SwitchName = "Arc-SRV"
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
New-VM @vms
|
New-VM @vms
|
||||||
@ -42,8 +41,8 @@ cp D:\VHD\Base_dif\Base_server_g2.vhdx D:\VHD\RTR-01.vhdx
|
|||||||
|
|
||||||
Mount-VHD d:\VHD\RTR-01.vhdx
|
Mount-VHD d:\VHD\RTR-01.vhdx
|
||||||
Copy-Item d:\Unattend\RTR-01.xml -Destination e:\Windows\Panther\Unattend.xml
|
Copy-Item d:\Unattend\RTR-01.xml -Destination e:\Windows\Panther\Unattend.xml
|
||||||
mkdir c:\Scripts
|
mkdir e:\Tools\Scripts
|
||||||
Copy-items d:\Scripts\Guests\RTR-01.ps1
|
Copy-item d:\Scripts\Guests\RTR-01.ps1 E:\Tools\scripts
|
||||||
Dismount-VHD d:\VHD\RTR-01.vhdx
|
Dismount-VHD d:\VHD\RTR-01.vhdx
|
||||||
|
|
||||||
$vms = @{
|
$vms = @{
|
||||||
@ -74,8 +73,8 @@ cp D:\VHD\Base_dif\Base_server_g2.vhdx D:\VHD\RTR-02.vhdx
|
|||||||
|
|
||||||
Mount-VHD d:\VHD\RTR-02.vhdx
|
Mount-VHD d:\VHD\RTR-02.vhdx
|
||||||
Copy-Item d:\Unattend\RTR-02.xml -Destination e:\Windows\Panther\Unattend.xml
|
Copy-Item d:\Unattend\RTR-02.xml -Destination e:\Windows\Panther\Unattend.xml
|
||||||
mkdir c:\Scripts
|
mkdir e:\Tools\Scripts
|
||||||
Copy-items d:\Scripts\Guests\RTR-02.ps1
|
Copy-item D:\scripts\Guests\RTR-02.ps1 E:\Tools\scripts
|
||||||
Dismount-VHD d:\VHD\RTR-02.vhdx
|
Dismount-VHD d:\VHD\RTR-02.vhdx
|
||||||
|
|
||||||
$vms = @{
|
$vms = @{
|
||||||
@ -106,8 +105,8 @@ cp D:\VHD\Base_dif\Base_server_g2.vhdx D:\VHD\RTR-03.vhdx
|
|||||||
|
|
||||||
Mount-VHD d:\VHD\RTR-03.vhdx
|
Mount-VHD d:\VHD\RTR-03.vhdx
|
||||||
Copy-Item d:\Unattend\RTR-03.xml -Destination e:\Windows\Panther\Unattend.xml
|
Copy-Item d:\Unattend\RTR-03.xml -Destination e:\Windows\Panther\Unattend.xml
|
||||||
mkdir c:\Scripts
|
mkdir e:\Tools\Scripts
|
||||||
Copy-items d:\Scripts\Guests\RTR-03.ps1
|
Copy-item d:\Scripts\Guests\RTR-03.ps1 E:\Tools\scripts
|
||||||
Dismount-VHD d:\VHD\RTR-03.vhdx
|
Dismount-VHD d:\VHD\RTR-03.vhdx
|
||||||
|
|
||||||
$vms = @{
|
$vms = @{
|
||||||
|
Loading…
Reference in New Issue
Block a user