SlideShare a Scribd company logo
Linux Redhat
Network
Configuration
ifconfig
Ifconfig or ifconfig -a
#Ifconfig eth0 down
     #Ifconfig eth0 up
     ==
     #service network restart
   To configure a static IP:
#ifconfig eth0 192.168.10.12 netmask 255.255.255.0 broadcast
192.168.10.255 up
Default route(Default Gateway)

# route add default gw {IP-ADDRESS} {INTERFACE-NAME}
#route add default gw 192.168.1.254 eth0
static route
#ip route show this is a command to show you the default gateway
and the ip
You can add static route using following command:
#ip route add {NETWORK} via {IP} dev {DEVICE}
For example network 192.168.55.0/24 available via
192.168.1.254:
# ip route add 192.168.55.0/24 via 192.168.1.254 dev eth1


Alternatively, you can use old good route command:
# route add -net 192.168.55.0 netmask 255.255.255.0 gw
192.168.1.254 dev eth1
Network Configuration Files
/etc/hosts
The main purpose of this file is to resolve hostnames that cannot be resolved
any other way. It can also be used to resolve hostnames on small networks
with no DNS server.


/etc/resolv.conf
This file specifies the IP addresses of DNS servers and the search domain.


/etc/sysconfig/network
This file specifies routing and host information for all network interfaces.


/etc/sysconfig/network-scripts/ifcfg-<interface-name>
For each network interface, there is a corresponding interface configuration
script. Each of these files provide information specific to a particular
network interface.
/etc/sysconfig/network

The /etc/sysconfig/network file is used to specify information about the desired
network configuration. The following values may be used:



• NETWORKING=<value>, where <value> is one of the following boolean values:
yes — Networking should be configured.
no — Networking should not be configured.


• HOSTNAME=<value>, where <value> should be the Fully Qualified Domain
Name (FQDN), such as hostname.expample.com, but can be whatever
hostname is necessary.

• GATEWAY=<value>, where <value> is the IP address of the network's gateway.
/etc/sysconfig/network
Static IP address Configuration: (Configure gateway address)


NETWORKING=yes
HOSTNAME=my-hostname -Hostname is defined here and by command hostname
GATEWAY="XXX.XXX.XXX.YYY" - Used if your network is connected to another
                            network or the internet.



OR for DHCP client configuration:
NETWORKING=yes
HOSTNAME=my-hostname - Hostname is defined here and by command
hostname
/etc/sysconfig/network-scripts/ifcfg-
<interface-name>
The following is a sample ifcfg-eth0 file for a system using a FIXED
IP address:

DEVICE=eth0
BOOTPROTO=none
ONBOOT=yes
NETWORK=10.0.1.0
NETMASK=255.255.255.0
IPADDR=10.0.1.27
USERCTL=no

Example, using DHCP server:

# Intel Corporation 82540EM Gigabit Ethernet Controller
DEVICE=eth0
BOOTPROTO=dhcp
HWADDR=08:00:27:FF:FB:FE
ONBOOT=yes
Below is a listing of the configurable
parameters in an Ethernet interface
configuration file:
/etc/sysconfig/network-scripts/ifcfg-<interface-
name>
BOOTPROTO=<protocol>
where <protocol> is one of the following:
• none — No boot-time protocol should be used.
• bootp — The BOOTP protocol should be used.
• dhcp — The DHCP protocol should be used.


DEVICE=<name>
where <name> is the name of the physical device (except for
dynamically-allocated PPP devices
where it is the logical name).



DNS{1,2}=<address>
where <address> is a name server address to be placed in
/etc/resolv.conf if the
PEERDNS directive is set to yes.
GATEWAY=<address>
where <address> is the IP address of the network router or gateway device
(if any).


HWADDR=<MAC-address>
where <MAC-address> is the hardware address of the Ethernet device in the
form
AA:BB:CC:DD:EE:FF. This directive must be used in machines containing
more than one NIC to ensure that the interfaces are assigned the correct
device names regardless of the configured load order for each NIC's
module. This directive should not be used in conjunction with MACADDR.



IPADDR=<address>
where <address> is the IP address.

