0% found this document useful (0 votes)
64 views20 pages

Network Configuration: 69-3 Nguyen Thi Nho, P9, Q.Tbinh, Tp. HCM

The document discusses configuring network interfaces on Linux systems. It covers installing and configuring network interface cards, setting static or dynamic IP addresses, configuring naming services and routing tables, and using tools like ping, traceroute, and dig to test network connectivity. Common connection types like PPP and setting up a dial-up connection with chat scripts are also outlined. Finally, daemons involved in network configuration like inetd and xinetd are described.

Uploaded by

m3onh0x84
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
64 views20 pages

Network Configuration: 69-3 Nguyen Thi Nho, P9, Q.Tbinh, Tp. HCM

The document discusses configuring network interfaces on Linux systems. It covers installing and configuring network interface cards, setting static or dynamic IP addresses, configuring naming services and routing tables, and using tools like ping, traceroute, and dig to test network connectivity. Common connection types like PPP and setting up a dial-up connection with chat scripts are also outlined. Finally, daemons involved in network configuration like inetd and xinetd are described.

Uploaded by

m3onh0x84
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 20

Chapter 13

Network Configuration

SAIGONLAB 83 Nguyễn
69-3 ThịThi
Nguyen Nhỏ,Nho,
P9, Q.Tân Bình, Tp.Tp.
P9, Q.TBinh, HCMHCM LPI 102
Objectives

Configure and install Network Interface Card


Define loadable kernel modules
Define and configure naming services
Configure routes
Describe SLIP, CSLIP and ISDN
Describe and configure PPP
Analyze and test network configuration setting

SAIGONLAB 83 Nguyễn
69-3 ThịThi
Nguyen Nhỏ,Nho,
P9, Q.Tân Bình, Tp.Tp.
P9, Q.TBinh, HCMHCM LPI 102
Install the Device (NIC)

NIC are primarily implemented as loadable modules.


Some modules utilities:
insmod Installs a module into the running
kernel
modprobe Installs modules and checks for
dependencies
lsmod List currently loaded modules
rmmod Remove modules
depmod –a Goes through all the modules and
list their modules dependencies
( /lib/modules/<kernel version>/kernel/drivers/net )

SAIGONLAB 83 Nguyễn
69-3 ThịThi
Nguyen Nhỏ,Nho,
P9, Q.Tân Bình, Tp.Tp.
P9, Q.TBinh, HCMHCM LPI 102
Configure the Device (NIC)

When module is install and aliased, it can be


attached to an IP address :
 Dynamic: DHCP
 Static : use ifconfig command. This command is
executed at boot time to configure each interface
card (ifcfg-eth0…)
# ifconfig eth0 172.16.1.1
# ifconfig eth0 up

SAIGONLAB 83 Nguyễn
69-3 ThịThi
Nguyen Nhỏ,Nho,
P9, Q.Tân Bình, Tp.Tp.
P9, Q.TBinh, HCMHCM LPI 102
[root@lpi root]# ifconfig
eth0 Link encap:Ethernet HWaddr 00:08:A1:00:20:9B
inet addr:192.168.20.118 Bcast:192.168.20.255
Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:29111 errors:0 dropped:0 overruns:0 frame:0
TX packets:5558 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:21465564 (20.4 Mb) TX bytes:765308 (747.3 Kb)
Interrupt:5 Base address:0xd000

SAIGONLAB 83 Nguyễn
69-3 ThịThi
Nguyen Nhỏ,Nho,
P9, Q.Tân Bình, Tp.Tp.
P9, Q.TBinh, HCMHCM LPI 102
Setting Up Networking

Includes configuring naming services, routes, ..and


use some basic tools to test these configurations
 Mapping hostnames to IP addresses
/etc/hosts :localhost, statically, DNS,..
/etc/networks : the same /etc/hosts
/etc/host.conf :order to check to resolve name
/etc/nsswitch.conf : same /etc/host.conf
(primarily for NIS)
route :show and manipulate the kernel’s IP
routing table. IMPORTANT : usually used
to is set default gateway on a host

SAIGONLAB 83 Nguyễn
69-3 ThịThi
Nguyen Nhỏ,Nho,
P9, Q.Tân Bình, Tp.Tp.
P9, Q.TBinh, HCMHCM LPI 102
Setting Up Networking

The /etc/host.conf may be contains:


order hosts,bind,nis
multi on
order Specifies order in which computer should
resolve the name
multi Specifies that ALL valid address should be
returned, not just the first one

SAIGONLAB 83 Nguyễn
69-3 ThịThi
Nguyen Nhỏ,Nho,
P9, Q.Tân Bình, Tp.Tp.
P9, Q.TBinh, HCMHCM LPI 102
Setting Up Networking

Use route to add default gateway:


# route add default gw 172.16.0.2
# route add default gw lpi-102
You can use some GUI tools : netcfg,
.. to set up networking

SAIGONLAB 83 Nguyễn
69-3 ThịThi
Nguyen Nhỏ,Nho,
P9, Q.Tân Bình, Tp.Tp.
P9, Q.TBinh, HCMHCM LPI 102
Routing tables and Routing Daemons

Routing tables:
Contains list of available networks
Contains a gateway (default gateway) machine for
that network, if applicable ( show it with route Or
netstat –r )
Routing daemons : (routed and gated)
only necessary if you are building a “multihomed” or
“dual-homed” network

SAIGONLAB 83 Nguyễn
69-3 ThịThi
Nguyen Nhỏ,Nho,
P9, Q.Tân Bình, Tp.Tp.
P9, Q.TBinh, HCMHCM LPI 102
Get network status information

