TechShizz | All posts tagged 'Networking'

Setting IP Configuration via PowerShell

1. Identify the Interface Index of the NIC you want to configure.

Get-NetIPAddress

2. Set the IP address on the desired interface

New-NetIPAddress -InterfaceIndex 4 -IPAddress 10.0.0.120 –PrefixLength 24 -DefaultGateway 10.0.0.245

3. Finally, set the DNS addresses

Set-DnsClientServerAddress -InterfaceIndex 4 -ServerAddresses ("10.0.0.115","8.8.8.8")

How do we know this worked?

Get-DnsClientServerAddress

Migrating Server Roles

This guide will demonstrate how to migrate a role from one server to another; for this example we will migrate DHCP but this method can be amended to suit other roles. You should always follow Microsoft's guides and checklists when migrating roles.

On source machine
Create a shared folder on the source machine called "Mig"

On destination machine
Next if not already, intsall Windows Server Migration Tools

Import-Module ServerManager
Add-WindowsFeature Migration

Cd \
cd C:\windows\System32\ServerMigrationTools\
dir

smigdeploy.exe /package /architecture amd64 /os WS08 /path \\sourceserver\Mig


On source machine
cd c:\Mig\<folder-name of your deployment>

.\Smigdeploy.exe


Before continuing
Make sure the role being migrated is Installed on the destination server.
Make a note of the source NIC MAC address = getmacgetmac

Stop Service on Destinartion server
Stop-Serve DHCP
Check with that it stopped with:
Get-Service DHCP


Export-SmigServerSetting -FeatureID DHCP -Group -IPConfig -path C:\StorageMig -verbose
Prompted with a password.
Export-SmigServerSetting

Remove DHCP from AD

netsh DHCP delete server.domain.local 10.10.10.10

On Destination server

We must import the snapin before we can use the Import-SmigServerSetting cmdlet.

Add-PSSnapin Microsoft.windows.servermanager.migration

Import-Smigserversetting -FeatureID DHCP -IPConfig ALL -SourcePhysicalAddress <M-A-C-A-D-D-R-E-S-S> -TargetPhysicalAddress <M-A-C-A-D-D-R-E-S-S> -Path \\sourceserver\c$\StorageMig -Verbose

Start-Service DHCP
netsh DHCP add server newserver.domain.local 10.10.10.20


How to disable SIP ALG on a Draytek router

etworks with VOIP might require SIP ALG (Session Initiation Protocol (SIP) Application Layer Gateway (ALG)) disabling on a Draytek router to prevent disruption VOIP functionality.

1) Logon to the Draytek via it’s web interface, under ‘Management’ ensure that ‘Telnet’ is enabled.
2) Use Telnet via the Windows Command Prompt. (if Telnet Client is not installed you can follow this guide)
3) Issue the following commands:
sys sip_alg ?

Check to see if SIP ALG is disabled or Enabled
Checks if SIP ALG is enabled or not, if it is:
sys sip_alg 0
sys commit
sys reboot



Setting a Load Balancing Policy on a Draytek Router

If a draytek router has more than one connection to the internet, you will want to set a Load-Balance Policy. This will ensure that the router uses the single connection so that only one IP address is used. It also provides fail-over if the main connection dies.

Here we have connected a new connection to WAN2 which is now to be the default connection.


WAN Load-Balance Policy

Connecting AVG to the AVG Admin Console

If you have issues connecting an AVG client to an AVG admin server ensure the following things are considered:

1. The server and the client must be running the same version. You cant run 2012 clients on 2016 server and visa versa.
2. Ensure you have specified port 4158 and in the admin console settings page try the FQDN is the server name alone does not work.
3. Try resetting the connection settings to defualt using the defualt button then re-enter the details.