NETMASK=<mask>
where <mask> is the netmask value.
ONBOOT=<answer>
where <answer> is one of the following:
• yes — This device should be activated at boot-time.
• no — This device should not be activated at boot-time.




USERCTL=<answer>
where <answer> is one of the following:
• yes — Non-root users are allowed to control this device.
• no — Non-root users are not allowed to control this device.
/etc/sysconfig/static-routes

You can add the following two lines to the file
"/etc/sysconfig/static-routes":

eth0 net 192.168.2.0 netmask 255.255.255.0 gw 192.168.2.1
eth1 net 192.168.1.0 netmask 255.255.255.0 gw 192.168.1.2
Network Administration Tool
The Network Administration Tool (system-config-network) is
an easy way to make changes to the various network
interface configuration files

Pg 159


 #system-config-network
Network configuration
1. Add a network device associated with the physical
   hardware device.

2. Configure the hostname and DNS settings.

3. Configure any hosts that cannot be looked up through
DNS.
DHCP configuration
1. Backup existing static configuration
• First backup existing network configuration file
   using cp command:
   # cp /etc/sysconfig/network-scripts/ifcfg-eth0
   /root/ifcfg-eth0.bak
2. Configuring a DHCP Client:
• Setting up a Linux for dhcp can be done by editing file using a
  text editor such as vi:
  # vi /etc/sysconfig/network-scripts/ifcfg-eth0
DHCP configuration
• Following is sample static configuration:
  DEVICE=eth0
  BOOTPROTO=static
  HWADDR=00:19:D1:2A:BA:A8
  IPADDR=10.10.29.66
  NETMASK=255.255.255.192
  ONBOOT=yes
DHCP configuration
3. Replace static configuration with DHCP:
  DEVICE=eth0
  BOOTPROTO=dhcp
  HWADDR=00:19:D1:2A:BA:A8
  ONBOOT=yes
4. Save and close the file. Just restart network
  service:
  # /etc/init.d/network restart (in ubuntu the service is
  called networking)
  Please note that you need a configuration file for each device
  that you want to configure to use DHCP.

More Related Content

PPT
Networking Chapter 6
mlrbrown
 
PPTX
WINDOWS SERVER 2008
Tawose Olamide Timothy
 
PPTX
17 roles of window server 2008 r2
IGZ Software house
 
PPT
Network operating systems
Sachin Awasthi
 
PDF
How To Add Roles & Features
MjNoOoN
 
PPT
Installing driver
Online
 
PPTX
Computer networking
Abdul Rehman
 
Networking Chapter 6
mlrbrown
 
WINDOWS SERVER 2008
Tawose Olamide Timothy
 
17 roles of window server 2008 r2
IGZ Software house
 
Network operating systems
Sachin Awasthi
 
How To Add Roles & Features
MjNoOoN
 
Installing driver
Online
 
Computer networking
Abdul Rehman
 

What's hot (20)

DOCX
CBLM - Set Up Computer Network (CSS)
Jean_SHS DepEd
 
PPTX
Linux User Management
Gaurav Mishra
 
PPT
Ports
Taiba Shafique
 
PPTX
Straight&Cross-over cable connection
Horacio Aceveda
 
PPTX
Computer system and network configuration
Von Alvarez
 
PPT
Duties of a system administrator
Khang-Ling Loh
 
PPTX
Setting up computer servers (sucs)
Melchor Maravillas
 
PPTX
Introduction to Operating Systems
Damian T. Gordon
 
PPT
Chapter07 Advanced File System Management
Raja Waseem Akhtar
 
PPT
Server client-presentation.
Norvy Villanueva
 
PPTX
BOOTABLE OPERATING SYSTEM PPT
Shahzeb Pirzada
 
PPT
Understanding nas (network attached storage)
sagaroceanic11
 
PPTX
Windows server
Hideo Amezawa
 
PDF
Presentation on linux
Veeral Bhateja
 
PDF
Configure and administer server
Abenezer Abiti
 
PPTX
Bootable-USB.pptx
DevineGraceValo2
 
PPTX
peer to peer and client server model
Bharath Nair
 
