What is networking?
Definition: In the world of computers, networking is the practice of interfacing two or more computing devices with each other for the purpose of sharing data. Computer networks are built with a combination of hardware and software.
Computer networks can be categorized in several different ways. One approach defines the type of network according to the geographic area it spans.
Local area networks (LANs), for example, typically span a single home, school, or small office building, whereas wide area networks (WANs), reach across cities, states, or even across the world.The Internet is the world’s largest public WAN.
While other types of networks are built and maintained by engineers, home networks belong to ordinary homeowners, people often with little or no technical background. Various manufacturers produce broadband router hardware designed to simplify home network setup. Home broadband routers allow devices in different rooms to efficiently share a broadband Internet connection, enable people to more easily share their files and printers within the network, and help with overall network security.
Home networks have increased in capability with each generation of new technology. Years ago, people commonly set up their home network just to connect a few PCs, share some documents and perhaps a printer. Now its common for households to also network game consoles, digital video recorders, and smartphones for streaming sound and video. Home automation systems have also existed for many years, but these too have grown in popularity more recently with practical systems for controlling lights, digital thermostats and appliances.
Small and home office (SOHO) environments use similar technology as found in home networks. Businesses often have additional communication, data storage, and security requirements that require expanding their networks in different ways, particularly as the business gets larger. Whereas a home network generally functions as one LAN, a business network tends to contain multiple LANs. Companies with buildings in multiple locations utilize wide-area networking to connect these branch offices together. Though also available and used by some households, voice over IP communication and network storage and backup technologies are prevalent in businesses. Larger companies also maintain their own internal Web sites, called intranets to help with employee business communication.
Networking and the Internet
The popularity of computer networks sharply increased with the creation of the World Wide Web (WWW) in the 1990s. Public Web sites, peer to peer (P2P) file sharing systems, and various other services run on Internet servers across the world.
Wired versus Wireless Networking
Many of the same network protocols, like TCP/IP, work in both wired and wireless networks. Networks with Ethernet cables predominated in businesses, schools, and homes for several decades. More recently, however, wireless alternatives have emerged as the premier technology for building new computer networks, in part to support smartphones and the other new kinds of wireless gadgets that have triggered the rise of mobile networking.
What is IP address?
Internet Protocol address, an IP or IP address is an address of a computer or other network device on a network using TCP/IP. For example, the number “192.168.1.101” is an example of such an address. These addresses are similar to an addresses used on a house and is what allows data to reach the appropriate destination on a network and the Internet.
There are five classes of available IP ranges: Class A, Class B, Class C, Class D and Class E, while only A, B, and C are commonly used. Each class allows for a range of valid IP addresses. Below is a listing of these addresses.
|Class A||184.108.40.206 to 220.127.116.11||Supports 16 million hosts on each of 127 networks.|
|Class B||18.104.22.168 to 22.214.171.124||Supports 65,000 hosts on each of 16,000 networks.|
|Class C||126.96.36.199 to 188.8.131.52||Supports 254 hosts on each of 2 million networks.|
|Class D||184.108.40.206 to 220.127.116.11||Reserved for multicast groups.|
|Class E||240.0.0.0 to 254.255.255.254||Reserved for future use, or Research and Development Purposes.|
How to configure IP address (manually) in Linux servers:
Before delving into the interface configuration files, let us first itemize the primary configuration files used in network configuration. Understanding the role these files play in setting up the network stack can be helpful when customizing a Red Hat Enterprise Linux system.
The main purpose of this file is to resolve host names that cannot be resolved any other way. It can also be used to resolve host names on small networks with no
DNS server. Regardless of the type of network the computer is on, this file should contain a line specifying the
IP address of the loopback device (
Following is a sample /etc/hosts file:
IPAddress Hostname Alias 127.0.0.1 localhost deep.openna.com 18.104.22.168 deep.openna.com deep 22.214.171.124 mail.openna.com mail 126.96.36.199 web.openna.com web
This file specifies the
IP addresses of
DNS servers and the search domain. Unless configured to do otherwise, the network initialization scripts populate this file.
Following is a example /etc/resolv.conf
This file specifies routing and host information for all network interfaces. It is used to contain directives which are to have global effect and not to be interface specific.
Following is a example /etc/sysconfig/network file:
NETWORKING=yes FORWARD_IPV4=yes HOSTNAME=deep. openna.com GATEWAY=0.0.0.0
For each network interface, there is a corresponding interface configuration script. Each of these files provide information specific to a particular network interface.
Following is a example /etc/sysconfig/network-scripts/ifcfg-eth0 file:
vi /etc/sysconfig/network-scripts/ifcfg-eth0 # Configuration for eth0 DEVICE=eth0 BOOTPROTO=none # This line ensures that the interface will be brought up during boot. ONBOOT=yes # eth0 - This is the main IP address that will be used for most outbound connections. # The address, netmask, and gateway are all necessary. IPADDR=198.51.100.5 NETMASK=255.255.255.0 GATEWAY=198.51.100.1
To configure Alias IP on same interface:
vi /etc/sysconfig/network-scripts/ifcfg-eth0:0 # Configuration for eth0:0 DEVICE=eth0:0 BOOTPROTO=none # This line ensures that the interface will be brought up during boot. ONBOOT=yes # eth0:0 IPADDR=192.0.2.6 NETMASK=255.255.255.0 & restart network service: # service network restart
To configure network to get IP from DHCP server:
vi /etc/sysconfig/network-scripts/ifcfg-eth0 # Configuration for eth0:0 DEVICE=eth0 BOOTPROTO=dhcp # This line ensures that the interface will be brought up during boot. ONBOOT=yes
& restart network service: # service network restart Verify your IP address:
# ifconfig eth0 Link encap:Ethernet HWaddr 00:0C:29:40:93:9C inet addr:192.168.1.102 Bcast:192.168.1.255 Mask:255.255.255.0 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:1771 errors:0 dropped:0 overruns:0 frame:0 TX packets:359 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:138184 (134.9 KiB) TX bytes:49108 (47.9 KiB) Interrupt:67 Base address:0x2000 lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 inet6 addr: ::1/128 Scope:Host UP LOOPBACK RUNNING MTU:16436 Metric:1 RX packets:390 errors:0 dropped:0 overruns:0 frame:0 TX packets:390 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:29204 (28.5 KiB) TX bytes:29204 (28.5 KiB)
Ping is a basic Internet program that allows a user to verify that a particular IP address exists and can accept requests.
Ping is used diagnostically to ensure that a host computer the user is trying to reach is actually operating. Ping works by sending an Internet Control Message Protocol (ICMP) Echo Request to a specified interface on the network and waiting for a reply. Ping can be used for troubleshooting to test connectivity and determine response time.
# ping google.com
PING google.com (188.8.131.52): 56 data bytes
64 bytes from 184.108.40.206: icmp_seq=0 ttl=59 time=9.151 ms
64 bytes from 220.127.116.11: icmp_seq=1 ttl=59 time=10.637 ms
64 bytes from 18.104.22.168: icmp_seq=2 ttl=59 time=34.646 ms
# ping 192.168.1.1
PING 192.168.1.1 (192.168.1.1): 56 data bytes
64 bytes from 192.168.1.1: icmp_seq=0 ttl=64 time=5.958 ms
64 bytes from 192.168.1.1: icmp_seq=1 ttl=64 time=5.272 ms
64 bytes from 192.168.1.1: icmp_seq=2 ttl=64 time=4.112 ms
64 bytes from 192.168.1.1: icmp_seq=3 ttl=64 time=144.064 ms
# ping 10.0.1.1 —————–> No network connection
PING 10.0.1.1 (10.0.1.1): 56 data bytes
Request timeout for icmp_seq 0
Request timeout for icmp_seq 1
Request timeout for icmp_seq 2
Request timeout for icmp_seq 3