networking in linux

Post on 22-Jan-2018

156 Views

Category:

Education

6 Downloads

Preview:

Click to see full reader

TRANSCRIPT

By : Varnnit Jain

9990888972

Networking In Linux

Introduction Computers are connected in a network to exchange

information or resources with each other. Two or more computer are connected through network media called computer media.

There are a number of network devices or media that are involved to form computer network.

Computer loaded with Linux Operation System can also be a part of network whether it is a small or large network by multitasking and multi user natures.

Maintaining of system and network up and running is a task of System / Network Administrator’s job. In this article we are going to review frequently used network configuration and troubleshoot commands in Linux.

Network Interface Names

The linux kernel names interface with a specific

prefix depending on the type of interface.

For Example : all Ethernet interfaces start with

eth, regardless of the specific hardware vendor.

Following the prefix, each interface is numbered,

starting at zero.

etho, eth1 and eth2 would refer to the first,

second and third Ethernet interfaces.

Other interfaces include wlan0 for the first

wireless device, virbr0 for the internal bridge set

up for virtual hosts, bond0 for the first bonded

network device, and so on.

Network Configuration and

Troubleshooting

To check IP address of the system

#ip a

#ip ad

#ip add

Network Configuration and

Troubleshooting (Cont.)

Network and IP configuration settings

#system-config-network

#system-config-network-tui

Network Configuration and

Troubleshooting (Cont.)

To start network manually

#service network start

To restart network configuration

#service network restart

Network Configuration and

Troubleshooting (Cont.)

To keep network settings on when system

restarts

#chkconfig network on

For checking connectivity between systems.

#ping (IP address)

Network Configuration and

Troubleshooting (Cont.)

To disable NIC card/Interface (Here eth0)

#ifdown eth0

To enable NIC card/Interface (Here eth0)

#ifup eth0

Network Configuration and

Troubleshooting (Cont.)

To check the hostname

#hostname

To change the hostname

#hostname new_name

Configuration on System Network configuration in GUI mode.

#system-config-network

Firewall configuration in GUI mode.

#system-config-firewall

Date and time configuration in GUI mode.

#system-config-date

To setup different settings of the system. (complete setup console in GUI mode).

#setup

To check system IP configuration#ifconfig (same as ipconfig in windows)

Scenario

We have two systems. One with IP 10.0.0.1 and

another with IP 10.0.0.2 . We have to setup

network between both of these systems in order

to ping them to each other.

Step 1 : Enable the interface of the first system.

Step 2 : Set IP 10.0.0.1 to the ethernet 0 of the

first system.

using #system-config-network

Step 3 : Select the device you want to configure.

(Here we will chose eth0).

Step 4 : Network configuration window appears on the screen.

Fill in the required blanks

Step 5 : Set the IP 10.0.0.1

Step 6 : Enable the Interface eth0 using #ifupeth0

Check the IP configuration of the same port using #ifconfig

IP for the first system has been set successfully.

Repeat the steps for the second system.

Set IP 10.0.0.2

The network has been set between both the systems.

You can simply check the connectivity between the two.

Use the command ping 10.0.0.2 from first PC and see the results.

top related