PPTX
File & Printer Sharing
EILLEN IVY PORTUGUEZ
 
PPSX
Install ubuntu
pramoddps
 
PDF
CSS L07 - Preparing the Installer
Marvin Bronoso
 
CBLM - Set Up Computer Network (CSS)
Jean_SHS DepEd
 
Linux User Management
Gaurav Mishra
 
Straight&Cross-over cable connection
Horacio Aceveda
 
Computer system and network configuration
Von Alvarez
 
Duties of a system administrator
Khang-Ling Loh
 
Setting up computer servers (sucs)
Melchor Maravillas
 
Introduction to Operating Systems
Damian T. Gordon
 
Chapter07 Advanced File System Management
Raja Waseem Akhtar
 
Server client-presentation.
Norvy Villanueva
 
BOOTABLE OPERATING SYSTEM PPT
Shahzeb Pirzada
 
Understanding nas (network attached storage)
sagaroceanic11
 
Windows server
Hideo Amezawa
 
Presentation on linux
Veeral Bhateja
 
Configure and administer server
Abenezer Abiti
 
Bootable-USB.pptx
DevineGraceValo2
 
peer to peer and client server model
Bharath Nair
 
File & Printer Sharing
EILLEN IVY PORTUGUEZ
 
Install ubuntu
pramoddps
 
CSS L07 - Preparing the Installer
Marvin Bronoso
 
Ad

Viewers also liked (20)

PPT
Configuration and testing of network
Kak Yong
 
PDF
Networking devices
rupinderj
 
PPT
Basic concepts of computer Networking
Hj Habib
 
PPT
NETWORK TOPOLOGY
Kak Yong
 
PPTX
Networking
Palash Sachan
 
PPTX
Network Hardware And Software
Steven Cahill
 
PPT
Networking ppt
Shovan Mandal
 
PPTX
Distribution network reconfiguration for loss reduction and voltage
Gaddafi Sani
 
PPTX
Computer networking devices
Rajesh Sadhukha
 
PPT
BASIC CONCEPTS OF COMPUTER NETWORKS
Kak Yong
 
PDF
Lan configuration in windows Server 2008 R2 part 01
naveenmcitp.india.nk
 
PDF
Windows server 2008 step by-step guide for dns in small networks
Ochiroo Dorj
 
PPT
PHYSICAL TRANSMISSION MEDIA
Kak Yong
 
PDF
Linux Network commands
Hanan Nmr
 
PPT
P1111143901
Ashraf Aboshosha
 
PPTX
Firewall presentation
Amandeep Kaur
 
PPS
Network ppt
hlalu861
 
PPTX
Introduction to computer network
Ashita Agrawal
 
PDF
Basic linux commands
Aniket Thakur
 
DOCX
Customization swatch bharat cess
mbraghumb
 
Configuration and testing of network
Kak Yong
 
Networking devices
rupinderj
 
Basic concepts of computer Networking
Hj Habib
 
NETWORK TOPOLOGY
Kak Yong
 
Networking
Palash Sachan
 
Network Hardware And Software
Steven Cahill
 
Networking ppt
Shovan Mandal
 
Distribution network reconfiguration for loss reduction and voltage
Gaddafi Sani
 
Computer networking devices
Rajesh Sadhukha
 
BASIC CONCEPTS OF COMPUTER NETWORKS
Kak Yong
 
Lan configuration in windows Server 2008 R2 part 01
naveenmcitp.india.nk
 
Windows server 2008 step by-step guide for dns in small networks
Ochiroo Dorj
 
PHYSICAL TRANSMISSION MEDIA
Kak Yong
 
Linux Network commands
Hanan Nmr
 
P1111143901
Ashraf Aboshosha
 
Firewall presentation
Amandeep Kaur
 
Network ppt
hlalu861
 
Introduction to computer network
Ashita Agrawal
 
Basic linux commands
Aniket Thakur
 
Customization swatch bharat cess
mbraghumb
 
Ad

Similar to Network configuration (20)

PDF
Linux network configuration
Mario Tabuada Mussio
 
PPTX
5 - Networking in Red Hat
Shafaan Khaliq Bhatti
 
