SlideShare une entreprise Scribd logo
1  sur  21
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
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.

Contenu connexe

Tendances

Tendances (20)

Introduction to Network Applications & Network Services
Introduction to  Network Applications &  Network ServicesIntroduction to  Network Applications &  Network Services
Introduction to Network Applications & Network Services
 
Types of Ethernet Cable
Types of Ethernet CableTypes of Ethernet Cable
Types of Ethernet Cable
 
CSS L14 - ETHERNET CABLING
CSS L14 - ETHERNET CABLINGCSS L14 - ETHERNET CABLING
CSS L14 - ETHERNET CABLING
 
CBLM - Set Up Computer Network (CSS)
CBLM - Set Up Computer Network (CSS)CBLM - Set Up Computer Network (CSS)
CBLM - Set Up Computer Network (CSS)
 
Network configuration and simulation
Network configuration and simulationNetwork configuration and simulation
Network configuration and simulation
 
Straight&Cross-over cable connection
Straight&Cross-over cable connectionStraight&Cross-over cable connection
Straight&Cross-over cable connection
 
Configure Computer System and Network
Configure Computer System and NetworkConfigure Computer System and Network
Configure Computer System and Network
 
Network Troubleshooting
Network TroubleshootingNetwork Troubleshooting
Network Troubleshooting
 
CSS NC II Module : Set-up Computer Networks
CSS NC II Module : Set-up Computer NetworksCSS NC II Module : Set-up Computer Networks
CSS NC II Module : Set-up Computer Networks
 
CSS L11 INTRODUCTION TO COMPUTER NETWORKING
CSS L11 INTRODUCTION TO COMPUTER NETWORKINGCSS L11 INTRODUCTION TO COMPUTER NETWORKING
CSS L11 INTRODUCTION TO COMPUTER NETWORKING
 
CSS NC II learning Module
CSS NC II learning ModuleCSS NC II learning Module
CSS NC II learning Module
 
WINDOWS SERVER 2008
WINDOWS SERVER 2008WINDOWS SERVER 2008
WINDOWS SERVER 2008
 
Computer System and Network Configurations.pptx
Computer System and Network Configurations.pptxComputer System and Network Configurations.pptx
Computer System and Network Configurations.pptx
 
Networking tools
Networking toolsNetworking tools
Networking tools
 
Computer system and network configuration
Computer system and network configurationComputer system and network configuration
Computer system and network configuration
 
Peer to-peer networks
Peer to-peer networksPeer to-peer networks
Peer to-peer networks
 
Testing and troubleshooting networks
Testing and troubleshooting networksTesting and troubleshooting networks
Testing and troubleshooting networks
 
Peer To Peer Networking
Peer To Peer NetworkingPeer To Peer Networking
Peer To Peer Networking
 
Ict 9 module 4 introduction
Ict 9 module 4 introductionIct 9 module 4 introduction
Ict 9 module 4 introduction
 
CSS L15 - CRIMPING ETHERNET CABLE AND RJ45
CSS L15 - CRIMPING ETHERNET CABLE AND RJ45CSS L15 - CRIMPING ETHERNET CABLE AND RJ45
CSS L15 - CRIMPING ETHERNET CABLE AND RJ45
 

En vedette

Networking devices
Networking devicesNetworking devices
Networking devices
rupinderj
 
Basic concepts of computer Networking
Basic concepts of computer NetworkingBasic concepts of computer Networking
Basic concepts of computer Networking
Hj Habib
 
NETWORK TOPOLOGY
NETWORK TOPOLOGYNETWORK TOPOLOGY
NETWORK TOPOLOGY
Kak Yong
 
Network Hardware And Software
Network Hardware And SoftwareNetwork Hardware And Software
Network Hardware And Software
Steven Cahill
 
BASIC CONCEPTS OF COMPUTER NETWORKS
BASIC CONCEPTS OF COMPUTER NETWORKS BASIC CONCEPTS OF COMPUTER NETWORKS
BASIC CONCEPTS OF COMPUTER NETWORKS
Kak Yong
 
Windows server 2008 step by-step guide for dns in small networks
Windows server 2008 step by-step guide for dns in small networksWindows server 2008 step by-step guide for dns in small networks
Windows server 2008 step by-step guide for dns in small networks
Ochiroo Dorj
 
Firewall presentation
Firewall presentationFirewall presentation
Firewall presentation
Amandeep Kaur
 

En vedette (20)

Configuration and testing of network
Configuration and testing of networkConfiguration and testing of network
Configuration and testing of network
 
Networking devices
Networking devicesNetworking devices
Networking devices
 
Basic concepts of computer Networking
Basic concepts of computer NetworkingBasic concepts of computer Networking
Basic concepts of computer Networking
 
NETWORK TOPOLOGY
NETWORK TOPOLOGYNETWORK TOPOLOGY
NETWORK TOPOLOGY
 
Networking
NetworkingNetworking
Networking
 
Network Hardware And Software
Network Hardware And SoftwareNetwork Hardware And Software
Network Hardware And Software
 
Networking ppt
Networking ppt Networking ppt
Networking ppt
 
Distribution network reconfiguration for loss reduction and voltage
Distribution network reconfiguration for loss reduction and voltageDistribution network reconfiguration for loss reduction and voltage
Distribution network reconfiguration for loss reduction and voltage
 
Computer networking devices
Computer networking devicesComputer networking devices
Computer networking devices
 
BASIC CONCEPTS OF COMPUTER NETWORKS
BASIC CONCEPTS OF COMPUTER NETWORKS BASIC CONCEPTS OF COMPUTER NETWORKS
BASIC CONCEPTS OF COMPUTER NETWORKS
 
