Using Subnet-Directed Broadcasts in SCCM WOL

Here’s a method to add a menu within the SCCM Console and remote-wake (WOL) computers on non-local subnets using subnet-directed broadcasts and mc-wol.exe.

1) Download and install the SCCM Console Extensions (google it; the download link may change with new versions) and mc-wol.exe (http://www.matcode.com/wol.htm). Put mc-wol.exe in C:\Program Files (x86)\SCCMConsoleExtensions\

2) Edit C:\Program Files (x86)\SCCMConsoleExtensions\SCCMAction.vbs, in the Wake On LAN section, to use the mc-wol.exe program you downloaded. This code gets a list of interfaces, and sends a WOL packet to the broadcast address of each interface calculated by its IP address and Netmask.

Be sure to allow subnet-directed broadcasts on your routers. I thank the original author of the console extensions for his/her original code. I added some variables and changed how others are calculated.

‘============
‘ Wake On LAN
‘============
Sub WakeOnLAN
On Error Resume Next

Set objSMSWMIService = GetObject(“winmgmts:{impersonationLevel=impersonate}!\\” & strSiteServer & “\” & strNameSpace)
Set result = objSMSWMIService.ExecQuery(“SELECT * FROM SMS_G_System_NETWORK_ADAPTER_CONFIGURATION WHERE ResourceID=’” & strResourceID & “‘ AND IPAddress IS NOT NULL”)
For Each instance in result
strMACAddress = instance.MACAddress
strIPAddress = instance.IPAddress
strIPSubnet = instance.IPSubnet
ipAddressBytes = “”
subnetMaskBytes = “”

ipAddressBytes = Split(strIPAddress, “.”)
subnetMaskBytes = Split(strIPSubnet, “.”)
broadcastAddress = (ipAddressBytes(0) Or (subnetMaskBytes(0) Xor 255)) & “.” & (ipAddressBytes(1) Or (subnetMaskBytes(1) Xor 255)) & “.” & (ipAddressBytes(2) Or (subnetMaskBytes(2) Xor 255)) & “.” & (ipAddressBytes(3) Or (subnetMaskBytes(3) Xor 255))
strCmdLine = “\\server\SMS_AA1\bin\i386\mc-wol.exe ” & strMACAddress & ” /a ” & broadcastAddress
WshShell.Run strCmdLine,True
MsgBox(“Ran ” & strCmdLine)
Next

WScript.Quit
End Sub

ntop 4.0.3 noDnsResolution instead of DnsResolutionForAll

After installing ntop 4.0.3 I noticed that I could not get the hostnames to show in the hosts table. This was despite not having specified the -n or the -g flags. After lots of searching, I found that disabling IPv6 would change the run-time configuration to DnsResolution for all. I didn’t see any other articles on the Internet about this so I wrote this to hopefully save you some time.

Computing IP Broadcast Address with VBScript

Here’s a simple script to calculate the broadcast address of a network using its IP address and subnet mask (VBScript)
subnetMaskBytes = Split(“255.255.255.0″, “.”)
ipAddressBytes = Split(“10.1.122.100″, “.”)

broadcastAddress = (ipAddressBytes(0) Or (subnetMaskBytes(0) Xor 255)) & “.” & (ipAddressBytes(1) Or (subnetMaskBytes(1) Xor 255)) & “.” & (ipAddressBytes(2) Or (subnetMaskBytes(2) Xor 255)) & “.” & (ipAddressBytes(3) Or (subnetMaskBytes(3) Xor 255))

Getting 802.1Q VLANs to work with VMWare

Here’s how to create multiple VLANs on a Linux machine running on a VMWare server. I did this to run arpwatch to monitor IP conflicts on our LAN. Be sure not to send any traffic out these interfaces unless you intend it to broadcast to all attached NICs.

In VMWare:
1) Click on the server root node, and choose the Configuration tab
2) Select the properties for the NIC that you want to use VLAN tagging on
3) Select Edit to enable Promiscuous Mode

Then in Linux:

4)

# First bring up interface
ip link set eth1 up
# Add VLAN tagged interfaces
ip link add link eth1 name vlan6 type vlan id 6
ip link set vlan6 up
ip link add link eth1 name vlan22 type vlan id 22
ip link set vlan22 up
ip link add link eth1 name vlan23 type vlan id 23
ip link set vlan23 up