PPTX
5-Networking-Red-Hat-Commands-slides.pptx
ChSheraz3
 
PDF
Linux networking
sanakiyan
 
PPTX
Networking in linux
Varnnit Jain
 
PPT
Ch16 system administration
Raja Waseem Akhtar
 
PPTX
Linux networking
Arie Bregman
 
PDF
Unit 9 basic system configuration tools
root_fibo
 
DOCX
Useful Linux commands
Sukanta Pradhan
 
PPT
Configuration DHCP
Tan Huynh Cong
 
PPT
Lession4 Dhcp
leminhvuong
 
PDF
Network commands
Dr. Mahadev Gawas
 
PPTX
14 network tools
Shay Cohen
 
PPTX
Linux Commands
lucita cabral
 
PDF
Manage Networking in RHEL - RHCSA (RH124).pdf
RHCSA Guru
 
PPT
Linux Networking Commands
tmavroidis
 
PDF
The ifconfig Command
Kevin OBrien
 
PDF
Sharing your-internet-connection-on-linux
jasembo
 
KEY
/etc/rc.d配下とかのリーディング勉強会
Naoya Nakazawa
 
PDF
Linux hpc-cluster-setup-guide
jasembo
 
Linux network configuration
Mario Tabuada Mussio
 
5 - Networking in Red Hat
Shafaan Khaliq Bhatti
 
5-Networking-Red-Hat-Commands-slides.pptx
ChSheraz3
 
Linux networking
sanakiyan
 
Networking in linux
Varnnit Jain
 
Ch16 system administration
Raja Waseem Akhtar
 
Linux networking
Arie Bregman
 
Unit 9 basic system configuration tools
root_fibo
 
Useful Linux commands
Sukanta Pradhan
 
Configuration DHCP
Tan Huynh Cong
 
Lession4 Dhcp
leminhvuong
 
Network commands
Dr. Mahadev Gawas
 
14 network tools
Shay Cohen
 
Linux Commands
lucita cabral
 
Manage Networking in RHEL - RHCSA (RH124).pdf
RHCSA Guru
 
Linux Networking Commands
tmavroidis
 
The ifconfig Command
Kevin OBrien
 
Sharing your-internet-connection-on-linux
jasembo
 
/etc/rc.d配下とかのリーディング勉強会
Naoya Nakazawa
 
Linux hpc-cluster-setup-guide
jasembo
 

Recently uploaded (20)

PDF
Biological Classification Class 11th NCERT CBSE NEET.pdf
NehaRohtagi1
 
PPTX
Python-Application-in-Drug-Design by R D Jawarkar.pptx
Rahul Jawarkar
 
PPTX
HEALTH CARE DELIVERY SYSTEM - UNIT 2 - GNM 3RD YEAR.pptx
Priyanshu Anand
 
DOCX
Modul Ajar Deep Learning Bahasa Inggris Kelas 11 Terbaru 2025
wahyurestu63
 
PPTX
A Smarter Way to Think About Choosing a College
Cyndy McDonald
 
PDF
Review of Related Literature & Studies.pdf
Thelma Villaflores
 
PPTX
Cleaning Validation Ppt Pharmaceutical validation
Ms. Ashatai Patil
 
PPTX
An introduction to Prepositions for beginners.pptx
drsiddhantnagine
 
PPTX
Measures_of_location_-_Averages_and__percentiles_by_DR SURYA K.pptx
Surya Ganesh
 
PPTX
Basics and rules of probability with real-life uses
ravatkaran694
 
PPTX
Continental Accounting in Odoo 18 - Odoo Slides
Celine George
 
PPTX
Applications of matrices In Real Life_20250724_091307_0000.pptx
gehlotkrish03
 
PPTX
CDH. pptx
AneetaSharma15
 
PPTX
How to Track Skills & Contracts Using Odoo 18 Employee
Celine George
 
PPTX
BASICS IN COMPUTER APPLICATIONS - UNIT I
suganthim28
 
DOCX
SAROCES Action-Plan FOR ARAL PROGRAM IN DEPED
Levenmartlacuna1
 
PPTX
20250924 Navigating the Future: How to tell the difference between an emergen...
McGuinness Institute
 
