Ricky in Melbourne - Enjoy Learning

Configure Tomato VPN server to access back home network

I always like trying out different features on my ASUS RT-N16 with Shibby Tomato at home, which is so powerful and has so many potentials

Another feature I’d like to play with today is the VPN feature in Tomato, not the VPN client (most users know that Tomato can auto dial in a remote VPN server, like the way you had in your Windows computer), but the VPN server functionality

So this time I will enable Tomato router as a VPN server, to allow device VPN back to my home network in order to access my home network

Image that if for some reason, I have to access my home network, like access internal storage, printer or any other devices, I can easily use my company laptop (or maybe even my smart phone) VPN back in and grab the file

Let just get started:

1. Check which VPN protocol I need to enable

Navigate to Tomato->VPN Tunneling

image

As you can see here, Tomato support OpenVPN and PPTP.

Since Windows natively support PPTP (no need to install any client), I’m just enabling PPTP here, which is more common and popular, but I do hope Tomato can support SSTP and IKEv2

image

1. Configure the VPN Server settings on Tomato

image

2. Setup a VPN connection on my device

I’m just using the Windows wizard to create a VPN connection

imageimage

3. Connect back to home

I’m using my phone tethering network for testing here

imageimage

4. Test the VPN connection

Ping one of my home device

image

5. Check the VPN connection log

imageimage

It works great

Enjoying

You can always find my other Tomato playing post by below links

Configuring Shibby Tomato to fit for my home lab

Shibby Tomato configuration details

Use the advance tomato USB storage feature

By Ricky Gao (高俊) on June 12, 2014 | Network, Tech, Tomato | A comment?

Get specific folder size on multi remote computers

I’ve been requested to report a specific folder size on multi computers (1000+)

Below is the script with comments

 

$Array = @() #Makes an array, or a collection to hold all the object of the same fields

$serverlistpath = read-host ‘Please provide the full path of the serverlist file, like c:\server.txt’ #Input the server list

$ServerList = get-content -Path $serverlistpath #get the server list

foreach ($ServerName in $ServerList)

{

       $Path = \\$serverName\c$\Folder #Folder path to scan

       $FolderSize = Get-ChildItem $path -recurse | Measure-Object -Sum length  #Get folder size

       $FolderSizebytes = {0:N} -f $FolderSize.sum #Format size

       $FolderSizeMB = $FolderSize.sum/1MB #convert size to MB

       $FolderSizeMB = {0:N2} -f $FolderSizeMB #Format MB size to 2 digital after point

       $FinalResult = New-Object PSObject #Prepare csv object

       Add-Member -inputObject $FinalResult -memberType NoteProperty -name ServerName -value $ServerName #Insert ServerName to csv

       Add-Member -inputObject $FinalResult -memberType NoteProperty -name FolderSize(bytes) -value $FolderSizebytes #Insert FolderSize(bytes) to csv

       Add-Member -inputObject $FinalResult -memberType NoteProperty -name FolderSize(MB) -value $FolderSizeMB #Insert FolderSize(MB) to csv

       $Array += $FinalResult #Add result to array

       $FinalResult

}

$OutPut = $Array

$OutPut | Export-Csv -noTypeInformation -path C:\Result.csv

 

 

The result will shown on both powershell console and d:\result.csv as well

 

By Ricky Gao (高俊) on June 8, 2014 | Scripts, Tech | A comment?

Enable IE11 enterprise mode by registry

IE11 comes with a really handy feature called "Enterprise Mode", which is an enhancement of compatibility mode

In "Enterprise Mode", IE11 will trying to rendering the website using the old legacy way, IE 8 mode, which allows IE11 to work with a big number of legacy enterprise applications.

Enable IE11 enterprise mode is really easy, you can either go with registry or group policy, read more here.

GPO is always the best place to centralize enable IE11 enterprise mode, but if we have to use registry way for some reason, here’s the quick PowerShell script.

Local Computer

New-Item -Path "HKCU:\Software\Policies\Microsoft\Internet Explorer\Main\EnterpriseMode" -force

New-ItemProperty -Path "HKCU:\Software\Policies\Microsoft\Internet Explorer\Main\EnterpriseMode" -Name Enable -force

New-Item -Path "HKLM:\Software\Policies\Microsoft\Internet Explorer\Main\EnterpriseMode" -force

New-ItemProperty -Path "HKLM:\Software\Policies\Microsoft\Internet Explorer\Main\EnterpriseMode" -Name Enable -force

Remote Computers

$credential = Get-Credential

$serverlistpath = read-host ‘Please provide the full path of the serverlist file, like c:\server.txt’

$serverlist = Get-Content -Path $serverlistpath

Invoke-Command -ComputerName $serverlist -Credential $credential -ScriptBlock {New-Item -Path "HKCU:\Software\Policies\Microsoft\Internet Explorer\Main\EnterpriseMode" -force}

Invoke-Command -ComputerName $serverlist -Credential $credential -ScriptBlock {New-ItemProperty -Path "HKCU:\Software\Policies\Microsoft\Internet Explorer\Main\EnterpriseMode" -Name Enable -force}

Invoke-Command -ComputerName $serverlist -Credential $credential -ScriptBlock {New-Item -Path "HKLM:\Software\Policies\Microsoft\Internet Explorer\Main\EnterpriseMode" -force}

Invoke-Command -ComputerName $serverlist -Credential $credential -ScriptBlock {New-ItemProperty -Path "HKLM:\Software\Policies\Microsoft\Internet Explorer\Main\EnterpriseMode" -Name Enable -force}

After IE11 enterprise mode enabled, you will see a new option shown in "Tools" menu, and once the current website is under "Enterprise Mode", you will see a building icon like below

imageimage

If you have a huge list of website, you can download the "Enterprise Mode Site List Manager" to Add sites to the Enterprise Mode site list using the Enterprise Mode Site List Manager

imageimage

By Ricky Gao (高俊) on May 25, 2014 | IE, Scripts, Tech | A comment?

AD
ADFS
ADRMS
Android
Azure
Certification
Citrix
Cluster