Sunteți pe pagina 1din 18

Network Configuration

Isbat Uzzin
Device Recognition
 All drivers for network interface cards are
builts as modules
 Networking scripts reference logical
interface name, eg:
 Eth0
 /etc/modprobe.conf maps logical names to
specific module name
 Example
 Alias eth0 3c59x
Network Interafaces
 Interfaces names
 Ethernet: eth0, eth1, ethN
 Token Ring: tr0, tr1, trN
 FDDI: fdi0,fddi1,fddiN
 PPP: ppp0,ppp1,pppN
 Data Link layer address
 ifconfig
Mii-tool
 Views and controls the negotiated media
speed (100BaseTX, 10BaseT) of same
ethernet cards
 Useful for forcing specific ethernet speed
and duplex settings
 Changes with mii-tool should be made on
inactive interfaces
ifconfig
 Used to configure and set IP Address on
network interfaces
 Not usually called directly, but by other
scripts
 Also used to view properties of active and
inactive network interfaces
ifup / ifdown
 If(up|down) interface
 Start and stop network interfaces
 Take care of details specific to interface
 Changing/adding/deleting routes
 Obtains addresses as needed
 BOOTP, DHCP
Interface Configuration Files
 Ifcfg-xxx
 Located in:
 /etc/sysconfig/network-scripts/
 Configuration methods
 Static
 Dhcp
 bootp
Configuration Utility
 Netconfig
 Text-Based network configuration tool
 Only writes config files. Does not activate device or
changes. Use ifup/ifdown to activate changes
 Used bu kudzu when new network card found at boot
time
 System-config-network
 GNOME-based network configuration tool
 Can be launched by a non-privilaged user, but
requires authentication as root
Binding multiple IP Address
 Use Multiple IP addresses on NIC
 Virtual (interface(s)
 For small number of Ips, create an ifcfg
file for each virtual interface
 Ifcfg—ethX:xxx

 For large number of Ips, create an ifcfg


range file
 Ifcfg-ethX-rangeX
DHCP/BOOTP
 The dhclient daemon manages client-side
DHCP and BOOTP
 For DHCP, dhclient:
 Obtains a lease
 Performs automatic lease renewal
 Normally run by ifup/ifdown
 Can be run manually to force renewal or
release of a lease
Global Network Parameters
 /etc/sysconfig/network
 NETWORKING=yes/no
 HOSNAME=<fqdn by default>
 GATEWAY=<gateway IP>
 NISDOMAIN=<nis domain name>
Default Route
 Global default defined in:
 /etc/sysconfig/network
 GATEWAY=xxx.xxx.xxx.xxx
 Default gateway can also be defined in
 /etc/sysconfig/network-scripts/ifcfg-xxx
 Ifcfg-xxx default overrides Global default
routes
 GATEWAY=xxx.xxx.xxx.xxx
Static Routes
 Connected networks
 Linux kernel automatically creates a network
route for connected networks
 Static routes defined per interface
 /etc/sysconfig/network-scripts/route-eth0
 /etc/sysconfig/networking/devices/eth0.route
 Display with
 Route –n
 Netstat -rn
Name Resolution
 Hostname – display or set the system’s
name
 Is initially set by rc.sysinit from $HOSTNAME
variable
 /etc/sysconfig/network
 /etc/hosts – local database of hostname to
IP address mappings
 Checked before DNS
 Useful for small isolated networks
DNS client configuration
 /etc/resolv.conf
 Defines which name servers to use
 Servers are checked in order listed
DNS Utilies
 Usefull utilities in bind-utils RPM package
include:
 Host: gather host/domain information
 Host ns1.redhat.com
 Host –a redhat.com

 Dig: send queries to name server directly


 Dig @ns1.redhat.com mx redhat.com
 nslookup
Network Diagnostics
 Ping
 Networkpacket loss and latency
measurement tool
 Traceoute, mtr
 Display network path to a destination
 Netstat
 Multi-purpose network information tool

S-ar putea să vă placă și