Chap-I Network and System Configuration in Linux Created By : Asst. Prof. Ashish Shah, J.M. Patel College of Commerce Unit-II Chap-I Network and System Configuration in Linux
Importance of config. Files Created By : Asst. Prof. Ashish Shah, J.M. Patel College of Commerce Importance of config. Files By modifying config. Files behavior of almost every every program can be configured and customize to required preference. Following are the files to be changed while setting up the system. /sysconfig/network-scripts/ifcfg-eth0 : this files specifies a TCP network information. /sysconfig/network : this file specifies a network config. used by the system during boot process
Networking config. files Created By : Asst. Prof. Ashish Shah, J.M. Patel College of Commerce Networking config. files 3) /etc/hosts : this files listshosts to be resolved locally. This informs linux about local system which are not handled by DNS server. 4) /etc/resolv.conf: this file is the host name resolver config. files. This file help linux to know which DNS server will be resolving domain names into IP addresses. 5) /etc/nnswitch.conf : this file is the system database and name service switch config. file. It lists host name typically look at local files, then NIS server, then DNS server.
Setting up an IP ADDRESS Created By : Asst. Prof. Ashish Shah, J.M. Patel College of Commerce Setting up an IP ADDRESS Every comp. Must have an IP address to get identified on network. IP address is set at the installation time. Later too IP can be set manually by editing IPADDR attribute value of /etc/sysconfig/network-scripts/ifcfg-eth0 file. Eg. IPADDR : 192.168.1.147
Setting up an IP ADDRESS Created By : Asst. Prof. Ashish Shah, J.M. Patel College of Commerce Setting up an IP ADDRESS Setting up the hostname: hostname is set in two diff. files: /etc/sysconfig/network and /etc/hosts. The first file make the changes in line showing the hostname. The sec file makes changes in the first line by adding the hostname.
Setting up an IP ADDRESS Created By : Asst. Prof. Ashish Shah, J.M. Patel College of Commerce Setting up an IP ADDRESS Setting up the DNS Name Resolution: Edit resolv.conf file to add your DNS server IP addresses. Max. three DNS server IP adresses can be added. If 1st one on the list is not responding, PC will connect to 2nd DNS IP address and so on. Edit /etc/resolv.conf to add a list of IP address like this: nameserver: 1.2.3.4 nameserver: 1.2.3.5 nameserver: 1.2.3.6
Setting up an IP ADDRESS Created By : Asst. Prof. Ashish Shah, J.M. Patel College of Commerce Setting up an IP ADDRESS Making a local file of Hostname to IP adress mappings: The /etc/hosts file stores a list of hostnames and their corresponding, IP addresses. It contains IP address to hostname mappings in the follwoing format. Ip_addresscanonical_hostname aliases. For eg. 192.168.1.66 ad.bsc.edu ad 192.168.1.67 jmp.mum.edu jmp 192.168.1.68 skm.jun.edu skm
Setting up an IP ADDRESS Created By : Asst. Prof. Ashish Shah, J.M. Patel College of Commerce Setting up an IP ADDRESS Setting Up Name Service Resolution Order: To inform Linux server about the 1st method to be used to look up for host name, make the config. in the /etc/nsswitch.conf file. Following parameters are to be specified (generally) : hosts: files nis dns passwd: files nis shadow: files nis group: files nis ethers: files netmasks: files networks: files protocols: files rpc: files services: files netgroup: files publickey: files automount: files nis aliases: files nis plus
Startup network services from Extended internet Daemon Created By : Asst. Prof. Ashish Shah, J.M. Patel College of Commerce Startup network services from Extended internet Daemon Extended internet Daemon (xinetd) , is a open source daemon which manages internet based connectivity. It offers a more secure replacement to inetd, the internet daemon. It starts programs that provide internet services. Xinetd is also referred to as a super-server as it listens all service ports for the services listed in its config. file. When a request comes in, xinetd starts the appropriate server. It provides extensive logging and lets user bind specific services to specific config. file, which is located in the /etc/xinetd.d directory. /etc/xinetd.conf is the configuration file for xinetd.
Startup network services from Extended internet Daemon Created By : Asst. Prof. Ashish Shah, J.M. Patel College of Commerce Startup network services from Extended internet Daemon The services listed in xinetd’s config file can be divided in two groups: Services in the first group are called multi-threaded and they require a new server process for each new connection request. The second group single-threded in which the services daemon is responsible for handling all new connection requests.
Startup network services from rc-scripts Created By : Asst. Prof. Ashish Shah, J.M. Patel College of Commerce Startup network services from rc-scripts As system boots, RC-scripts start those network services which are not started out of xinetd. Network services started at the default boot level 3 are started out of the /etc/rc3.d directory. A file with the name of the services is placed in directory. User can start or stop service. The script to start the service starts with an S and to kill scripts starts with K.
Other network config. files Created By : Asst. Prof. Ashish Shah, J.M. Patel College of Commerce Other network config. files Files present in /etc/sysconfig directory are used to create routes to other hosts ie. On own network or on outside network. These files are used to set up firewall rules for network to set permission on newwork connections. Files present in /etc/sysconfig/network-scripts directory are used to set parameters for the hardware and software used for networking.
Init scripts and its management Created By : Asst. Prof. Ashish Shah, J.M. Patel College of Commerce Init scripts and its management Init process is responsible for starting system processes. When the init command starts, it becomes the root of all of the processes that start up automatically on the syste. Linux system can start at different levels. By default linux starts in multiuser mode ie. runlevel-3. Init prog. starts all of the background processes by looking in the appropriate rc directory for the run level specified as default in inti config. file.
Init scripts and its management Created By : Asst. Prof. Ashish Shah, J.M. Patel College of Commerce Init scripts and its management In RC directories, all the listed files start with either S or K. The files start with S are the processes that are started on that run level and files starts with K are the processes which are killed on that runlevel. Scripts that do not start with S do not run at startup.. When the system start up in def. runlevel 3 it runs the scripts in the /etc/rc3.d directory. In general every S script has a corresponding K script to kill the services at shutdown.
Init scripts and its management Created By : Asst. Prof. Ashish Shah, J.M. Patel College of Commerce Init scripts and its management Chkconfig: it is a command which list all the services and check whether they are stopped or started in each runlevel. It results in a long list. The first column is the name of the installed service. The next seven columns represent run level and also about whether that service is turned on or off in that run level.
Init scripts and its management Created By : Asst. Prof. Ashish Shah, J.M. Patel College of Commerce Init scripts and its management To turn a service off or on using chkconfig, use the following syntax. For eg: To turn off the gpm daemon, type chkconfig --level2 gpm off To turn on the xinetd type chkconfig xineted on Note: changes in xineted services will be reflected only at boot time.