Network Setup Tips: Difference between revisions

From MediaWiki
Jump to navigationJump to search
(Added section on configuring a static IP address)
Line 12: Line 12:
ONBOOT=yes
ONBOOT=yes
DHCP_HOSTNAME=probe-biostar
DHCP_HOSTNAME=probe-biostar
</pre><div class="userInput"><span class="prompt">[root@probe-biostar network-scripts]# </span></div>
</div>
== Configuring A Static IP Address ==
If the network your interface is connected to does not have a '''DHCP''' server, you will need to configure your system to use a static '''IP''' address. The following shows the contents of: "'''/etc/sysconfig/network-scripts/ifcfg-eth0'''" which is used to assign a static '''IP''' address of ''192.168.12.100'' to '''eth0''' (an Ethernet interface):
<pre class="programListing">
DEVICE=eth0
BOOTPROTO=static
IPADDR=192.168.12.100
NETMASK=255.255.255.0
NETWORK=192.168.12.0
BROADCAST=192.168.12.255
GATEWAY=192.168.12.1
ONBOOT=yes
</pre>
NOTE: The above assumes that the gateway machine for the network has an '''IP''' address of: "''192.168.12.1''".
After editing this configuration file, you should restart the ''network'' service as shown below:
<div class="screen">
  <div class="screenTitle">Restarting the Network Service</div>
  <div class="userInput"><span class="prompt">[root@probe-biostar network-scripts]# </span>service network restart</div>
  <pre class="computerOutput">
[root@tmobile network-scripts]# service network restart
Shutting down interface eth0:                              [  OK  ]
Shutting down loopback interface:                          [  OK  ]
Bringing up loopback interface:                            [  OK  ]
Bringing up interface eth0:                                [  OK  ]
</pre><div class="userInput"><span class="prompt">[root@probe-biostar network-scripts]# </span></div>
</pre><div class="userInput"><span class="prompt">[root@probe-biostar network-scripts]# </span></div>
</div>
</div>

Revision as of 08:53, 6 March 2007

How To Add A Host Name Identifier To A DHCP Server

Some times it is desirable to add a host name identifier at the DHCP Client to be recognized by the DHCP Server. This will allow for local host names to be resolved by their respective name on the local LAN. This works well with a DD-WRT enabled LinkSys router.

To do this, add the following line to your network configuration file (we will use file: "/etc/sysconfig/network-scripts/ifcfg-eth0" for this example): DHCP_HOSTNAME=<your desired host name for this NST DHCP client>

Listing: "/etc/sysconfig/network-scripts/ifcfg-eth0"
[root@probe-biostar network-scripts]# cat "/etc/sysconfig/network-scripts/ifcfg-eth0"
DEVICE=eth0
BOOTPROTO=dhcp
ONBOOT=yes
DHCP_HOSTNAME=probe-biostar
[root@probe-biostar network-scripts]#

Configuring A Static IP Address

If the network your interface is connected to does not have a DHCP server, you will need to configure your system to use a static IP address. The following shows the contents of: "/etc/sysconfig/network-scripts/ifcfg-eth0" which is used to assign a static IP address of 192.168.12.100 to eth0 (an Ethernet interface):

DEVICE=eth0
BOOTPROTO=static
IPADDR=192.168.12.100
NETMASK=255.255.255.0
NETWORK=192.168.12.0
BROADCAST=192.168.12.255
GATEWAY=192.168.12.1
ONBOOT=yes

NOTE: The above assumes that the gateway machine for the network has an IP address of: "192.168.12.1".

After editing this configuration file, you should restart the network service as shown below:

Restarting the Network Service
[root@probe-biostar network-scripts]# service network restart
[root@tmobile network-scripts]# service network restart
Shutting down interface eth0:                              [  OK  ]
Shutting down loopback interface:                          [  OK  ]
Bringing up loopback interface:                            [  OK  ]
Bringing up interface eth0:                                [  OK  ]
[root@probe-biostar network-scripts]#