Search : in
By :

Set Static IP Per Domain Server

Nigel, on Sep 8, 2009 12:07:26 pm BST 
 Report this message to moderators

Hello,
We have 2 offices linked up on a VPN Connection. Each office has its own Domain Server..IP in office 1 and Office 2 have different IP Ranges...i.e. 192.168.0.1 and 192.168.1.1....We also have an additional internet line for faster internet in both offices and hence need to set up manual IP's. I have tested succeffully scripts to set Automatically and Manual IP's...... I am looking for a script to run automatically when starting up the machine to determine which "Office I am in" i.e. Domain Server and then give the respective Manual IP's for that Office.

Something like this"

If Domain name = Office 2
netsh interface ip delete dns "Wireless Network Connection" all
netsh int ip set dns "Wireless Network Connection" static 192.168.0.1 primary
netsh int ip set address "Wireless Network Connection" static 192.168.0.90 255.255.255.0 192.168.0.254 1

netsh interface ip delete dns "Local Area Connection 2" all
netsh interface ip add dns "Local Area Connection 2" 192.168.0.1
netsh interface ip set address "Local Area Connection 2" static 192.168.0.91 255.255.255.0 192.168.0.254 1

ipconfig /release
ipconfig /flushdns
netsh interface ip delete arpcache
ipconfig /renew

else if Domain Name = Office 1
"as above scripts with office 2 ip's"

Regards

Nigel Pastor

Configuration: Windows XP, Windows SBS 2003 and Windows Server 2003

Best answers for « Set Static IP Per Domain Server » in :
Having a static IP address under Ubuntu 8.10 Show Having a static IP address under Ubuntu 8.10 To have a fixed IP persistent: Configure manually the interfaces For a fix IP (10.0.0.1 on your eth1 interface) use: To make use of dynamic IP (e.g eth0): DNS NetworkManager is a...
Forcing a domain name with the hosts file Show[Networks]Forcing a domain name with the hosts file Intro Locating the hosts file Tips Intro The hosts file primarily allow you to manually set the IP address for a host present on the network spotted by a domain name.
Do you need a fix IP for remote connection? ShowDo you need a fix IP for remote connection? Myth Truth How does it work? An Internet Service Provider will usually provide a user with a fix IP address that cannot be changed by the user himself. This number is used by another...
Error Connection (80048820) ShowError Connection (80048820) Solutions Before any configuration on your system, it is recommended that you check the status of MSN Messenger servers to determine if the problem does not come from there:...
NAT- Network address translation, port forwarding and port trigg ShowThe principle of NAT Network address translation or NAT was developed in order to respond to the shortage of IP addresses with IPv4 protocol (in time the IPv6 protocol will respond to this problem). In fact, in IPv4 addressing the number of...
Sharing an Internet connection ShowAdvantagesIf you have a LAN (two computers or more connected in a network), of which one is connected to the Internet (via a DSL modem, cable, etc.), it may be worthwhile to make the Internet accessible to the other computers on the LAN by installing...
Smurf attack ShowThe smurf technique The so-called "smurf" technique is based on the use of broadcast servers to paralyze a network. A broadcast server is a server capable of duplicating a message and sending it to all machines present on the same network. The...