C3Fire

Windows Help

From C3LearningLabs


Get Network Connection information

A good way to detect network connection information is to use the program PowerShell. Start PowerShell by writing PowerShell in the windows search tool, Start PowerShell by pressing right mouse button, and select Run as Administrator.

C3fire-config-install-windows-search.png PowerShell


Get IP number

A way to test the IP settings currently used in a computer is to run the command ipconfig in the Power Shell.

Open 'Power shell' as administrator, see above, and run command:
ipconfig

It will return a row containing some thing like IPv4 Address. : 192.168.1.37
Then the IP number are: 192.168.1.37

Power Shell



Get DNS server IP number

A way to get the DNS server IP number currently used in a computer is to run the command 'netsh interface ipv4 show dns' in the Power Shell.

Open 'Power shell' as administrator, see above, and run command:
netsh interface ipv4 show dns

It will return a row containing some thing like
DNS servers configured through DHCP: 192.168.1.254 or
Statically Configured DNS Servers: 88.206.128.2 Then the DNS Servers IP number are: 192.168.1.254, or 88.206.128.2

PowerShell



Test if DHCP is used

A way to see if the IP number is generated by using DHCP is to use the command netsh interface ipv4 show config in the Power Shell.

Open 'Power shell' as administrator, see above, and run command:
netsh interface ipv4 show config

It will return a row containing some thing like DHCP enabled: Yes Whit the current IP number in the block.
Then the DHCP is enabeled
In this example the current IP number are 192.168.1.37 so the current active interface have the name 'Ethernet'

Power Shell



Get network interface name

A way to see the name of the network connection interface name is to use the command netsh interface ip show addresses in the Power Shell.

Open 'Power Shell' as administrator, see above, and run command:
netsh interface ip show addresses

It will return a row containing some thing like Configuration for interface "Ethernet" Whit the current IP number in the block.
Then the interface name is 'Ethernet'
In this example the current IP number are 192.168.1.37 so the name is 'Ethernet'

Power Shell



Detect what process that have bind the port 80

In the PowerShell detect what process that have bind the port 80. The process ID number can be found with the command:
netstat -ano | Select-String ":80"

Then take this process ID number and get the process name with the following command:
Get-Process -Id process_ID

Example to get process name for process with ID number 9348 write. Get-Process -Id 9348

PowerShell


Switch between static IP and dynamic IP (DHCP)

You can switch between static IP and dynamic IP by writing two scrips.
One script to activate use DHCP, and one script for your predefined static IP.

Syntax of setting IP address:
netsh int ipv4 set address name=<interface name> source=<'static' | 'dhcp'> [address=<IP address[/bitmask]>] [mask=<netmask>] [gateway=<gateway>]

Syntax of setting DNS server address:
netsh int ipv4 set dns name=<interface name> source=<'static' | 'dhcp'> [address=<address | 'none'>] [register=<'none' | 'primary' | 'both'>] [validate=<'yes' | 'no'>]


Example to set static IP, mask, gateway address and static DNS:
This is for a C3Fire server at the recommended IP = 192.168.0.1

netsh int ipv4 set address name="Local Area Connection" source=static address=192.168.0.1 mask=255.255.255.0 gateway=192.168.0.254
netsh int ipv4 set dns name="Local Area Connection" source=static address=88.206.128.2 register=primary validate=no


To set both address and DNS to DHCP:

netsh interface ipv4 set address name="Local Area Connection" source=dhcp
netsh interface ipv4 set dnsservers name="Local Area Connection" source=dhcp


If you want to activate Network Discovery, you should add this line to the end of the files.

netsh advfirewall firewall set rule group="Network Discovery" new enable=Yes


You should put these lines in files called 'Set-Static-IP.bat' and 'Set-Dynammic-IP.bat', or
'Set-IP-Experiment.bat' and 'Set-IP-www.bat'
The files need to be run as administrators. Point at the file and press mouse right button, select 'Run as Administrator'.

Script files

If you are creating a Local Area Network (LAN), with static ip numbers, when running the experiment then the examples of IP numbers for the computers are viewed in the table below:

Download these files and update the Network Interface name and DNS Server ip number
The default Network Interface name are Ethernet.
To detect the computers Interface name, see Get network interface name below.
The default ip number points to DNS server in Sweden, and are 88.206.128.2.
To detect the computers DNS server, see Get DNS server IP number below.

The files need to be run as administrators.
Point at the file and press mouse right button,
select Run as Administrator.

Computer IP Number Script file
Server 192.168.0.1 set-ip-static-server.bat
Client 1 192.168.0.2 set-ip-static-client-1.bat
Client 2 192.168.0.3 set-ip-static-client-2.bat
Client 3 192.168.0.4 set-ip-static-client-3.bat
Client 4 192.168.0.6 set-ip-static-client-4.bat
Client 5 192.168.0.6 set-ip-static-client-5.bat
Client 6 192.168.0.7 set-ip-static-client-6.bat
... ... ...

Script file for setting dynamic ip (DHCP): set-ip-dynamic.bat

If you want to activate Network Discovery, you should add this line to the end of the files.

netsh advfirewall firewall set rule group="Network Discovery" new enable=Yes


The recomended gatway is 192.168.0.254
The recomended mask is 255.255.255.0


Template:C3fire/Config/Install/Windows/Install Menu