Network Setup Tips: Difference between revisions
No edit summary |
|||
Line 14: | Line 14: | ||
</pre> | </pre> | ||
</div> | </div> | ||
| |||
== How To Add A Host Name Identifier To A DHCP Server == | == How To Add A Host Name Identifier To A DHCP Server == | ||
Line 46: | Line 48: | ||
</pre> | </pre> | ||
</div> | </div> | ||
| |||
== How To Permanently Set The Host Name Of Your System == | == How To Permanently Set The Host Name Of Your System == | ||
Line 69: | Line 73: | ||
<div class="centerBlock"><div class="noteMessage">'''Note on Setting the Host Name when Using DHCP to get the IP Address:''' NST is configured to run the '''dhclient''' exit hook script: "'''/etc/dhcp/dhclient.d/nst.sh'''". This script will try to automatically set the system's host name based on results from '''DHCP'''. Avoid using "'''probe-'''" as the first 6 characters in the "'''HOSTNAME'''" parameter above (e.g., '''probe-sys1''' - Instead use: '''sys1-probe'''). These characters are ''reserved'' by NST.</div></div> | <div class="centerBlock"><div class="noteMessage">'''Note on Setting the Host Name when Using DHCP to get the IP Address:''' NST is configured to run the '''dhclient''' exit hook script: "'''/etc/dhcp/dhclient.d/nst.sh'''". This script will try to automatically set the system's host name based on results from '''DHCP'''. Avoid using "'''probe-'''" as the first 6 characters in the "'''HOSTNAME'''" parameter above (e.g., '''probe-sys1''' - Instead use: '''sys1-probe'''). These characters are ''reserved'' by NST.</div></div> | ||
| |||
== Configuring A Static IP Address == | == Configuring A Static IP Address == | ||
Line 87: | Line 93: | ||
NOTE: The above assumes that the gateway machine for the network has an '''IP''' address of: "''192.168.12.1''". | NOTE: The above assumes that the gateway machine for the network has an '''IP''' address of: "''192.168.12.1''". | ||
| |||
== Configuring A Stealth Network Interface == | == Configuring A Stealth Network Interface == | ||
Line 98: | Line 104: | ||
ONBOOT=yes | ONBOOT=yes | ||
</pre> | </pre> | ||
| |||
== Restarting the Network Service == | == Restarting the Network Service == | ||
Line 114: | Line 122: | ||
</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> | ||
| |||
== Display Routing Table == | == Display Routing Table == |
Revision as of 09:19, 12 November 2011
Accessing Network Configuration Files
To easily access the network configuration files, simply use the cdnet command:
[root@probe network-scripts]#
/etc/sysconfig/network-scripts [root@probe network-scripts]#
How To Add A Host Name Identifier To A DHCP Server
Some times it is desirable to specify a host name 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 and bind.
To do this, add the following line to your network configuration file (Example for: eth0 - We will use file: "/etc/sysconfig/network-scripts/ifcfg-eth0" and request that the DHCP server set this system's host name to: "emachine".):
DHCP_HOSTNAME=<Your desired host name for this NST DHCP client>
Both the "network" service and the NetworkManager service support this setting for DHCP.
# # DHCP Client Config: eth0 DEVICE=eth0 BOOTPROTO=dhcp ONBOOT=yes # # Disable capabilities security feature when running dhclient so we # can run the NST dhclient exit hook script: "/etc/dhcp/dhclient.d/nst.sh". DHCLIENTARGS="-nc" # # Specify the 'dhclient' host-name option (-H) to send to the DHCP server. DHCP_HOSTNAME=emachine
How To Permanently Set The Host Name Of Your System
To do this, add/change the following line to the system configuration file: "/etc/sysconfig/network"
HOSTNAME=<your desired host name for this NST system>
NetworkManager will be notified of this change and automatically set the system "hostname". The example below sets the system host name to: "emachine". Typically, if this system is a DHCP client, both the "DHCP_HOSTNAME" discussed above and the "HOSTNAME" entries are set identically.
NETWORKING=yes HOSTNAME=emachine NOZEROCONF=yes
A system reboot can be done to verify all changes.
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".
Configuring A Stealth Network Interface
In order to configure a stealth (i.e., A network interface with a non-binding IP Address) network interface set the BOOTPROTO setting to: "none". Example: Make network interface: "eth1" at stealth interface using this minimal configuration:
DEVICE=eth1 BOOTPROTO=none ONBOOT=yes
Restarting the Network Service
After editing any network configuration file, you should restart the network service as shown below:
[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 ]
Display Routing Table
The following command can be used to display your network routing table (the -n option was included to prevent the route command from trying to resolve names):
Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0 0.0.0.0 192.168.1.1 0.0.0.0 UG 0 0 0 eth0