備忘録

Create Virtual Switch(SET)
New-VMSwitch -Name “<仮想スイッチ名>” -NetAdapterName “<NICアダプタ名>”,”<NICアダプタ名>” -EnableEmbeddedTeaming $True

Set-VMSwitchTeam -Name “<仮想スイッチ名>” -LoadBalancingalgorithm Dynamic

Get-VMSwitchTeam -Name “<仮想スイッチ名>”

Add-VMNetworkAdapter -ManagementOS -Name “<識別名>” -SwitchName “<仮想スイッチ名>”

Set-VMNetworkAdapterVlan -ManagementOS -VMNetworkAdapterName “<識別名>” -Access -VlanId <VLAN ID>

Get-VMNetworkAdapterVlan -ManagementOS

Set-VMSwitch “<仮想スイッチ名>” -AllowManagementOS $False

Ref. https://learn.microsoft.com/en-us/previous-versions/orphan-topics/ws.11/mt403349(v=ws.11)?redirectedfrom=MSDN

IPv4 Address Set
Get-NetAdapter | New-NetIPAddress -AddressFamily IPv4 -IPAddress 10.0.0.0 -PrefixLength 24 -DefaultGateway 10.0.0.1


IPv6 Address Set
Get-NetAdapter | New-NetIPAddress -AddressFamily IPv6 -IPAddress 2001:1:2:3:4:5:6:7 -PrefixLength 24 -DefaultGateway 2001:1:2:3:0:0:0:1


Set Link Local Address for DefaultGateway
Get-NetAdapter | New-NetIPAddress -AddressFamily IPv6 -IPAddress 2001:1:2:3:4:5:6:7 -PrefixLength 24Get-NetAdapter | New-NetRoute -AddressFamily IPv6 -DestinationPrefix ::/0 -NextHop fe80::1

Disable autoconfig
Set-NetIPInterface -RouteDiscovery Disabled

DNS Setting
Get-NetAdapter | Set-DnsClientServerAddress -ServerAddress 10.0.0.1, 10.0.1.1, 2001::1, 2002::1

Restart NIC
Get-NetAdapter | Restart-NetAdapter

Unset defaultgateway
Get-NetAdapter | Remove-NetRoute -DestinationPrefix 0.0.0.0/0 -confirm $False
Get-NetAdapter | Remove-NetRoute -DestinatiopnPrefix ::/0 -confirm $False

DHCP Enable
Get-Netadapter | Set-NetIPInterface -AddressFamily IPv4 -Dhcp Enabled

Add DNS suffix
Get-NetAdapter | Set-DnsClient “Ethernet” -ConnectionSpecificSuffix “example.com”

RouterOS

TRUNK参考 https://forum.rb-ug.jp/t/topic/229