Skip to main content

From Conception to Completion we can help with your IT needs

Go Search
Home
  
From Conception to Completion we can help with your IT needs > Windows Server 2008 Core > netsh command  

netsh command

To set a static IP address
 
1.  At a command prompt, type the following:
netsh interface ipv4 show interfaces
 
2.  Make a note of the number shown in the Idx column of the output for your network adapter. If your computer has more than one network adapter, make a note of the number corresponding to the network adapter for which you wish to set a static IP address.
 
3.  At the command prompt, type:
netsh interface ipv4 set address name="<ID>" source=static address=<StaticIP> mask=<SubnetMask> gateway=<DefaultGateway>
Where:
ID is the number from step 2 above
StaticIP is the static IP address that you are setting
SubnetMask is the subnet mask for the IP address
DefaultGateway is the default gateway
 
4.  At the command prompt, type:
 
netsh interface ipv4 add dnsserver name="<ID>" address=<DNSIP>index=1
Where:
ID is the number from step 2 above
DNSIP is the IP address of your DNS server
 
5.  Repeat step 4 for each DNS server that you want to set, incrementing the index= number each time.
 
 
  Note: 
If you set the static IP address on the wrong network adapter, you can change back to using the DHCP address supplied by using the following command:
netsh interface ipv4 set address name="<ID>" source=dhcp
where ID is the number of the network adapter from Step 2.
Firewall Administration
 
 
  • To disable the firewall;
    • netsh advfirewall set allprofiles firewallpolicy allowinbound, allowoutbound
  • To allow remote administration via the management tools in the adminpak (including the firewall)
    • netsh advfirewall set currentprofile settings remotemanagement enable
  • To enable remote administration (other roles can be substitutes)
    • netsh advfirewall firewall set rule group="Remote Administration" new enable=yes

Last modified at 2/19/2008 12:17 PM  by Jarrod Katz - Admin