Use command: netstat [option]


-a View all sockets
-n Show numeric address (x.x.x.x:22
instead of x.x.x.x:ssh)
-i View interfaces
-r View routing statistics
-p View process id bind the interface

SAIGONLAB 83 Nguyễn
69-3 ThịThi
Nguyen Nhỏ,Nho,
P9, Q.Tân Bình, Tp.Tp.
P9, Q.TBinh, HCMHCM LPI 102
inetd Daemon

It listens for incoming network requests at several


ports and launches the appropriate program. This is to
prevent running : pop3d, ftpd, telnetd, …
When it receives a request (i.e on port 23)
invokes the telnet daemon (telnetd)
passes established socket to telnet
telnetd services the request
when telnet daemon becomes idle, it terminates
itself and will not start again until inetd invokes it
again

SAIGONLAB 83 Nguyễn
69-3 ThịThi
Nguyen Nhỏ,Nho,
P9, Q.Tân Bình, Tp.Tp.
P9, Q.TBinh, HCMHCM LPI 102
Setting service for inetd

Setting for inetd are stored in /etc/inetd.conf


<service> <socket> <protocol> <flags> <user> <server path> <arg>

Example :
ftp stream tcp nowait root /usr/sbin/in.ftpd in.ftpd

SAIGONLAB 83 Nguyễn
69-3 ThịThi
Nguyen Nhỏ,Nho,
P9, Q.Tân Bình, Tp.Tp.
P9, Q.TBinh, HCMHCM LPI 102
xinetd Daemon

Designed as secure replacement for inetd

 Configuration file: /etc/xinetd.conf

 Each service is setup in one file, contains in


/etc/xinet.d/ ( #man xinetd.conf for setting up)

SAIGONLAB 83 Nguyễn
69-3 ThịThi
Nguyen Nhỏ,Nho,
P9, Q.Tân Bình, Tp.Tp.
P9, Q.TBinh, HCMHCM LPI 102
Connections

SLIP and CSLIP


Integrated Services Digital Network (ISDN)
Point to Point Protocol (PPP)
 It’s a mechanism for creating and running IP and
others protocol over a serial link (modem on telephone
line). It’s used :
Connect a Linux PC to PPP server and access resources
of the network to which the server is connected
Set up a Linux PC as PPP server
Link two Linux PCs on two network (or local to Internet)
on peer-to-peer system.

SAIGONLAB 83 Nguyễn
69-3 ThịThi
Nguyen Nhỏ,Nho,
P9, Q.Tân Bình, Tp.Tp.
P9, Q.TBinh, HCMHCM LPI 102
Setting up PPP

chat command with chat-script


ABORT ‘BUSY’
‘’ ATZ
OK ATD12345678
CONNECT ‘’
login linux
password penguin
Kppp : configure and starting PPP
Dial-up Tools : minicom, Wvdial

SAIGONLAB 83 Nguyễn
69-3 ThịThi
Nguyen Nhỏ,Nho,
P9, Q.Tân Bình, Tp.Tp.
P9, Q.TBinh, HCMHCM LPI 102
Common Networking Tools

ping : simple but very useful tool used to test


network connectivity
ping 127.0.0.1 to determine if the protocol is
behaving correctly
ping a machine in the same subnet
ping the gateway
ping some machine beyond the gateway. If that
works, the gateway can forward packets

SAIGONLAB 83 Nguyễn
69-3 ThịThi
Nguyen Nhỏ,Nho,
P9, Q.Tân Bình, Tp.Tp.
P9, Q.TBinh, HCMHCM LPI 102
Common Networking Tools

traceroute : use to discover network and routing


problems. It prints out IP address and name (if
possible) of each router that it cross.
Example of traceroute output :
3 router.abc.com (203.113.158.29) 143.995 ms
100.372 ms 66.840 m

SAIGONLAB 83 Nguyễn
69-3 ThịThi
Nguyen Nhỏ,Nho,
P9, Q.Tân Bình, Tp.Tp.
P9, Q.TBinh, HCMHCM LPI 102
Common Networking Tools - dig

dig (domain information groper): performs a DNS


lookup for queried name servers
It’s great tool for troubleshooting DNS because of its
flexibility and detail of information
If run without option dig will query the server listed in
/etc/resolv.conf

SAIGONLAB 83 Nguyễn
69-3 ThịThi
Nguyen Nhỏ,Nho,
P9, Q.Tân Bình, Tp.Tp.
P9, Q.TBinh, HCMHCM LPI 102
Common Networking Tools - whois whois

whois: returns list of domain name, location of the


organization or business, names of administrators or
other contact personnel information
IPv4 : whois.arin.net
IPv6 : whois.6bone.net
Domains : whois.internic.net

SAIGONLAB 83 Nguyễn
69-3 ThịThi
Nguyen Nhỏ,Nho,
P9, Q.Tân Bình, Tp.Tp.
P9, Q.TBinh, HCMHCM LPI 102
Summary

Configure and install Network Interface Card


Define loadable kernel modules
 Define and configure naming services
Configure routes
 Describe SLIP, CSLIP and ISDN
Describe and configure PPP
Analyze and test network configuration setting

SAIGONLAB 83 Nguyễn
69-3 ThịThi
Nguyen Nhỏ,Nho,
P9, Q.Tân Bình, Tp.Tp.
P9, Q.TBinh, HCMHCM LPI 102

You might also like