Ensurepass

8. Network Administration
8.1 Utilities
1. ifconfig
ifconfig is used to configure network interfaces.
Example:
ifconfig eth0 192.168.1.10 netmask 255.255.255.0 up
This configures interface eth0 with an IP of 192.168.1.10/255.255.255.0. Note that “up” is assumed if left off. A default network mask will also be determined by the IP if it is not specified.
2. route
route is used configure routing information.
Example:
route add -net 10.20.30.40 netmask 255.255.255.248 eth0
route add -net 10.20.30.48 netmask 255.255.255.248 gw 10.20.30.41

The first line states that the route to network 10.20.30.40/255.255.255.248 is through our local interface eth0. The second line states that the route to network 10.20.30.48/255.255.255.248 is through gateway 10.20.30.41
3. arp
arp is used to administer the arp cache. It can view, add, and delete entries in the cache.
o View arp cache:
arp
This will display something like:
Address HWtype HWaddress Flags Mask Iface
192.168.1.1 ether 00:60:08:27:CE:A2 C eth0
192.168.1.12 ether 00:80:5F:01:74:13 C eth0
192.168.1.15 ether 00:60:08:27:CE:B2 CM eth0
192.168.1.20 ether 00:A0:CC:25:9F:4C C eth0

The “C” flag means it’s a complete entry. The “M” flag indicates it’s an entry added manually and it is permanent.
o Add an entry:
arp -s 192.168.33.15 00:60:08:27:CE:B2
o Delete an entry:
arp -d 192.168.33.15
4. ping
ping is used to troubleshoot network/host connectivity. It uses ICMP echo request and echo reply to test the connectivity. If a host doesn’t respond, it could be for any number of reasons:
o The remote host is down.
o The remote host is filtering ICMP packets.
o Some point in the network in-between the two hosts is down.
o A device in-between the two hosts is filtering ICMP packets.
Examples:
ping 192.168.1.12
ping -b 192.168.1.0

The first line pings a single host, 192.168.1.12. The second line performs a broadcast ping to all hosts on the 192.168.1.0 network.
5. traceroute
traceroute is also used to test network/host connectivity. However, it displays each hop along the way from the source to the destination. It can help you determine if the problem is with the remote host itself, or some point in-between the hosts.
Example:
traceroute 192.168.10.100
This will print a line for each hop in-between the local and remote host (192.168.10.100) as well as a line for the final destination up to a maximum of 30 hops.
6. netstat
netstat provides a lot of useful information, including:
o Routing tables.
o Interface statistics (dropped packets, buffer overruns, etc.)
o Network connections.
o Multicast memberships.
Examples:
netstat -i # Display interface statistics
netstat -lpe # Display all listening sockets and the programs that own them
netstat -r # Display routing information
netstat -ape # Show all listening and non-listening sockets

7. netconfig
o TUI based.
o Used to configure network interface.
o Used by text based installation methods.
8. redhat-config-network
This is a GUI administration tool that allows you to configure several aspects of your networking: interfaces, boot protocols, host resolution, routing, and more.
9. ifup / ifdown
These shell script wrappers allow you to bring an interface up and take it down. They use the configuration information in the /etc/sysconfig directory to configure the interface specified.
For example, to bring up interface eth0, simply type:
ifup eth0
8.2 Configuring Interfaces
1. Configuration files
The configuration files for network interfaces all reside in /etc/sysconfig. For a complete description of these configuration files, see /usr/share/doc/initscripts-X.XX/sysconfig.txt where X.XX is the version of initscripts that you have installed.
o network
Options:
NETWORKING=yes
HOSTNAME=localhost.localdomain

