Networking by skillmac

VIEWS: 20 PAGES: 12

									         NETWORKING BASICS



Advanced System Administration Course


Fred Msumeno
University computing Centre Ltd,
University of Dar es salaam,
E-mail: mfred@udsm.ac.tz
Website: www.udsm.ac.tz
Configuring network
parameters


.
Network configuration using GUI

     Switch your desktop to a GUI mode
(if it is not in GUI mode )using any of the following
#init 5, or
#Ctrl+Alt +F7
     Start terminal and type
    [root@utawala ~]# system-config-network or
    [root@utawala ~]# redhat-config-network

 select the interface, enter IP and DNS settings.
Seve and activate or
[root@utawala ~]# service network restart
Network configuration using
Command line
   Network Configuration for a Static IP Address Using the
   Command Line
   Set the IP address and network mask
root@utawala ~]# /sbin/ifconfig -a eth0 192.168.1.5 netmask
   255.255.255.0
This gives the machine the IP address 192.168.1.5, but you can use
   any combination of IP/netmask that will work with your network.
   Verify the settings with
root@utawala ~]# /sbin/ifconfig eth0.
   Add the default gatway:
root@utawala ~]# /sbin/route add default gw 192.168.1.254
replace 192.168.1.254 with your gateway.
   Verify the gateway setting:
root@utawala ~]# /sbin/route.
You can use -n option, to display numerical addresses instead of trying
   to determine symbolic host names (via dns or /etc/hosts file)
root@utawala ~]# /sbin/route –n

 The line beginning with default should have your gateway under the
  gateway column.
   Ping the gateway and a few other computers on the
   network to verify your settings are correct.
   Add route
[root@utawala ~]# route add -net 196.44.162.0 netmask
   255.255.254.0 gw 196.44.161.5
This command add a network 196.44.162.0/23 to a
   gateway 196.44.161.5
Network configuration using network
files
    Network Configuration Files
  The primary 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.
 [root@utawala ~]# vi /etc/hosts
    /etc/resolv.conf
 This file specifies the IP addresses of DNS servers and the search
    domain. Unless configured to do otherwise, the network
    initialization scripts populate this file.
 [root@utawala ~]# vi /etc/resolv.conf
   /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.
[root@utawala ~]# vi /etc/sysconfig/network-scripts/ifcfg-
   eth0
Configure static IP address
   Edit the file /etc/sysconfig/network-scripts/ifcfg-eth0 Traffic that a
   device receives through its interfaces
   root@utawala ~]# vi /etc/sysconfig/network-scripts/ifcfg-eth0
Please read /usr/share/doc/initscripts-*/sysconfig.txt
# for the documentation of these parameters.
GATEWAY=196.44.161.1
TYPE=Ethernet
DEVICE=eth0
NETMASK=255.255.255.0
IPADDR=196.44.161.208
IPV6INIT=no
ONBOOT=no
USERCTL=yes
PEERDNS=yes
BOOTPROTO=none
Configure dynamic IP address
  root@utawala ~]# vi /etc/sysconfig/network-scripts/ifcfg-eth0
  DEVICE=eth0
  USERCTL=no
  ONBOOT=yes
  BOOTPROTO=dhcp
 BROADCAST=
 NETWORK=
 NETMASK=
 IPADDR
  Edit/create the file /etc/sysconfig/network to use DHCP
  NETWORKING=yes
  HOSTNAME=
  FORWARD_IPV4=yes
  GATEWAYDEV=
  GATEWAY=
     Restart the network to probe the DHCP server for your network settings with
     the command
  [root@utawala ~]# /etc/rc.d/init.d/network restart
     Verify your network settings with the command
[root@utawala ~]# /sbin/ifconfig
Make sure you have received an IP address from the DHCP server.
Troubleshooting network
      Restarting network service
  [root@utawala ~]# /etc/init.d/network restart

      Shuting down interface
  [root@utawala ~]# Ifdown eth0
      Working up interface
  [root@utawala ~]# Ifup eth0
      Checking in
      Checking interface information
  [root@utawala ~]# ethtool eth0

      tcpdump
  dump traffic on a network.
  [root@utawala ~]#tcpdump > fred
   Traceroute
print the route packets take to network host
[root@utawala ~]# traceroute www.yahoo.com
   Mtr
A network diagnostic tool. Combines the functionality of the traceroute
   and ping programs in a single network
     diagnostic tool.
[wala ~]# mtr www.yahoo.com
root@uta
   Ethereal
network protocol analyzer for Unix and Windows
[root@mitocw root]# tethereal > testdata

								
To top