- One of the key elements of connecting to different systems in the network configuration involved
- A Network is a set of hardware devices connected together, either physically or logically to allow them to exchange information.
- Network management is fairly easy when it comes to Ret Hat.
- Most of the network configuration is kept in files; therefore, adjusting these settings is simple.
- In the network system maintains the fully qualified domain name
\ F.Q.D.N = Hostname + Domain name |
Let’s start by looking at the information about hostname & networking
- To check the hostname: #hostname
- To Managing hostname temporarily: --->#hostname server254
- To Managing permanently: #vim /etc/sysconfig/network
NETWORKING =YES
HOSTNAME = SERVER254
NETWORKING_IPV6=YES
- For avoiding graphical problems:
#vi /etc/hosts
192.168.0.254 Server254. Example.com server254
:wq!
- To Manging IP – Address:
- To check the ipaddress:
Syn: if config [options] [interface]
Options: netmask
Up
Down
Ex: # if config ethʘ
- To display all interfaces on the system
#ifconfig
- To change ip address temporarily:
Syn: #if config ethʘ <ip-address> net mask <sub net mask> <up/down>
#if config ethʘ 192.168.0.254 net mask 255.255.255.0 up
#ifconfig ethʘ To verify
- To change permanently:
(a) #setup (b) System-config-network-tui
--> you could also check the output of the interface config file
#vim /etc/sysconfig/network-scripts/ifcfg- ethʘ
Device = ethʘ
BOOTPROTO =None
ONBOOT =Yes
IPADDR =192.168.0.254
NETMASK = 255.255.255.0
:wq
- To check the interface detected (or) not:
Syn: # eth tool <interface>
# eth tool eth ʘ
- To bring the signle interface down:
#ifdown eth ʘ
- To restore the interface that you just brought down:
#ifup eth ʘ
*Note:
- Any time you make a change to an interface’s settings, you need to bring dwon that interface and then bring it back u again.
WARNING: Restarting the network service interrupts all network connections and any client that is currently connected.
- Restart the network service as follows:
Syn: # service <service name> <stop/start/restart/status>
# service network restart
- To check the all services status:
# service – status – all
- To Manage permanently:
Syn: #chkconfig --level <run levels> <service name> <on/off>
#chkconfig network on
- To check the status of the service:
# chkconfig –list network
- To disable the service at boot time:
#chkconfig network off
Routing: When you have a system that has two or more network interfaces, they are called dual-bomed (or) multi bomed systems. You need to make sure that each interface has a gateway that it can route through.
Syn: route [options,
Add Add a net route
Del Deletes an Existing route
Flush Flushes any temporary routes
- Let’s look at the current routes on the system:
# route
- To set default gateway:
#route add default gw 192.168.0.1 ethʘ
- To verify:
# route
Learn more about Linux Interview Questions in this blog post.Interested in mastering Linux ? Check out this blog post to learn more Linux Training Videos
Networking utilities:
Ping: Tests the connectivity between two hosts
#ping 192.168.0.254
- When you ping something on a linux host, unlike in windows, the ping continues until you cancel it. You can limit the number of ping requests sent by prefixing –c number – count in front of the destination host.
#ping –c 3 192.168.0.254
Net stat: Shows information about connections (open, closed and listening).
- Using net stat command to obtain information on routing tables, listening sockets, and established connections.
Syn: net stat [options]
Options:
-r Displays the routing table.
-I Displays interface statistics
-t shows tcp connections
-U shows UDP connections
-a Displays all sockets (tcp, udp, or local)
-p Displays process Id’s
-e Displays Extended information.
--> To check that the connection is available for your clients:
# netstat - tuape / grep ssh
Client DNS Troubleshooting:
/etc/sysconfig/network : contains the hostname of the system
/etc/hosts : contains the local IP to hostname mappings
/etc/resolu.cong : contains the IP address of the DNS servers
Nslookup : queries (or) looks up a domain name or system
Ping : Test connectivity between two hosts.
Ethernet Bonding:
Ethernet bonding is used to combine multiple interfaces into one, creating an increase in available bandwidth and redundancy. This is done by creating a special network interface file called as a channel bonding interface.
For indepth understanding of Linux click on