Lan configuration in windows Server 2008 R2 part 01
Lan configuration in windows Server 2008 R2 part 01Lan configuration in windows Server 2008 R2 part 01
Lan configuration in windows Server 2008 R2 part 01
 
Windows server 2008 step by-step guide for dns in small networks
Windows server 2008 step by-step guide for dns in small networksWindows server 2008 step by-step guide for dns in small networks
Windows server 2008 step by-step guide for dns in small networks
 
PHYSICAL TRANSMISSION MEDIA
PHYSICAL TRANSMISSION MEDIA PHYSICAL TRANSMISSION MEDIA
PHYSICAL TRANSMISSION MEDIA
 
Linux Network commands
Linux Network commandsLinux Network commands
Linux Network commands
 
P1111143901
P1111143901P1111143901
P1111143901
 
Firewall presentation
Firewall presentationFirewall presentation
Firewall presentation
 
Network ppt
Network pptNetwork ppt
Network ppt
 
Introduction to computer network
Introduction to computer networkIntroduction to computer network
Introduction to computer network
 
Basic linux commands
Basic linux commandsBasic linux commands
Basic linux commands
 
Customization swatch bharat cess
Customization  swatch bharat cessCustomization  swatch bharat cess
Customization swatch bharat cess
 

Similaire à Network configuration

Unit 9 basic system configuration tools
Unit 9 basic system configuration toolsUnit 9 basic system configuration tools
Unit 9 basic system configuration tools
root_fibo
 
Arp Dan Ipconfig Syntax
Arp Dan Ipconfig  SyntaxArp Dan Ipconfig  Syntax
Arp Dan Ipconfig Syntax
guestcc37e8c
 
Components of computer systems often have dependencies--other co.pdf
Components of computer systems often have dependencies--other co.pdfComponents of computer systems often have dependencies--other co.pdf
Components of computer systems often have dependencies--other co.pdf
alamodeindia1
 
Automatic systems installations and change management wit FAI - Talk for Netw...
Automatic systems installations and change management wit FAI - Talk for Netw...Automatic systems installations and change management wit FAI - Talk for Netw...
Automatic systems installations and change management wit FAI - Talk for Netw...
Henning Sprang
 

Similaire à Network configuration (20)

Unit 9 basic system configuration tools
Unit 9 basic system configuration toolsUnit 9 basic system configuration tools
Unit 9 basic system configuration tools
 
Arp Dan Ipconfig Syntax
Arp Dan Ipconfig  SyntaxArp Dan Ipconfig  Syntax
Arp Dan Ipconfig Syntax
 
Dhcp confg
Dhcp confgDhcp confg
Dhcp confg
 
Vpn addind technique
Vpn addind techniqueVpn addind technique
Vpn addind technique
 
configure a DHCP server on Fedora.pdf
configure a DHCP server on Fedora.pdfconfigure a DHCP server on Fedora.pdf
configure a DHCP server on Fedora.pdf
 
Lession4 Dhcp
Lession4 DhcpLession4 Dhcp
Lession4 Dhcp
 
Configuration DHCP
Configuration DHCPConfiguration DHCP
Configuration DHCP
 
Dhcp
DhcpDhcp
Dhcp
 
Automating everything with PowerShell, Terraform, and AWS
Automating everything with PowerShell, Terraform, and AWSAutomating everything with PowerShell, Terraform, and AWS
Automating everything with PowerShell, Terraform, and AWS
 
Konfigurasi Server Gateway dengan fitur PROXY, WEBSERVER dan DHCP
Konfigurasi Server Gateway dengan fitur PROXY, WEBSERVER dan DHCPKonfigurasi Server Gateway dengan fitur PROXY, WEBSERVER dan DHCP
Konfigurasi Server Gateway dengan fitur PROXY, WEBSERVER dan DHCP
 
CN 1.docx
CN 1.docxCN 1.docx
CN 1.docx
 
9 creating cent_os 7_mages_for_dpdk_training
9 creating cent_os 7_mages_for_dpdk_training9 creating cent_os 7_mages_for_dpdk_training
9 creating cent_os 7_mages_for_dpdk_training
 
nwlab-ex1.pdf
nwlab-ex1.pdfnwlab-ex1.pdf
nwlab-ex1.pdf
 
Components of computer systems often have dependencies--other co.pdf
Components of computer systems often have dependencies--other co.pdfComponents of computer systems often have dependencies--other co.pdf
Components of computer systems often have dependencies--other co.pdf
 
Automatic systems installations and change management wit FAI - Talk for Netw...
Automatic systems installations and change management wit FAI - Talk for Netw...Automatic systems installations and change management wit FAI - Talk for Netw...
Automatic systems installations and change management wit FAI - Talk for Netw...
 
5 - Networking in Red Hat
5 - Networking in Red Hat5 - Networking in Red Hat
5 - Networking in Red Hat
 
Rhel3
Rhel3Rhel3
Rhel3
 
Modul server debian 5
Modul server debian 5Modul server debian 5
Modul server debian 5
 
DNS,SMTP and POP3
DNS,SMTP and POP3DNS,SMTP and POP3
DNS,SMTP and POP3
 
main
mainmain
main
 

Dernier

1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
QucHHunhnh
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please Practise
AnaAcapella
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
heathfieldcps1
 

Dernier (20)

Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structure
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
Dyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptxDyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptx
 
Spatium Project Simulation student brief
Spatium Project Simulation student briefSpatium Project Simulation student brief
Spatium Project Simulation student brief
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please Practise
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptx
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
Fostering Friendships - Enhancing Social Bonds in the Classroom
Fostering Friendships - Enhancing Social Bonds  in the ClassroomFostering Friendships - Enhancing Social Bonds  in the Classroom
Fostering Friendships - Enhancing Social Bonds in the Classroom
 

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
  • 17.
  • 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.