I want to programmatically (e.g., from a script, console mode program,
or Windows program) change the link speed of an Ethernet interface in
a WindowsXP PC. Rebooting is not acceptable. I have tried to do this
via SNMP and it does not seem to work. My SNMP incantations are:
c:\work>snmptool get 127.0.0.1 public interfaces.ifTable.ifEntry.ifDescr.2
ErrorStatus: 0 (No Error)
ErrorIndex: 0
varbind 1:
Name: interfaces.ifTable.ifEntry.ifDescr.2
OID: 1.3.6.1.2.1.2.2.1.2.2
Type: OCTET STRING
Length: 68
Value: Intel(R) PRO/1000 MT Network Connection - Packet Scheduler Miniport
c:\work>snmptool get 127.0.0.1 public interfaces.ifTable.ifEntry.ifSpeed.2
ErrorStatus: 0 (No Error)
ErrorIndex: 0
varbind 1:
Name: interfaces.ifTable.ifEntry.ifSpeed.2
OID: 1.3.6.1.2.1.2.2.1.5.2
Type: Gauge
Value: 100000000
c:\work>snmptool set 127.0.0.1 public
interfaces.ifTable.ifEntry.ifSpeed.2 6 10000000
ErrorStatus: 2 (No such variable name)
ErrorIndex: 1
varbind 1:
Name: interfaces.ifTable.ifEntry.ifSpeed.2
OID: 1.3.6.1.2.1.2.2.1.5.2
Type: Gauge
Value: 10000000
Yes, I have made public READWRITE.
I can change my link speed (and without reboot) from the properties
dialog box for my NIC. So, clearly (?!) there must be a way for me to
do this from a program.
Five stars to someone who can show me how to do this with an example
program. Preferred is to get SNMP to work. Second preference is
within a C language program. If the solution must be NIC specific, I
can live with that (but, a general solution is preferred).
Thanks! |