Re: Set the TCP/IP Alternate Configuration settings per program



That exactly AddIPAddress() for current session and for persistance you need
to write that to registry.
OTOH you can check WMI option if exist
Arkady

"Rolf Michael" <RolfMichael@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:674B6471-988B-443A-857B-17D82CE88AB7@xxxxxxxxxxxxxxxx
The IP address created by AddIPAddress is not persistent.

AddIPAddress() and the Alternate configuration is not the same.
See the Article following.

Alternate configuration enables a computer to use an alternate, manually
configured IP address configuration in the absence of a Dynamic Host
Configuration Protocol (DHCP) server. You can use an alternate
configuration
when a computer is used on more than one network, at least one of the
networks does not have a DHCP server, and automatic configuration is not
wanted.
For example, if you have a laptop computer that you use both at the office
and at home, it is useful to configure TCP/IP for an alternate
configuration.
At the office, the laptop uses a DHCP-allocated TCP/IP configuration. At
home, where there is no DHCP server present, the laptop automatically uses
the alternate configuration, which provides easy access to home network
devices and the Internet and allow seamless operation on both networks,
without the manual reconfiguration of TCP/IP settings.
Without an alternate configuration, TCP/IP uses Automatic Private IP
Addressing (APIPA).

I have to set an Alternate Configuration from my own Program, not with the
GUI:

To configure TCP/IP for an alternate configuration
1. Open Network Connections.
2. Right-click the network connection that you want to configure, and then
click Properties.
3. On the General tab (for a local area connection) or the Networking tab
(for all other connections), click Internet Protocol (TCP/IP), and then
click
Properties.
4. On the General tab, click Obtain an IP address automatically.
5. On the Alternate Configuration tab, click User configured, and then
type
appropriate values for the following:
? IP address
? Subnet mask
? Default gateway
? Preferred and alternate DNS server
? Preferred and alternate WINS server






"Arkady Frenkel" wrote:

Look at IPHLPAPI's AddIPAddress()
Arkady

"Rolf Michael" <RolfMichael@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:EC8801CC-6DDF-4830-AFDD-014D18B0B2D0@xxxxxxxxxxxxxxxx
To set the "alternate configuration" programatically:
Does anyone know of an API?
Or is there a Microsoft-documentation of the registry entry
HKLM\System\CCS\Services\Dhcp\Configurations\Alternate_{AdapterName}\Options
REG_BINARY. (The extraction of the fields in the REG_BINARY-structure
locks
quite straight-forward - but an API or a documentation gives a much
better
feeling ...)





.



Relevant Pages

  • RE: can send but not receive
    ... This can be an issue with a firewall blocking traffic, or the TCP/IP stack could be corrupted (i.e. can't change tcpip configuration) ... 299357 How to Reset Internet Protocol (TCP/IP) in Windows XP ... >network status shows outbound is okay. ...
    (microsoft.public.win2000.networking)
  • Re: AD - Computer Policy
    ... if you are not statically configuring tcp/ip then you can use a dhcp ... server/scope to assign tcp/ip configuration including dns servers. ... network assuming it uses dhcp. ... I set up an AD COMPUTER Policy in my domain to set the DNS servers in IP ...
    (microsoft.public.win2000.security)
  • Re: Alternate IP
    ... >> Martin, ... >> is the purpose of using the alternate configuration? ... he simply connect the laptop to the modem and the DHCP receive a TCP/IP ... If the Alternate configuration tab won't do the job, ...
    (microsoft.public.windowsxp.network_web)
  • Re: Different network profiles.. how?
    ... >Under the General tab click on TCP/IP then click on properties. ... >Enter the values for the other network in the spaces provided. ... Configure the primary configuration to obtain an IP address ...
    (microsoft.public.windowsxp.network_web)
  • Re: minlogon with network
    ... I have added the network adapter component. ... TCP/IP can work with the minlogon, but it seems that it can not connection ... have create my own .slx configuration for my target without some of these ...
    (microsoft.public.windowsxp.embedded)