Changes

Jump to: navigation, search

This Is Your Brain On Informatics: Network

1,571 bytes added, 18:06, 1 December 2013
no edit summary
The networks shown here are the basic networks that will allow the machine to connect to the internet. If this is a regular computer (not a virtual machine), this file should be completely setup for internet connection and ssh purposes.
</p>
 
<p>
Also, notice here that the eth0 network has "dhcp" (dynamic host configuration protocol) at the end of the final line. This causes the IP address of this network to be dynamically acquired rather than statically set. Below is a discussion of how to set up each.
</p>
===Using a Static IP===
<p>
This can be used if it is necessary to prevent the IP address from changing(e.g. a home server or you're just sick of having to adjust the IP for every program that connects to the virtual machine each time it changes). Below is an example of how it is set.
</p>
<pre>
# This is the network that allows communication with the outside world
auto eth1
iface eth1 inet static
address 192.168.56.23
netmask 255.255.255.0
network 192.168.56.0
broadcast 192.168.56.255
gateway 192.168.56.1
 
</pre>
 
<p>
The key component of this is the word ''static'' at the end of the line beginning with ''iface'', forcing the IP address to bet set statically as determined by the user. Each of the components of the network must now be set individually. The address is the network address and can be set to anything. Typically only the last number is changed from what is currently set The current IP address can be determined by using the Linux command [[This Is Your Brain On Informatics: Linux Commands|''ifconfig'']] and looking at the ''inet addr'' under the appropriate network. ''Bcast'' will determine the broadcast and ''Mask'' will determine the netmask. As long as only the final number of the IP address is changed, then these can be used as is.
</p>
347
edits

Navigation menu