The first option enables networking, and the second sets the host name. A default gateway can also be specified here using the “GATEWAY=” option, but it is usually specified in the “ifcfg-” scripts for devices now.
o network-scripts/ifcfg-
This contains the configuration options for a single interface.
1. For a device that uses DHCP, it may look like:
2. DEVICE=eth0
3. BOOTPROTO=dhcp
4. ONBOOT=yes # Start at boot up?
5. IPXPRIMARY_802_2=”no”
6. IPXACTIVE_802_2=”no”
7. IPXPRIMARY_802_3=”no”
8. IPXACTIVE_802_3=”no”
9. IPXPRIMARY_ETHERII=”no”
10. IPXACTIVE_ETHERII=”no”
11. IPXPRIMARY_SNAP=”no”
12. IPXACTIVE_SNAP=”no”
13. TYPE=Ethernet
14. USERCTL=no # Allow users to control this interface?
15. NETWORK=192.168.33.0
16. BROADCAST=192.168.33.255
17. PEERDNS=no # Should we modify /etc/resolv.conf if using DHCP or BOOTP?
18.
Most of the items above should be self explanatory. The only required options for a client using DHCP are “DEVICE” and “BOOTPROTO”.
19. For a device using a statically assigned IP, it will look similar to this.
20. DEVICE=eth0
21. BOOTPROTO=static
22. ONBOOT=yes # Start at boot up?
23. IPXPRIMARY_802_2=”no”
24. IPXACTIVE_802_2=”no”
25. IPXPRIMARY_802_3=”no”
26. IPXACTIVE_802_3=”no”
27. IPXPRIMARY_ETHERII=”no”
28. IPXACTIVE_ETHERII=”no”
29. IPXPRIMARY_SNAP=”no”
30. IPXACTIVE_SNAP=”no”
31. TYPE=Ethernet
32. USERCTL=no # Allow users to control this interface?
33. NETWORK=192.168.33.0
34. BROADCAST=192.168.33.255
35. PEERDNS=no # Should we modify /etc/resolv.conf if using msdns?
36. IPADDR=192.168.33.50
37. GATEWAY=192.168.33.1 # Default Gateway
38. NETMASK=255.255.255.0
39.
The only required options are “DEVICE” and “IPADDR”. Most of the other options can be derived from the IPADDR if your network is configured based on network classes. If you aren’t subnetting on an octet, a netmask is required.
2. Manual Configuration
One way to configure an interface is to edit the above files directly with a text editor. After you are done editing them, execute an “ifdown” followed by an “ifup”. This should reset your interfaces to the new values you’ve specified.
3. GUI Configuration
You can also use the “redhat-config-network” tool to configure your interfaces.
8.3 Configuring Routes
1. Configuration files
The configuration files for routing are also located under /etc/sysconfig.
o static-routes
This file contains static routing information that should be added to the routing tables when interfaces are brought up. It has the following format:
hostnet
For example:
eth0 net 10.20.30.0 netmask 255.0.0.0 gw 192.168.1.50
Adds a route to network 10.20.30.0/255.0.0.0 using the gateway at 192.168.1.50 to device eth0.
o network-scripts/ifcfg-
For devices with static IPs, this file is typically used to specify the default gateway for the device (see Interface Configuration above).
2. Manual Configuration
Same as “Interface Manual Configuration” above.
3. GUI Configuration
Same as “Interface GUI Configuration” above.
8.4 Host Resolution
1. DNS
Host names can be resolved using DNS or through a local lookup file /etc/hosts. By default, /etc/hosts is consulted before performing a DNS lookup. However, the resolution order can be changed by modifying /etc/nsswitch.conf.
o /etc/hosts format:
o IP address Host Name Aliases
o
Example:
127.0.0.1 localhost
192.168.1.1 gateway.somedomain.com gateway gate gw
192.168.1.20 somehost.somedomain.com somehost some
192.168.1.25 otherhost.somedomain.com otherhost

o /etc/resolv.conf
This contains the ip addresses of up to 3 DNS servers that will be consulted when trying to perform host name lookups.
Format:
nameserver 192.168.1.2
nameserver 192.168.1.3
domain somedomain.com
search somedomain.com otherdomain.com

The “domain” options specifies the local domain. If a host lookup is performed and a FQDN isn’t specified, this domain is appended to the host name to create the FQDN. The “search” options specifies the order in which the domains should be queried if a host lookup is requested without specifying a FQDN. The “domain” and “search” options are mutually exclusive. If both are specified, the last one given is used.
2. NIS
COMPLETE ME!
3. LDAP
COMPLETE ME!

Download the Ensurepass Latest 2013 RHCE EX300 Practise Test PDF to pass RHCE EX300 exam.

Comments are closed.