windows 7: assign static IP address

2

0

I want to connect two laptops with a crossover Ethernet cable, in order to synchronize them with ntp. One laptop runs Windows 7, the other one Ubuntu.

On Ubuntu, in order to assign a static IP address to an interface, I just do:

sudo ifconfig eth0 10.0.0.100 netmask 255.255.255.0

Is there a similar way for Windows, from the cmd?

Ricky Robinson

Posted 2014-11-05T14:48:26.567

Reputation: 160

Question was closed 2014-11-05T15:00:23.617

Also: Is there a command that allows me to set a prefered IP Address for an adapter?

– Ƭᴇcʜιᴇ007 – 2014-11-05T15:00:49.847

Aim for one question per question please. :) FYI This secondary request: "is there anything else I should do for the two pc's to communicate?" is too broad, and is not really a problem you need to solve (yet). – Ƭᴇcʜιᴇ007 – 2014-11-05T15:02:07.057

yeah, you're right. I removed it. – Ricky Robinson – 2014-11-05T15:20:30.727

Answers

1

You can use NETSH to set static IP addresses, see http://support2.microsoft.com/kb/257748/en

Syntax: netsh interface ip set address "Local Area Connection" static ipaddr subnetmask gateway metric Sample: netsh interface ip set address "Local Area Connection" static 192.168.0.10 255.255.255.0 192.168.0.1 1

Substitute "Local Area Connection" with the name of the network adapter as needed.

You may need to deactivate Windows firewall.

user3767013

Posted 2014-11-05T14:48:26.567

Reputation: 1 297