Hi All, I'm hoping someone can advise whether we are able to apply a DHCP scope option on our Cisco switches that is currently used on a Microsoft DHCP server. Essentially we have a LAN and WLAN and we want to ensure that when a user has a network cable plugged in that route is always preferred. With the DHCP scope for wireless managed in our HQ by a Microsoft DHCP server they have implemented Option 003 - Microsoft Default Router Metric Base with a hex value that make the WLAN metric higher and less desirable. This is working very well. Now I would like to implement this in our branches where there are Cisco switches handling the DHCP. Is it possible to apply this special option that increases the metric for Windows machines?
When I do a 'route print' from my Windows laptop it shows a variation of this where blue is the wireless interface: Active Routes: Network Destination Netmask Gateway Interface Metric 0.0.0.0 0.0.0.0 10.0.0.254 10.0.0.177 20 0.0.0.0 0.0.0.0 10.0.1.254 10.0.1.142 25 Is this possible to achieve with Cisco DHCP?
I have 100 Windows 7 laptops that, when docked, have an active wired and wireless connection at the same time. Our Windows Server 2008 R2 AD server issues DHCP addresses on a different subnet for for wired connections versus wireless connections. I'm trying to configure a Metric for the wireless DHCP addresses using the scope option of 'Microsoft Default Router Metric Base' and assigning a value of 0x1F4 (or 500 in decimal). This is to ensure that when laptops are docked with active wired and wireless connections that the wired connection will take priority. However, the scope option doesn't seem to be taking effect on the wireless adapter settings. After renewing the DHCP addresses, running 'ROUTE PRINT' on the laptop shows that the wired metric is 266 and the wireless is 276 - just as before. All other scope options are fine (router, gateways, etc.).
Manually changing the adapter and bindings settings on each laptop by moving the 'Local Area Connection' to the top of the list is not feasible in this situation. Check this page: It says: - Default Router Metric Base This option can be used to set the default base metric for DHCP clients running Windows Server 2003. When this option is set, the DHCP Client service uses the value configured here as the base metric for its default gateways. Code 3 Length 4 octets Value This value represents a specified router metric base to be used for all default gateway routes used by DHCP-enabled clients running Windows Server 2003. This value can be assigned as an integer representing a cost metric ranging from 1 through 9,999.
It is used in calculating the fastest, most reliable, and least expensive routes. If a value is not specified, a default of either one (1) or the currently set interface-specific metric is used.
If it works with WIn2003 clients, it might also work with Win7 clients. Its in 'microsoft options'. Sorry for the delay in responses, I was in meetings all day yesterday.
Metric Base Units
MarkieS - Thanks for the script. I'll have to try it out, but looks like it could work in our environment.
Previously I found another person that was using a script for their solution too (found at ), but I was hoping I could accomplish my task by using a DHCP scope option. I'll try out your script and it's much appreciated. Vivigatt - Thanks for the info too, but that was the solution I started with before posting my question. I haven't been able to get it to work.
Again, I used 0x1F4 for my metric base, but it doesn't seem to impact my Windows 7 machines. Do you think that this applies to only Windows XP and older clients maybe? I'll have to test this just to find out. The metric assigned by DHCP is only for the route to the default gateway.
But I admit that I never tried to use it. I'll try that later and if I understand how it works/what it does, I'll tell you If you want you can read my article: With my NICIndex utility, you can use route change to change the metric of a specific route. A script run on the client side then becomes as simple as: NICIndex.exe /IPPrefix=193.105.13. /Type=Ethernet %temp% SetNIC.bat if exist%temp% SetNIC.bat call%temp% SetNIC.bat route change 192.105.13.0 MASK 255.255.255.0%NICIP% Metric 50 IF%NICIDX% Select all.
Purpose The Routing APIs make it possible to create applications to administer the routing capabilities of the operating system. Where applicable Routing makes it possible for a computer to function as a network router. Developer audience The Routing APIs are designed for use by C/C programmers. Programmers should also be familiar with networking concepts.
Run-time requirements Routing is a server-based technology. All the functionality of Routing is incorporated into Windows 2000 Server and the Windows Server 2003. Routing applications cannot run on Windows NT Workstation 4.0 or on client operating systems, such as Windows 95. For more specific information about which operating systems support a particular function, refer to the Requirements sections in the documentation. In this section Topic Description The router administration API allows developers to create applications to manage the router service on a computer running Windows 2000 Server and later operating systems.
Star vs the forces of evil marco. The Management Information Base (MIB) APIs for router management makes it possible to query and set the values of MIB variables exported by one of the router managers or any of the routing protocols that the router managers service. By using this API, the router supports the Simple Network Management Protocol (SNMP).
Related topics.