PPTX
Command Palatte in Odoo 18.1 Spreadsheet - Odoo Slides
Celine George
 
PPTX
family health care settings home visit - unit 6 - chn 1 - gnm 1st year.pptx
Priyanshu Anand
 
PPTX
Five Point Someone – Chetan Bhagat | Book Summary & Analysis by Bhupesh Kushwaha
Bhupesh Kushwaha
 
Biological Classification Class 11th NCERT CBSE NEET.pdf
NehaRohtagi1
 
Python-Application-in-Drug-Design by R D Jawarkar.pptx
Rahul Jawarkar
 
HEALTH CARE DELIVERY SYSTEM - UNIT 2 - GNM 3RD YEAR.pptx
Priyanshu Anand
 
Modul Ajar Deep Learning Bahasa Inggris Kelas 11 Terbaru 2025
wahyurestu63
 
A Smarter Way to Think About Choosing a College
Cyndy McDonald
 
Review of Related Literature & Studies.pdf
Thelma Villaflores
 
Cleaning Validation Ppt Pharmaceutical validation
Ms. Ashatai Patil
 
An introduction to Prepositions for beginners.pptx
drsiddhantnagine
 
Measures_of_location_-_Averages_and__percentiles_by_DR SURYA K.pptx
Surya Ganesh
 
Basics and rules of probability with real-life uses
ravatkaran694
 
Continental Accounting in Odoo 18 - Odoo Slides
Celine George
 
Applications of matrices In Real Life_20250724_091307_0000.pptx
gehlotkrish03
 
CDH. pptx
AneetaSharma15
 
How to Track Skills & Contracts Using Odoo 18 Employee
Celine George
 
BASICS IN COMPUTER APPLICATIONS - UNIT I
suganthim28
 
SAROCES Action-Plan FOR ARAL PROGRAM IN DEPED
Levenmartlacuna1
 
20250924 Navigating the Future: How to tell the difference between an emergen...
McGuinness Institute
 
Command Palatte in Odoo 18.1 Spreadsheet - Odoo Slides
Celine George
 
family health care settings home visit - unit 6 - chn 1 - gnm 1st year.pptx
Priyanshu Anand
 
Five Point Someone – Chetan Bhagat | Book Summary & Analysis by Bhupesh Kushwaha
Bhupesh Kushwaha
 

