SlideShare ist ein Scribd-Unternehmen logo
1 von 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.

Weitere ähnliche Inhalte

Was ist angesagt?

Understanding nas (network attached storage)
Understanding nas (network attached storage)Understanding nas (network attached storage)
Understanding nas (network attached storage)
sagaroceanic11
 
Network Presentation
Network PresentationNetwork Presentation
Network Presentation
guestdfb4d8
 
Chapter 4 configuring and managing the dns server role
Chapter 4   configuring and managing the dns server roleChapter 4   configuring and managing the dns server role
Chapter 4 configuring and managing the dns server role
Luis Garay
 
Networking Chapter 6
Networking Chapter 6Networking Chapter 6
Networking Chapter 6
mlrbrown
 

Was ist angesagt? (20)

Peer to-peer network
Peer to-peer networkPeer to-peer network
Peer to-peer network
 
Network cable
Network cableNetwork cable
Network cable
 
IP addressing and Subnetting PPT
IP addressing and Subnetting PPTIP addressing and Subnetting PPT
IP addressing and Subnetting PPT
 
Wireless routers Presentation
Wireless routers PresentationWireless routers Presentation
Wireless routers Presentation
 
Understanding nas (network attached storage)
Understanding nas (network attached storage)Understanding nas (network attached storage)
Understanding nas (network attached storage)
 
DHCP
DHCPDHCP
DHCP
 
Network Presentation
Network PresentationNetwork Presentation
Network Presentation
 
Course 102: Lecture 20: Networking In Linux (Basic Concepts)
Course 102: Lecture 20: Networking In Linux (Basic Concepts) Course 102: Lecture 20: Networking In Linux (Basic Concepts)
Course 102: Lecture 20: Networking In Linux (Basic Concepts)
 
Network configuration and simulation
Network configuration and simulationNetwork configuration and simulation
Network configuration and simulation
 
WAN Technologies slide show
WAN Technologies slide showWAN Technologies slide show
WAN Technologies slide show
 
Network Cabling
Network CablingNetwork Cabling
Network Cabling
 
Chapter 4 configuring and managing the dns server role
Chapter 4   configuring and managing the dns server roleChapter 4   configuring and managing the dns server role
Chapter 4 configuring and managing the dns server role
 
COMPUTER NETWORK
COMPUTER NETWORKCOMPUTER NETWORK
COMPUTER NETWORK
 
Dhcp ppt
Dhcp pptDhcp ppt
Dhcp ppt
 
Linux and DNS Server
Linux and DNS ServerLinux and DNS Server
Linux and DNS Server
 
Networking Chapter 6
Networking Chapter 6Networking Chapter 6
Networking Chapter 6
 
03 network services
03 network services03 network services
03 network services
 
Networking in linux
Networking in linuxNetworking in linux
Networking in linux
 
Common Network Services
Common Network ServicesCommon Network Services
Common Network Services
 
Network cable
Network cableNetwork cable
Network cable
 

Andere mochten auch

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
 

Andere mochten auch (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
 

Ähnlich wie 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
 

Ähnlich wie 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
 

Kürzlich hochgeladen

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
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
ciinovamais
 
Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdfVishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdf
ssuserdda66b
 

Kürzlich hochgeladen (20)

Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
 
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
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
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...
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).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
 
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
 
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
 
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
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
 
Spatium Project Simulation student brief
Spatium Project Simulation student briefSpatium Project Simulation student brief
Spatium Project Simulation student brief
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptx
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxSKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
 
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
 
Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdfVishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdf
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structure
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 

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.