Search This Blog

Wednesday, November 30, 2011

Netgear Switch – Setup routing between VLANs on same switch.

Scenario: I wanted to create 2 VLANs. 1 VLAN would be major VLAN (i.e. most ports), then a second smaller VLAN (less ports). I wanted to be able to route traffic between these VLANS.

Caveat: I am not a Netgear expert and the stuff written here are my experiences/research to setup the required scenario. For my future reference and hopefully might help someone else. Smile

Initial switch setup

I will not cover the initial setup but just list how the switch was configured prior to me starting this process.

All 24 ports assigned to VLAN1 as untagged, it was running over one subnet 192.168.1.0/24 with a default gateway of 192.168.1.1. 

Note: The Learned routes will not appear until devices are connected to the switch on the member ports. So if you have nothing listed do not be alarmed, unless you have something connected to one of the ports and are expecting it to appear!! Smile

image

VLAN IDs

  • 1
  • 8

VLAN subnets

  • VLAN1: 192.168.1.0/24
  • VLAN8: 192.168.8.0/24

VLAN switch Ports assignment

  • VLAN1: untagged ports 1 – 22
    with VLAN Routing interface of 192.168.1.253
  • VLAN8: untagged ports 23 – 24
    with routing interface of 192.168.8.1

image

image

image

image

PVID: Port VLAN ID

PVID is the Port VLAN ID, basically this will tag all traffic arriving at the member ports with that ID. So the PVID for the port should match the VLAN ID to which the port is a member.

image

Note: like I mentioned earlier with the Learned Routes, if the learned routes do not appear in the routing configuration you will not be able to ping VLAN interface routing IP. This threw me for a while as I was expecting to be able to ping it, it was only when I connected equipment to the member ports that the learned routes appeared and I was able to then to ping the VLAN IPs. My guess is that it is all to do with routing and that when the ports (interfaces) are not connected the unit sees them as down, and therefore it is not active. I have not tested that but I am pretty certain that would be why.

So with that all that done you should find that the unit should happily route traffic between the VLANs.

Multiple switches

Now if you wanted to this between separate switches, I am guessing you would setup the VLANs on each switch and have to add static routes using the VLAN IPs as next hops for the VLAN networks.


Share/Bookmark

Sunday, November 13, 2011

SQL Server–Shrink Transaction Log without taking database offline

We have a database that captures a large amount of data every day. Whilst the data is important, it is not critical so it is backed up on a daily basis but we do not perform transaction log backups on it, as this would be expensive and is just not warranted (to lose one days worth of data is acceptable).

With this setup this means that the transaction log is not given a checkpoint, and so never shrinks. So to shrink it we need to issue 2 commands.

BACKUP LOG <db name> WITH TRUNCATE_ONLY

basically truncates the entire log file all data lost.

DBCC SHRINKFILE(<logical transaction log name>,1000)
Where 1000 is the size in MB to shrink the log file to, in this case 1GB.
 

Share/Bookmark

Tuesday, November 08, 2011

VHD compacting error–limitation in file system

I had used the sysinternal tool (disk2vhd) to create a VHD image of one my desktop machines that I wanted to virtualise.

I got this VM up and running in Hyper-V, and after removing a number of programs and files, I wanted to compact the VHD file. So using Hyper-V to manage the disk, I went to compact the disk. When I got this error

I have truncated the error message

System failed to compact ‘……….vhd’ ….. due to a file system limitation.

Anyway after a quick web search I discovered this was probably due to snapshots in the VHD. So I run up the VM and ran the following command.

vssadmin delete shadows /all

It must also be noted that I think vssadmin is being replaced with diskshadow (edit: diskshadow is only available currently on windows 2008 server) so I think you can do the same thing with that program.

diskshadow

DISKSHADOW> delete shadows all

References:

http://www.expta.com/2010/06/unable-to-compact-vhd-due-to-file.html

http://technet.microsoft.com/en-us/library/cc772172%28WS.10%29.aspx

http://angrytechnician.wordpress.com/2011/02/23/vssadmin-is-dead-long-live-diskshadow/


Share/Bookmark

Sunday, November 06, 2011

Batch File: Force delete of share

I have recently found that there is a way to force delete a share. It was causing me grief in batch files as it was moaning there was an file in use and would want user input (Y/N).

You can actually use /Y in the command to force the yes, this is not list in the command help.

net share %Sharename% \\%COMPUTERNAME% /Y /DELETE

Someone else experienced this issue and has kindly forwarded this reference links, so I include them here. Thanks.

The MS docs that don't tell us:
http://technet.microsoft.com/en-us/library/bb490712.aspx
Expert's Exchange had the answer in 2008 but hides it at the bottom of the page:
http://www.experts-exchange.com/Programming/Languages/Scripting/Shell/Batch/Q_23154208.html
also just answered it on SuperUser:
http://superuser.com/questions/285543/net-share-xyz-delete-fails-if-a-file-is-in-use-on-that-share/


Share/Bookmark

Tuesday, November 01, 2011

Windows–Auto hide taskbar stops working

For a while I used to get an issue where the taskbar I had, that was set to autohide would suddenly stop auto hiding.

This was bloody annoying, only recourse would be to log off or restart.

However the other day I went searching for a solution and discovered a little program someone has written to sort out this problem.

Turns out the task bar stops hiding because it thinks it is still displaying a balloon tip. So by displaying another balloon tip and then having this close properly it fixes the problem.

The program, when run, just displays a balloon tip for a few seconds and then closes. The task bar is then reset and the auto hide functionality works. Hoorah.

The program is called Task Bar Slapper, available here

http://www.filefactory.com/file/ag932d0/n/Taskbar_Slapper.exe


Share/Bookmark