Network configuration

  • 3. #Ifconfig eth0 down #Ifconfig eth0 up == #service network restart To configure a static IP: #ifconfig eth0 192.168.10.12 netmask 255.255.255.0 broadcast 192.168.10.255 up
  • 4. Default route(Default Gateway) # route add default gw {IP-ADDRESS} {INTERFACE-NAME} #route add default gw 192.168.1.254 eth0
  • 5. static route #ip route show this is a command to show you the default gateway and the ip You can add static route using following command: #ip route add {NETWORK} via {IP} dev {DEVICE} For example network 192.168.55.0/24 available via 192.168.1.254: # ip route add 192.168.55.0/24 via 192.168.1.254 dev eth1 Alternatively, you can use old good route command: # route add -net 192.168.55.0 netmask 255.255.255.0 gw 192.168.1.254 dev eth1
  • 7. /etc/hosts The main purpose of this file is to resolve hostnames that cannot be resolved any other way. It can also be used to resolve hostnames on small networks with no DNS server. /etc/resolv.conf This file specifies the IP addresses of DNS servers and the search domain. /etc/sysconfig/network This file specifies routing and host information for all network interfaces. /etc/sysconfig/network-scripts/ifcfg-<interface-name> For each network interface, there is a corresponding interface configuration script. Each of these files provide information specific to a particular network interface.
  • 8. /etc/sysconfig/network The /etc/sysconfig/network file is used to specify information about the desired network configuration. The following values may be used: • NETWORKING=<value>, where <value> is one of the following boolean values: yes — Networking should be configured. no — Networking should not be configured. • HOSTNAME=<value>, where <value> should be the Fully Qualified Domain Name (FQDN), such as hostname.expample.com, but can be whatever hostname is necessary. • GATEWAY=<value>, where <value> is the IP address of the network's gateway.
  • 9. /etc/sysconfig/network Static IP address Configuration: (Configure gateway address) NETWORKING=yes HOSTNAME=my-hostname -Hostname is defined here and by command hostname GATEWAY="XXX.XXX.XXX.YYY" - Used if your network is connected to another network or the internet. OR for DHCP client configuration: NETWORKING=yes HOSTNAME=my-hostname - Hostname is defined here and by command hostname
  • 10. /etc/sysconfig/network-scripts/ifcfg- <interface-name> The following is a sample ifcfg-eth0 file for a system using a FIXED IP address: DEVICE=eth0 BOOTPROTO=none ONBOOT=yes NETWORK=10.0.1.0 NETMASK=255.255.255.0 IPADDR=10.0.1.27 USERCTL=no Example, using DHCP server: # Intel Corporation 82540EM Gigabit Ethernet Controller DEVICE=eth0 BOOTPROTO=dhcp HWADDR=08:00:27:FF:FB:FE ONBOOT=yes
  • 11. Below is a listing of the configurable parameters in an Ethernet interface configuration file: /etc/sysconfig/network-scripts/ifcfg-<interface- name>
  • 12. BOOTPROTO=<protocol> where <protocol> is one of the following: • none — No boot-time protocol should be used. • bootp — The BOOTP protocol should be used. • dhcp — The DHCP protocol should be used. DEVICE=<name> where <name> is the name of the physical device (except for dynamically-allocated PPP devices where it is the logical name). DNS{1,2}=<address> where <address> is a name server address to be placed in /etc/resolv.conf if the PEERDNS directive is set to yes.
  • 13. GATEWAY=<address> where <address> is the IP address of the network router or gateway device (if any). HWADDR=<MAC-address> where <MAC-address> is the hardware address of the Ethernet device in the form AA:BB:CC:DD:EE:FF. This directive must be used in machines containing more than one NIC to ensure that the interfaces are assigned the correct device names regardless of the configured load order for each NIC's module. This directive should not be used in conjunction with MACADDR. IPADDR=<address> where <address> is the IP address. NETMASK=<mask> where <mask> is the netmask value.
  • 14. ONBOOT=<answer> where <answer> is one of the following: • yes — This device should be activated at boot-time. • no — This device should not be activated at boot-time. USERCTL=<answer> where <answer> is one of the following: • yes — Non-root users are allowed to control this device. • no — Non-root users are not allowed to control this device.
  • 15. /etc/sysconfig/static-routes You can add the following two lines to the file "/etc/sysconfig/static-routes": eth0 net 192.168.2.0 netmask 255.255.255.0 gw 192.168.2.1 eth1 net 192.168.1.0 netmask 255.255.255.0 gw 192.168.1.2
  • 16. Network Administration Tool The Network Administration Tool (system-config-network) is an easy way to make changes to the various network interface configuration files Pg 159 #system-config-network
  • 18. 1. Add a network device associated with the physical hardware device. 2. Configure the hostname and DNS settings. 3. Configure any hosts that cannot be looked up through DNS.
  • 19. DHCP configuration 1. Backup existing static configuration • First backup existing network configuration file using cp command: # cp /etc/sysconfig/network-scripts/ifcfg-eth0 /root/ifcfg-eth0.bak 2. Configuring a DHCP Client: • Setting up a Linux for dhcp can be done by editing file using a text editor such as vi: # vi /etc/sysconfig/network-scripts/ifcfg-eth0
  • 20. DHCP configuration • Following is sample static configuration: DEVICE=eth0 BOOTPROTO=static HWADDR=00:19:D1:2A:BA:A8 IPADDR=10.10.29.66 NETMASK=255.255.255.192 ONBOOT=yes
  • 21. DHCP configuration 3. Replace static configuration with DHCP: DEVICE=eth0 BOOTPROTO=dhcp HWADDR=00:19:D1:2A:BA:A8 ONBOOT=yes 4. Save and close the file. Just restart network service: # /etc/init.d/network restart (in ubuntu the service is called networking) Please note that you need a configuration file for each device that you want to configure to use DHCP.