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