RSS

Lab 1: Network configuration

10 Jan

      This is a lab. Today, we will do with network configuration.

    1. View hostname
        • View Kernel

        • View hostname

        • Change hostname

    2. View IP card hardware
        • View IP

        • Change IP

        • Create Alias

    3. Config Route in PC(don’t have Routing in Router)
        • View route client

        • Adding gateway

        • Adding route

        • Deleting route

    4. Manager and checking conection
        • Netstat

        • Tracert

        • Tcpdump

    5. View and config DNS client
        • View services

        • Config DNS client

      1. View hostname
        • View Kernel

        Kernel is background system to run other program

          Command:

          uname

          uname -a #view all

          clip_image001

           

          • View hostname

              Hostname is the naming for IP

              Comannd:

              hostname

              uname -n

              clip_image002

               

              • Change hostname

                  Change hostname in current session use to change file:

                  Command:

                  vi /etc/hosts

                  After that, change host name below

                  clip_image003

                  If we need to change on last session, we could do:

                  Command:

                  vi /etc/sysconfig/network

                  After that, change hostname below:( restart service to effect)

                  clip_image004

                   

                • View IP card hardware
                  • View IP

                      Command:

                      ifconfig  or ifconfig <name_card_hardware>

                      clip_image005

                       

                      • Change IP

                        Command:

                        ifconfig <name_card> <new_IP> netmask <new_netmask> [up/down]

                        Up/down: is start or stop card after change IP

                        clip_image006

                        But, it’s just to effect in current session. If you want to effect in last session. You have to change file script

                        Command:

                        vi /etc/sysconfig/network-scripts/ifcfg-eth0

                        You can change more property in there:

                        ONBOOT=

                        (yes/no)Start in startup

                        BOOTPROTO=

                        (dhcp/static/none)

                        NETMASK=

                         

                        IPADDR=

                        IP

                        GATEWAY=

                        Default gateway

                        TYPE=

                        (Ethernet/)

                        USERCTL=

                        (yes/no)

                        PEERDNS=

                        (yes/no)

                          clip_image007

                           

                          • Create Alias

                              The same thing with change IP but some different in command:

                              ifconfig <name_card>:<number_Alias> <new_IP> netmask <new_netmask> [up/down]

                              clip_image008

                            • Config Route in PC(don’t have Routing in Router)
                              • View route client

                                  Command:

                                  route -n or netstat -nr

                                  clip_image009

                                   

                                  • Set default gateway

                                      Command:

                                      route add default gw <IP_gateway>

                                      clip_image010

                                       

                                      • Adding route

                                          Command:

                                          route add -net <IP_net_address> netmask <netmask> gw <IP_gateway> [card_hardware]

                                          clip_image011

                                           

                                          • Deleting route

                                              Command :

                                              route del -net <IP_net_address> netmask <netmask> gw <IP_gateway> [card_hardware]

                                              clip_image012

                                               

                                            • Manager and checking conection
                                              • Netstat

                                                  It’s view Routing table and socket running in system

                                                  Command:

                                                  netstat -nr and netstat -na

                                                   

                                                  • Tracert

                                                      Checking the connection from station to other station. Take a list hop in connection.

                                                      clip_image013

                                                     

                                                      • Tcpdump

                                                          View packet transmit on hardware

                                                          clip_image014

                                                           

                                                        5. View and config DNS client

                                                          • View services

                                                            We can view service by command :

                                                            service --status-all 

                                                            Or  view file by command : vi /etc/services

                                                            Structure file:

                                                            Name service

                                                            Port/protocol

                                                            Aliases

                                                            Memo

                                                               

                                                              • Config DNS client

                                                              • View file (create if not exists). Command : vi /etc/resolve

                                                              • clip_image015

                                                              • Maximum is 6 nameserver

                                                               
                                                               

                                                              Tags:

                                                              Leave a Reply

                                                              Fill in your details below or click an icon to log in:

                                                              WordPress.com Logo

                                                              You are commenting using your WordPress.com account. Log Out / Change )

                                                              Twitter picture

                                                              You are commenting using your Twitter account. Log Out / Change )

                                                              Facebook photo

                                                              You are commenting using your Facebook account. Log Out / Change )

                                                              Google+ photo

                                                              You are commenting using your Google+ account. Log Out / Change )

                                                              Connecting to %s