How to set IP address, subnet mask, default gateway for an adapter

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Trevor (trevor_at_nospam.com)
Date: 04/30/04


Date: Fri, 30 Apr 2004 10:04:43 -0400

Hello,

    I am trying to programmatically setup an IP adapter (static IP, subnet
mask, default gateway, etc...) based on data in a configuration file. I am
aware of the IP Helper API function AddIPAddress which can be used to add an
IP address to a network adapter. I would also like to set the default
gateway, DNS server, alt DNS server, WINS server, alt WINS server
programmatically. Is this possible? If the only way to do this is via the
Registry then what keys do I modify? Any advice is appreciated.



Relevant Pages

  • Re: Changing the Default Gateway
    ... Since you can ping the DNS server, use nslookup to *manually* query the DNS server and see what happens. ... Many upstream providers only allow DNS queries from their own network connections. ... So by switching to the other device as a gateway, your DNS queries may be getting blocked at *their* network edge. ... Second, if I read you correctly you have 2 NICS teamed on the same subnet and all computers, including the SBS are attached to a switch, along with the router. ...
    (microsoft.public.windows.server.sbs)
  • Re: Changing the Default Gateway
    ... Second, if I read you correctly you have 2 NICS teamed on the same subnet and all computers, including the SBS are attached to a switch, along with the router. ... Third, the *kind* of service offered by the carrier should have nothing to do with the ip settings on the ports of your devices, although it may introduce some complexity into the relationship between the LAN and the WAN, with devices to facilitate the hand off that I have never seen. ... Currently our frame network uses .254 as its gateway. ... All tests passed on this DNS server ...
    (microsoft.public.windows.server.sbs)
  • Re: Changing the Default Gateway
    ... I have created this network map that gives a visual of what I am working ... Changing the Default Gateway really should have no effect on how DNS for LAN ... This worked but when I changed the SBS DG to .222 it failed. ... nslookup to *manually* query the DNS server and see what happens. ...
    (microsoft.public.windows.server.sbs)
  • Re: STEP 2, fixing dhclient behaviour with multiple interfaces
    ... >>SLPv2 is used to find the gateway and DNS server, and after that, ... client machine playing by the ND rules in the "INCOMPLETE" ... In any case, ND is kind of like DHCP, in that explicit support ...
    (freebsd-current)
  • Re: Changing the Default Gateway
    ... We have 2 NIC running as a team on our SBS. ... Currently our frame network uses .254 as its gateway. ... I can ping the any external ip... ... All tests passed on this DNS server ...
    (microsoft.public.windows.server.sbs)