Full auto. Add network renaming
This commit is contained in:
parent
0afd4e96a0
commit
91200bf002
12
RTR-01.ps1
12
RTR-01.ps1
@ -5,8 +5,16 @@
|
|||||||
# RTR-01 Only
|
# RTR-01 Only
|
||||||
|
|
||||||
# Change the poor machine name
|
# Change the poor machine name
|
||||||
$name = Read-host "Nouveau nom d'hôte?"
|
|
||||||
Rename-computer $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
|
||||||
|
|
||||||
|
Rename-NetAdapter -Name "Ethernet" -NewName "Arc-SRV"
|
||||||
|
Rename-NetAdapter -Name "Ethernet 2" -NewName "Arc-CLI"
|
||||||
|
Rename-NetAdapter -Name "Ethernet 3" -NewName "WAN"
|
||||||
|
|
||||||
# Install Routing and necessary linked roles
|
# Install Routing and necessary linked roles
|
||||||
Install-WindowsFeature RemoteAccess, RSAT-RemoteAccess-PowerShell, Routing -IncludeManagementTools
|
Install-WindowsFeature RemoteAccess, RSAT-RemoteAccess-PowerShell, Routing -IncludeManagementTools
|
||||||
|
11
RTR-02.ps1
11
RTR-02.ps1
@ -4,10 +4,15 @@
|
|||||||
# 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-02 Only
|
# RTR-02 Only
|
||||||
|
|
||||||
# Change the poor machine name
|
Read-host "Script for RTR-02"
|
||||||
$name = Read-host "Nouveau nom d'hôte?"
|
Read-host "WARNING: Plug-in in this order Bou-LAN and WAN"
|
||||||
Rename-computer $name
|
echo "Shamefully made by Alexandre Simao. Pardon-me M. Stallman"
|
||||||
|
|
||||||
|
# Change the poor machine name
|
||||||
|
Rename-computer "RTR-02"
|
||||||
|
|
||||||
|
Rename-NetAdapter -Name "Ethernet" -NewName "Bou-LAN"
|
||||||
|
Rename-NetAdapter -Name "Ethernet 2" -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 address "WAN" static 192.168.255.8 255.255.255.0 192.168.255.254
|
||||||
netsh interface ip set address "Bou-LAN" static 192.168.128.254 255.255.255.0
|
netsh interface ip set address "Bou-LAN" static 192.168.128.254 255.255.255.0
|
||||||
|
@ -7,11 +7,10 @@
|
|||||||
# RTR-03 Only
|
# RTR-03 Only
|
||||||
|
|
||||||
# Change the poor machine name
|
# Change the poor machine name
|
||||||
$name = Read-host "Nouveau nom d'hôte?"
|
Rename-computer "RTR-03"
|
||||||
Rename-computer $name
|
|
||||||
|
|
||||||
Set-NetConnectionProfile -NetworkCategory Private
|
|
||||||
|
|
||||||
|
Rename-NetAdapter -Name "Ethernet" -NewName "WAN"
|
||||||
|
Rename-NetAdapter -Name "Ethernet 2" -NewName "Aston"
|
||||||
|
|
||||||
# Install Routing and necessary linked roles
|
# Install Routing and necessary linked roles
|
||||||
Install-WindowsFeature RemoteAccess, RSAT-RemoteAccess-PowerShell, Routing -IncludeManagementTools
|
Install-WindowsFeature RemoteAccess, RSAT-RemoteAccess-PowerShell, Routing -IncludeManagementTools
|
||||||
|
@ -2,26 +2,24 @@
|
|||||||
# GPL v3
|
# GPL v3
|
||||||
|
|
||||||
# SRV-01 ONLY
|
# SRV-01 ONLY
|
||||||
|
# TODO : exclusion/attribution fields
|
||||||
|
# Rename interfaces
|
||||||
|
#
|
||||||
|
|
||||||
#Rename this piece of garbage
|
#Rename this piece of garbage
|
||||||
$name = Read-host "Nom d'hôte?"
|
Rename-computer "SRV-1"
|
||||||
Rename-computer $name
|
Rename-NetAdapter -Name "Ethernet" -NewName "Arc-SRV"
|
||||||
|
|
||||||
# Install the DHCP role (Management tools if you love Metrosexual UI)
|
# Install the DHCP role (Management tools if you love Metrosexual UI)
|
||||||
Install-WindowsFeature DHCP -IncludeManagementTools
|
Install-WindowsFeature DHCP -IncludeManagementTools
|
||||||
|
|
||||||
# Show all the interface via iproute2 - LOL no via a shitty lookalike
|
# Show all the interface via iproute2 - LOL no via a shitty lookalike
|
||||||
netsh inter ipv4 show inter
|
netsh inter ipv4 show inter
|
||||||
|
Set-NetConnectionProfile -NetworkCategory Private
|
||||||
# Define various variables
|
|
||||||
$DHCPServerIP = Read-Host "Interface IP served by DHCP?"
|
|
||||||
$Interface = Read-host "Interface Name?"
|
|
||||||
$DefGat = Read-Host "Default Gateway?"
|
|
||||||
$DNS = Read-Host "DNS Server?"
|
|
||||||
|
|
||||||
# Behold the LoserShell "cmdlet" to attribute static IP
|
# Behold the LoserShell "cmdlet" to attribute static IP
|
||||||
New-NetIPAddress -IPAddress $DHCPServerIP -InterfaceAlias "$Interface" `
-DefaultGateway $DefGat -AddressFamily IPv4 -PrefixLength 24
|
New-NetIPAddress -IPAddress 192.168.8.1 -InterfaceAlias "Arc-SRV" `
-DefaultGateway 192.168. -AddressFamily IPv4 -PrefixLength 24
|
||||||
Set-DnsClientServerAddress -InterfaceAlias "$Interface" -ServerAddresses $DNS
|
Set-DnsClientServerAddress -InterfaceAlias "Arc-SRV" -ServerAddresses 9.9.9.9
|
||||||
|
|
||||||
# Create DHCP "security" groups
|
# Create DHCP "security" groups
|
||||||
netsh dhcp add securitygroups
|
netsh dhcp add securitygroups
|
||||||
|
Loading…
Reference in New Issue
Block a user