SlideShare a Scribd company logo
Computer Networks (CS C461 / IS C461)
                           Assignments
                             PART A
1)ip:
Name: show / manipulate routing, devices, policy routing and tunnels .
Synopsis:
ip [ OPTIONS ] OBJECT { COMMAND | help }

OBJECT := { link | addr | addrlabel | route | rule | neigh | tunnel | maddr | mroute | monitor }

OPTIONS := { -V[ersion] | -s[tatistics] | -r[esolve] | -f[amily] { inet | inet6 | ipx | dnet | link } | -o[neline] }

Examples:
       ip link show : List network interfaces




       ip link set dev eth0 name eth1 :         Rename interface eth0 to eth1
Computer Networks (CS C461 / IS C461)
                         Assignments
                           PART A

      ip link set dev eth0 up :Bring interface eth0 up (or down)
      ip addr show : List addresses for interfaces




      ip route show :List routing table




      ip route add default via 10.3.10.1:   Set default gateway to 10.3.10.1



2)nc:
NAME: nc — arbitrary TCP and UDP connections and listens.
SYNOPSIS:       nc [-46DdhklnrStUuvzC] [-i interval] [-P proxy_username] [-p source_port]
                [-s source_ip_address] [-T ToS] [-w timeout] [-X proxy_protocol] [-x
               proxy_address[:port]] [hostname] [port[s]]
DESCRIPTION:
  The nc (or netcat) utility is used for just about anything under the sun
  involving TCP or UDP. It can open TCP connections, send UDP packets,
  listen on arbitrary TCP and UDP ports, do port scanning, and deal with
  both IPv4 and IPv6. Unlike telnet(1), nc scripts nicely, and separates
  error messages onto standard error instead of sending them to standard
  output, as telnet(1) does with some.
Computer Networks (CS C461 / IS C461)
                         Assignments
                           PART A
Examples:
    nc host port: where host is the IP address or DNS name of a host to connect to and port is the TCP
      port number to connect to. By default, netcat uses TCP. Unlike telnet, netcat doesn't print
      anything to the screen when a connection is made unless you use the -v command line option.




      To scan ports command used is : nc -z 10.3.10.36 10-100 and to show close ports too include –v:
       nc -vz 10.3.10.36 10-100




3)ssh:
NAME: ssh — OpenSSH SSH client (remote login program).

SYNOPSIS:

         ssh [-1246AaCfgKkMNnqsTtVvXxYy] [-b bind_address] [-c cipher_spec] [-D
           [bind_address:]port] [-e escape_char] [-F configfile] [-I pkcs11]
           [-i identity_file] [-L [bind_address:]port:host:hostport]
           [-l login_name] [-m mac_spec] [-O ctl_cmd] [-o option] [-p port]
           [-R [bind_address:]port:host:hostport] [-S ctl_path] [-W host:port]
           [-w local_tun[:remote_tun]] [user@]hostname [command]
Computer Networks (CS C461 / IS C461)
                          Assignments
                            PART A
DESCRIPTION:

          ssh (SSH client) is a program for logging into a remote machine and for
          executing commands on a remote machine. It is intended to replace rlogin
          and rsh, and provide secure encrypted communications between two
          untrusted hosts over an insecure network. X11 connections and arbitrary
          TCP ports can also be forwarded over the secure channel.

Examples:
      ssh user@hostname




4)scp:
NAME: scp — secure copy (remote file copy program).

SYNOPSIS:

scp [-1246BCpqrv] [-c cipher] [-F ssh_config] [-i identity_file]

[-l limit] [-o ssh_option] [-P port] [-S program]

[[user@]host1:]file1 ... [[user@]host2:]file
Computer Networks (CS C461 / IS C461)
                          Assignments
                            PART A
DESCRIPTION:

scp copies files between hosts on a network. It uses ssh(1) for data

transfer, and uses the same authentication and provides the same security

 as ssh(1). Unlike rcp(1), scp will ask for passwords or passphrases if

they are needed for authentication.

 File names may contain a user and host specification to indicate that the

file is to be copied to/from that host. Local file names can be made

explicit using absolute or relative pathnames to avoid scp treating file

names containing ‘:’ as host specifiers. Copies between two remote hosts

are also permitted.

Examples:

      scp sampletextfile.txt your_username@remotehost.edu:/some/remote/directory




      scp your_username@remotehost.edu:samplefile.txt /some/local/directory
Computer Networks (CS C461 / IS C461)
                        Assignments
                          PART A
    5)arp:
    NAME: arp - manipulate the system ARP cache.
    SYNOPSIS:
       arp [-vn] [-H type] [-i if] [-a] [hostname]

        arp [-v] [-i if] -d hostname [pub]

        arp [-v] [-H type] [-i if] -s hostname hw_addr [temp]

        arp [-v] [-H type] [-i if] -s hostname hw_addr [netmask nm] pub

        arp [-v] [-H type] [-i if] -Ds hostname ifname [netmask nm] pub

       arp [-vnD] [-H type] [-i if] -f [filename]
    DESCRIPTION:
       Arp manipulates or displays the kernel's IPv4 network neighbour cache.
       It can add entries to the table, delete one or display the current con‐
       tent.

        ARP stands for Address Resolution Protocol, which is used to find the
        media access control address of a network neighbour for a given IPv4
        Address.

    Examples:
   arp -a




   arp –a ip
Computer Networks (CS C461 / IS C461)
                      Assignments
                        PART A

   Delete an ARP entry: arp -d




    6)rarp:
    NAME: rarp - manipulate the system RARP table
    SYNOPSIS:
         rarp [-V] [--version] [-h] [--help]
         rarp -a
         rarp [-v] -d hostname ...
         rarp [-v] [-t type] -s hostname hw_addr
     DESCRIPTION:
      Arp manipulates or displays the kernel's IPv4 network neighbour cache.
      It can add entries to the table, delete one or display the current con‐
      tent.
      ARP stands for Address Resolution Protocol, which is used to find the
      media access control address of a network neighbour for a given IPv4
      Address.

    Examples:
   rarp –a
    aniket@ubuntu:~$ rarp -a
    This kernel does not support RARP.
Computer Networks (CS C461 / IS C461)
                       Assignments
                         PART A
    7)route:
    NAME: route - show / manipulate the IP routing table.
    SYNOPSIS:
       route [-CFvnee]

       route [-v] [-A family] add [-net|-host] target [netmask Nm] [gw Gw]
           [metric N] [mss M] [window W] [irtt I] [reject] [mod] [dyn]
           [reinstate] [[dev] If]

       route [-v] [-A family] del [-net|-host] target [gw Gw] [netmask Nm]
           [metric N] [[dev] If]

       route [-V] [--version] [-h] [--help]
     DESCRIPTION:
       Route manipulates the kernel's IP routing tables. Its primary use is
       to set up static routes to specific hosts or networks via an interface
       after it has been configured with the ifconfig(8) program.

       When the add or del options are used, route modifies the routing
       tables. Without these options, route displays the current contents of
       the routing tables.
    Examples:
   route
Computer Networks (CS C461 / IS C461)
                      Assignments
                        PART A

   route add default gw 10.3.10.1 eth0




    8)netstat:
    NAME: netstat - Print network connections, routing tables, interface statistics, masquerade
    connections, and multicast memberships.
    SYNOPSIS:
        netstat [address_family_options] [--tcp|-t] [--udp|-u] [--raw|-w] [--listening|-l] [--all|-a]
    [--numeric|-n] [--numeric-hosts] [--numeric-ports]
        [--numeric-users] [--symbolic|-N] [--extend|-e[--extend|-e]] [--timers|-o] [--program|-p] [--
    verbose|-v] [--continuous|-c]

       netstat {--route|-r} [address_family_options] [--extend|-e[--extend|-e]] [--verbose|-v] [--
    numeric|-n] [--numeric-hosts] [--numeric-ports] [--numeric-users]
       [--continuous|-c]

       netstat {--interfaces|-i} [--all|-a] [--extend|-e[--extend|-e]] [--verbose|-v] [--program|-p] [--
    numeric|-n] [--numeric-hosts] [--numeric-ports] [--numeric-
       users] [--continuous|-c]

        netstat {--groups|-g} [--numeric|-n] [--numeric-hosts] [--numeric-ports] [--numeric-users] [--
    continuous|-c]

       netstat {--masquerade|-M} [--extend|-e] [--numeric|-n] [--numeric-hosts] [--numeric-ports] [--
    numeric-users] [--continuous|-c]

        netstat {--statistics|-s} [--tcp|-t] [--udp|-u] [--raw|-w]

        netstat {--version|-V}

        netstat {--help|-h}
Computer Networks (CS C461 / IS C461)
                      Assignments
                        PART A
    DESCRIPTION:
       Netstat prints information about the Linux networking subsystem.

    Examples:

   List All Ports (both listening and non listening ports : netstat -a (-u if for udp ports)




   show statistics for all ports using netstat –s
Computer Networks (CS C461 / IS C461)
                      Assignments
                        PART A



   Display the kernel routing information using netstat –r




   Show the list of network interfaces: netstat -i




    9)ifup:
    NAME: ifup - bring a network interface up.
    SYNOPSIS:
       ifup [-nv] [--no-act] [--verbose] [-i FILE|--interfaces=FILE] [--allow
       CLASS] -a|IFACE...
       ifup -h|--help
       ifup -V|--version
    DESCRIPTION:
       The ifup and ifdown commands may be used to configure (or, respec‐
       tively, deconfigure) network interfaces based on interface definitions
       in the file /etc/network/interfaces.
Computer Networks (CS C461 / IS C461)
                      Assignments
                        PART A


    10)ifdown:
    NAME: take a network interface down
    SYNOPSIS:
           ifdown [-nv] [--no-act] [--verbose] [-i FILE|--interfaces=FILE]
            [--allow CLASS] -a|IFACE...
    DESCRIPTION:
       The ifup and ifdown commands may be used to configure (or, respec‐
       tively, deconfigure) network interfaces based on interface definitions
       in the file /etc/network/interfaces.
    Examples(ifup and ifdown examples are provided together):
   sudo ifup lo/ sudo ifdown lo




    11)iwconfig:
    NAME: iwconfig - configure a wireless network
    SYNOPSIS:
       iwconfig [interface]
       iwconfig interface [essid X] [nwid N] [mode M] [freq F]
                  [channel C][sens S ][ap A ][nick NN ]
                  [rate R] [rts RT] [frag FT] [txpower T]
                  [enc E] [key K] [power P] [retry R]
                  [modu M] [commit]
       iwconfig --help
       iwconfig –version
Computer Networks (CS C461 / IS C461)
                      Assignments
                        PART A

    DESCRIPTION:
       Iwconfig is similar to ifconfig(8), but is dedicated to the wireless
       interfaces. It is used to set the parameters of the network interface
       which are specific to the wireless operation (for example : the fre‐
       quency). Iwconfig may also be used to display those parameters, and
       the wireless statistics (extracted from /proc/net/wireless).

       All these parameters and statistics are device dependent. Each driver
       will provide only some of them depending on hardware support, and the
       range of values may change

    Examples:
   iwconfig(output is given for both with and without wireless connections)
Computer Networks (CS C461 / IS C461)
                      Assignments
                        PART A

    12)iwspy:
    NAME: iwspy - Get wireless statistics from specific nodes.
    SYNOPSIS:
       iwspy [interface]
       iwspy interface [+] DNSNAME | IPADDR | HWADDR [...]
       iwspy interface off
       iwspy interface setthr low high
       iwspy interface getthr
       DESCRIPTION:
       Iwspy is used to set a list of addresses to monitor in a wireless net‐
       work interface and to read back quality of link information for each of
       those. This information is the same as the one available in
       /proc/net/wireless : quality of the link, signal strength and noise
       level.

        This information is updated each time a new packet is received, so each
        address of the list adds some overhead in the driver.

        Note that this functionality works only for nodes part of the current
        wireless cell, you can not monitor Access Points you are not associated
        with (you can use Scanning for that) and nodes in other cells. In Man‐
        aged mode, in most case packets are relayed by the Access Point, in
        this case you will get the signal strength of the Access Point. For
        those reasons this functionality is mostly useful in Ad-Hoc and Master
        mode.

    Examples:
   sudo iwspy eth0
    Output:
    aniket@ubuntu:~$ sudo iwspy eth0
    eth0 Interface doesn't support wireless statistic collection
Computer Networks (CS C461 / IS C461)
                  Assignments
                    PART A
13)iwlist:
NAME: iwlist - Get more detailed wireless information from a wireless inter‐
    Face.
SYNOPSIS:
    iwlist [interface] scanning
    iwlist [interface] frequency
    iwlist [interface] rate
    iwlist [interface] keys
    iwlist [interface] power
    iwlist [interface] txpower
    iwlist [interface] retry
    iwlist [interface] event
    iwlist [interface] auth
    iwlist [interface] wpakeys
    iwlist [interface] genie
    iwlist [interface] modulation
    iwlist --help
    iwlist –version
  DESCRIPTION:
    Iwlist is used to display some additional information from a wireless
    network interface that is not displayed by iwconfig(8). The main argu‐
    ment is used to select a category of information, iwlist displays in
    detailed form all information related to this category, including
    information already shown by iwconfig(8).
Computer Networks (CS C461 / IS C461)
                      Assignments
                        PART A
    Examples:
   iwlist wlan0 scan




    14)tracepath:
    NAME: tracepath, tracepath6 - traces path to a network host discovering MTU
       along this path.
    SYNOPSIS:
       tracepath [-n] [-b] [-l pktlen] destination [port]
    DESCRIPTION:
       It traces path to destination discovering MTU along this path. It uses
       UDP port port or some random port. It is similar to traceroute, only
       does not require superuser privileges and has no fancy options.

        tracepath6 is good replacement for traceroute6 and classic example of
        application of Linux error queues. The situation with IPv4 is worse,
        because commercial IP routers do not return enough information in icmp
        error messages. Probably, it will change, when they will be updated.
        For now it uses Van Jacobson's trick, sweeping a range of UDP ports to
        maintain trace history.
Computer Networks (CS C461 / IS C461)
                      Assignments
                        PART A

    Examples:
   tracepath localhost




   tracepath -b localhost(-b resolves ip address)




   tracepath from localhost(of bits mail server)
Computer Networks (CS C461 / IS C461)
                      Assignments
                        PART A
    15)dhclient:
    NAME: dhclient - Dynamic Host Configuration Protocol Client.
    SYNOPSIS:
       dhclient [ -p port ] [ -d ] [ -e VAR=value ] [ -q ] [ -1 ] [ -r ] [ -x
       ] [ -lf lease-file ] [ -pf pid-file ] [ -cf config-file ] [ -sf
       script-file ] [ -s server ] [ -g relay ] [ -n ] [ -nw ] [ -w ] [ if0 [
       ...ifN ] ]
    DESCRIPTION:
       The Internet Systems Consortium DHCP Client, dhclient, provides a means
       for configuring one or more network interfaces using the Dynamic Host
       Configuration Protocol, BOOTP protocol, or if these protocols fail, by
       statically assigning an address.

    Examples:
   sudo dhclient eth0

More Related Content

Similar to Basic linux commands (20)

PPTX
14 network tools
Shay Cohen
 
PPT
dokumen.tips_linux-networking-commands.ppt
ThorOdinson55
 
PPT
Linux Networking Commands
tmavroidis
 
PDF
Linuxnetworkingcommands
Manikanta Pushadapu
 
PPT
Linux networking
Armando Reis
 
ODP
Scanning with nmap
commiebstrd
 
DOCX
111
gadoosh
 
DOCX
111
gadoosh
 
PPTX
linux networking laboratory presentation .pptx
AnuradhaJadiya1
 
PPT
NW_Tools.ppt
jaba kumar
 
DOCX
Culturally Responsive Literacy Resources Template Part 1.docx
dorishigh
 
PDF
Hackerworkshop exercises
Henrik Kramshøj
 
PPTX
BASIC TO ADVANCED NETWORKING TUTORIALS
Varinder Singh Walia
 
PDF
Network Security Fundamentals Final.pptx
HakimAlHuribi
 
PDF
Network configuration in Linux
Mohammed Yazdani
 
DOCX
Configuracion EIGRP
alexis marck Huiza Canchanya
 
PDF
Network commands
Dr. Mahadev Gawas
 
PDF
The ifconfig Command
Kevin OBrien
 
PDF
Ch 2: TCP/IP Concepts Review
Sam Bowne
 
PDF
Skill final-resuelto
elviscd_4
 
14 network tools
Shay Cohen
 
dokumen.tips_linux-networking-commands.ppt
ThorOdinson55
 
Linux Networking Commands
tmavroidis
 
Linuxnetworkingcommands
Manikanta Pushadapu
 
Linux networking
Armando Reis
 
Scanning with nmap
commiebstrd
 
111
gadoosh
 
111
gadoosh
 
linux networking laboratory presentation .pptx
AnuradhaJadiya1
 
NW_Tools.ppt
jaba kumar
 
Culturally Responsive Literacy Resources Template Part 1.docx
dorishigh
 
Hackerworkshop exercises
Henrik Kramshøj
 
BASIC TO ADVANCED NETWORKING TUTORIALS
Varinder Singh Walia
 
Network Security Fundamentals Final.pptx
HakimAlHuribi
 
Network configuration in Linux
Mohammed Yazdani
 
Configuracion EIGRP
alexis marck Huiza Canchanya
 
Network commands
Dr. Mahadev Gawas
 
The ifconfig Command
Kevin OBrien
 
Ch 2: TCP/IP Concepts Review
Sam Bowne
 
Skill final-resuelto
elviscd_4
 

Recently uploaded (20)

PDF
A Strategic Analysis of the MVNO Wave in Emerging Markets.pdf
IPLOOK Networks
 
PDF
Market Insight : ETH Dominance Returns
CIFDAQ
 
PDF
Data_Analytics_vs_Data_Science_vs_BI_by_CA_Suvidha_Chaplot.pdf
CA Suvidha Chaplot
 
PDF
OFFOFFBOX™ – A New Era for African Film | Startup Presentation
ambaicciwalkerbrian
 
PDF
CIFDAQ's Market Wrap : Bears Back in Control?
CIFDAQ
 
PDF
Generative AI vs Predictive AI-The Ultimate Comparison Guide
Lily Clark
 
PDF
Brief History of Internet - Early Days of Internet
sutharharshit158
 
PPTX
AI and Robotics for Human Well-being.pptx
JAYMIN SUTHAR
 
PDF
The Future of Artificial Intelligence (AI)
Mukul
 
PPTX
Farrell_Programming Logic and Design slides_10e_ch02_PowerPoint.pptx
bashnahara11
 
PPTX
AI Code Generation Risks (Ramkumar Dilli, CIO, Myridius)
Priyanka Aash
 
PDF
Build with AI and GDG Cloud Bydgoszcz- ADK .pdf
jaroslawgajewski1
 
PDF
Trying to figure out MCP by actually building an app from scratch with open s...
Julien SIMON
 
PPTX
The Future of AI & Machine Learning.pptx
pritsen4700
 
PDF
How ETL Control Logic Keeps Your Pipelines Safe and Reliable.pdf
Stryv Solutions Pvt. Ltd.
 
PPTX
OA presentation.pptx OA presentation.pptx
pateldhruv002338
 
PDF
Research-Fundamentals-and-Topic-Development.pdf
ayesha butalia
 
PPTX
Agile Chennai 18-19 July 2025 | Workshop - Enhancing Agile Collaboration with...
AgileNetwork
 
PPTX
Dev Dives: Automate, test, and deploy in one place—with Unified Developer Exp...
AndreeaTom
 
PDF
RAT Builders - How to Catch Them All [DeepSec 2024]
malmoeb
 
A Strategic Analysis of the MVNO Wave in Emerging Markets.pdf
IPLOOK Networks
 
Market Insight : ETH Dominance Returns
CIFDAQ
 
Data_Analytics_vs_Data_Science_vs_BI_by_CA_Suvidha_Chaplot.pdf
CA Suvidha Chaplot
 
OFFOFFBOX™ – A New Era for African Film | Startup Presentation
ambaicciwalkerbrian
 
CIFDAQ's Market Wrap : Bears Back in Control?
CIFDAQ
 
Generative AI vs Predictive AI-The Ultimate Comparison Guide
Lily Clark
 
Brief History of Internet - Early Days of Internet
sutharharshit158
 
AI and Robotics for Human Well-being.pptx
JAYMIN SUTHAR
 
The Future of Artificial Intelligence (AI)
Mukul
 
Farrell_Programming Logic and Design slides_10e_ch02_PowerPoint.pptx
bashnahara11
 
AI Code Generation Risks (Ramkumar Dilli, CIO, Myridius)
Priyanka Aash
 
Build with AI and GDG Cloud Bydgoszcz- ADK .pdf
jaroslawgajewski1
 
Trying to figure out MCP by actually building an app from scratch with open s...
Julien SIMON
 
The Future of AI & Machine Learning.pptx
pritsen4700
 
How ETL Control Logic Keeps Your Pipelines Safe and Reliable.pdf
Stryv Solutions Pvt. Ltd.
 
OA presentation.pptx OA presentation.pptx
pateldhruv002338
 
Research-Fundamentals-and-Topic-Development.pdf
ayesha butalia
 
Agile Chennai 18-19 July 2025 | Workshop - Enhancing Agile Collaboration with...
AgileNetwork
 
Dev Dives: Automate, test, and deploy in one place—with Unified Developer Exp...
AndreeaTom
 
RAT Builders - How to Catch Them All [DeepSec 2024]
malmoeb
 
Ad

Basic linux commands

  • 1. Computer Networks (CS C461 / IS C461) Assignments PART A 1)ip: Name: show / manipulate routing, devices, policy routing and tunnels . Synopsis: ip [ OPTIONS ] OBJECT { COMMAND | help } OBJECT := { link | addr | addrlabel | route | rule | neigh | tunnel | maddr | mroute | monitor } OPTIONS := { -V[ersion] | -s[tatistics] | -r[esolve] | -f[amily] { inet | inet6 | ipx | dnet | link } | -o[neline] } Examples:  ip link show : List network interfaces  ip link set dev eth0 name eth1 : Rename interface eth0 to eth1
  • 2. Computer Networks (CS C461 / IS C461) Assignments PART A  ip link set dev eth0 up :Bring interface eth0 up (or down)  ip addr show : List addresses for interfaces  ip route show :List routing table  ip route add default via 10.3.10.1: Set default gateway to 10.3.10.1 2)nc: NAME: nc — arbitrary TCP and UDP connections and listens. SYNOPSIS: nc [-46DdhklnrStUuvzC] [-i interval] [-P proxy_username] [-p source_port] [-s source_ip_address] [-T ToS] [-w timeout] [-X proxy_protocol] [-x proxy_address[:port]] [hostname] [port[s]] DESCRIPTION: The nc (or netcat) utility is used for just about anything under the sun involving TCP or UDP. It can open TCP connections, send UDP packets, listen on arbitrary TCP and UDP ports, do port scanning, and deal with both IPv4 and IPv6. Unlike telnet(1), nc scripts nicely, and separates error messages onto standard error instead of sending them to standard output, as telnet(1) does with some.
  • 3. Computer Networks (CS C461 / IS C461) Assignments PART A Examples:  nc host port: where host is the IP address or DNS name of a host to connect to and port is the TCP port number to connect to. By default, netcat uses TCP. Unlike telnet, netcat doesn't print anything to the screen when a connection is made unless you use the -v command line option.  To scan ports command used is : nc -z 10.3.10.36 10-100 and to show close ports too include –v: nc -vz 10.3.10.36 10-100 3)ssh: NAME: ssh — OpenSSH SSH client (remote login program). SYNOPSIS: ssh [-1246AaCfgKkMNnqsTtVvXxYy] [-b bind_address] [-c cipher_spec] [-D [bind_address:]port] [-e escape_char] [-F configfile] [-I pkcs11] [-i identity_file] [-L [bind_address:]port:host:hostport] [-l login_name] [-m mac_spec] [-O ctl_cmd] [-o option] [-p port] [-R [bind_address:]port:host:hostport] [-S ctl_path] [-W host:port] [-w local_tun[:remote_tun]] [user@]hostname [command]
  • 4. Computer Networks (CS C461 / IS C461) Assignments PART A DESCRIPTION: ssh (SSH client) is a program for logging into a remote machine and for executing commands on a remote machine. It is intended to replace rlogin and rsh, and provide secure encrypted communications between two untrusted hosts over an insecure network. X11 connections and arbitrary TCP ports can also be forwarded over the secure channel. Examples:  ssh user@hostname 4)scp: NAME: scp — secure copy (remote file copy program). SYNOPSIS: scp [-1246BCpqrv] [-c cipher] [-F ssh_config] [-i identity_file] [-l limit] [-o ssh_option] [-P port] [-S program] [[user@]host1:]file1 ... [[user@]host2:]file
  • 5. Computer Networks (CS C461 / IS C461) Assignments PART A DESCRIPTION: scp copies files between hosts on a network. It uses ssh(1) for data transfer, and uses the same authentication and provides the same security as ssh(1). Unlike rcp(1), scp will ask for passwords or passphrases if they are needed for authentication. File names may contain a user and host specification to indicate that the file is to be copied to/from that host. Local file names can be made explicit using absolute or relative pathnames to avoid scp treating file names containing ‘:’ as host specifiers. Copies between two remote hosts are also permitted. Examples:  scp sampletextfile.txt [email protected]:/some/remote/directory  scp [email protected]:samplefile.txt /some/local/directory
  • 6. Computer Networks (CS C461 / IS C461) Assignments PART A 5)arp: NAME: arp - manipulate the system ARP cache. SYNOPSIS: arp [-vn] [-H type] [-i if] [-a] [hostname] arp [-v] [-i if] -d hostname [pub] arp [-v] [-H type] [-i if] -s hostname hw_addr [temp] arp [-v] [-H type] [-i if] -s hostname hw_addr [netmask nm] pub arp [-v] [-H type] [-i if] -Ds hostname ifname [netmask nm] pub arp [-vnD] [-H type] [-i if] -f [filename] DESCRIPTION: Arp manipulates or displays the kernel's IPv4 network neighbour cache. It can add entries to the table, delete one or display the current con‐ tent. ARP stands for Address Resolution Protocol, which is used to find the media access control address of a network neighbour for a given IPv4 Address. Examples:  arp -a  arp –a ip
  • 7. Computer Networks (CS C461 / IS C461) Assignments PART A  Delete an ARP entry: arp -d 6)rarp: NAME: rarp - manipulate the system RARP table SYNOPSIS: rarp [-V] [--version] [-h] [--help] rarp -a rarp [-v] -d hostname ... rarp [-v] [-t type] -s hostname hw_addr DESCRIPTION: Arp manipulates or displays the kernel's IPv4 network neighbour cache. It can add entries to the table, delete one or display the current con‐ tent. ARP stands for Address Resolution Protocol, which is used to find the media access control address of a network neighbour for a given IPv4 Address. Examples:  rarp –a aniket@ubuntu:~$ rarp -a This kernel does not support RARP.
  • 8. Computer Networks (CS C461 / IS C461) Assignments PART A 7)route: NAME: route - show / manipulate the IP routing table. SYNOPSIS: route [-CFvnee] route [-v] [-A family] add [-net|-host] target [netmask Nm] [gw Gw] [metric N] [mss M] [window W] [irtt I] [reject] [mod] [dyn] [reinstate] [[dev] If] route [-v] [-A family] del [-net|-host] target [gw Gw] [netmask Nm] [metric N] [[dev] If] route [-V] [--version] [-h] [--help] DESCRIPTION: Route manipulates the kernel's IP routing tables. Its primary use is to set up static routes to specific hosts or networks via an interface after it has been configured with the ifconfig(8) program. When the add or del options are used, route modifies the routing tables. Without these options, route displays the current contents of the routing tables. Examples:  route
  • 9. Computer Networks (CS C461 / IS C461) Assignments PART A  route add default gw 10.3.10.1 eth0 8)netstat: NAME: netstat - Print network connections, routing tables, interface statistics, masquerade connections, and multicast memberships. SYNOPSIS: netstat [address_family_options] [--tcp|-t] [--udp|-u] [--raw|-w] [--listening|-l] [--all|-a] [--numeric|-n] [--numeric-hosts] [--numeric-ports] [--numeric-users] [--symbolic|-N] [--extend|-e[--extend|-e]] [--timers|-o] [--program|-p] [-- verbose|-v] [--continuous|-c] netstat {--route|-r} [address_family_options] [--extend|-e[--extend|-e]] [--verbose|-v] [-- numeric|-n] [--numeric-hosts] [--numeric-ports] [--numeric-users] [--continuous|-c] netstat {--interfaces|-i} [--all|-a] [--extend|-e[--extend|-e]] [--verbose|-v] [--program|-p] [-- numeric|-n] [--numeric-hosts] [--numeric-ports] [--numeric- users] [--continuous|-c] netstat {--groups|-g} [--numeric|-n] [--numeric-hosts] [--numeric-ports] [--numeric-users] [-- continuous|-c] netstat {--masquerade|-M} [--extend|-e] [--numeric|-n] [--numeric-hosts] [--numeric-ports] [-- numeric-users] [--continuous|-c] netstat {--statistics|-s} [--tcp|-t] [--udp|-u] [--raw|-w] netstat {--version|-V} netstat {--help|-h}
  • 10. Computer Networks (CS C461 / IS C461) Assignments PART A DESCRIPTION: Netstat prints information about the Linux networking subsystem. Examples:  List All Ports (both listening and non listening ports : netstat -a (-u if for udp ports)  show statistics for all ports using netstat –s
  • 11. Computer Networks (CS C461 / IS C461) Assignments PART A  Display the kernel routing information using netstat –r  Show the list of network interfaces: netstat -i 9)ifup: NAME: ifup - bring a network interface up. SYNOPSIS: ifup [-nv] [--no-act] [--verbose] [-i FILE|--interfaces=FILE] [--allow CLASS] -a|IFACE... ifup -h|--help ifup -V|--version DESCRIPTION: The ifup and ifdown commands may be used to configure (or, respec‐ tively, deconfigure) network interfaces based on interface definitions in the file /etc/network/interfaces.
  • 12. Computer Networks (CS C461 / IS C461) Assignments PART A 10)ifdown: NAME: take a network interface down SYNOPSIS: ifdown [-nv] [--no-act] [--verbose] [-i FILE|--interfaces=FILE] [--allow CLASS] -a|IFACE... DESCRIPTION: The ifup and ifdown commands may be used to configure (or, respec‐ tively, deconfigure) network interfaces based on interface definitions in the file /etc/network/interfaces. Examples(ifup and ifdown examples are provided together):  sudo ifup lo/ sudo ifdown lo 11)iwconfig: NAME: iwconfig - configure a wireless network SYNOPSIS: iwconfig [interface] iwconfig interface [essid X] [nwid N] [mode M] [freq F] [channel C][sens S ][ap A ][nick NN ] [rate R] [rts RT] [frag FT] [txpower T] [enc E] [key K] [power P] [retry R] [modu M] [commit] iwconfig --help iwconfig –version
  • 13. Computer Networks (CS C461 / IS C461) Assignments PART A DESCRIPTION: Iwconfig is similar to ifconfig(8), but is dedicated to the wireless interfaces. It is used to set the parameters of the network interface which are specific to the wireless operation (for example : the fre‐ quency). Iwconfig may also be used to display those parameters, and the wireless statistics (extracted from /proc/net/wireless). All these parameters and statistics are device dependent. Each driver will provide only some of them depending on hardware support, and the range of values may change Examples:  iwconfig(output is given for both with and without wireless connections)
  • 14. Computer Networks (CS C461 / IS C461) Assignments PART A 12)iwspy: NAME: iwspy - Get wireless statistics from specific nodes. SYNOPSIS: iwspy [interface] iwspy interface [+] DNSNAME | IPADDR | HWADDR [...] iwspy interface off iwspy interface setthr low high iwspy interface getthr DESCRIPTION: Iwspy is used to set a list of addresses to monitor in a wireless net‐ work interface and to read back quality of link information for each of those. This information is the same as the one available in /proc/net/wireless : quality of the link, signal strength and noise level. This information is updated each time a new packet is received, so each address of the list adds some overhead in the driver. Note that this functionality works only for nodes part of the current wireless cell, you can not monitor Access Points you are not associated with (you can use Scanning for that) and nodes in other cells. In Man‐ aged mode, in most case packets are relayed by the Access Point, in this case you will get the signal strength of the Access Point. For those reasons this functionality is mostly useful in Ad-Hoc and Master mode. Examples:  sudo iwspy eth0 Output: aniket@ubuntu:~$ sudo iwspy eth0 eth0 Interface doesn't support wireless statistic collection
  • 15. Computer Networks (CS C461 / IS C461) Assignments PART A 13)iwlist: NAME: iwlist - Get more detailed wireless information from a wireless inter‐ Face. SYNOPSIS: iwlist [interface] scanning iwlist [interface] frequency iwlist [interface] rate iwlist [interface] keys iwlist [interface] power iwlist [interface] txpower iwlist [interface] retry iwlist [interface] event iwlist [interface] auth iwlist [interface] wpakeys iwlist [interface] genie iwlist [interface] modulation iwlist --help iwlist –version DESCRIPTION: Iwlist is used to display some additional information from a wireless network interface that is not displayed by iwconfig(8). The main argu‐ ment is used to select a category of information, iwlist displays in detailed form all information related to this category, including information already shown by iwconfig(8).
  • 16. Computer Networks (CS C461 / IS C461) Assignments PART A Examples:  iwlist wlan0 scan 14)tracepath: NAME: tracepath, tracepath6 - traces path to a network host discovering MTU along this path. SYNOPSIS: tracepath [-n] [-b] [-l pktlen] destination [port] DESCRIPTION: It traces path to destination discovering MTU along this path. It uses UDP port port or some random port. It is similar to traceroute, only does not require superuser privileges and has no fancy options. tracepath6 is good replacement for traceroute6 and classic example of application of Linux error queues. The situation with IPv4 is worse, because commercial IP routers do not return enough information in icmp error messages. Probably, it will change, when they will be updated. For now it uses Van Jacobson's trick, sweeping a range of UDP ports to maintain trace history.
  • 17. Computer Networks (CS C461 / IS C461) Assignments PART A Examples:  tracepath localhost  tracepath -b localhost(-b resolves ip address)  tracepath from localhost(of bits mail server)
  • 18. Computer Networks (CS C461 / IS C461) Assignments PART A 15)dhclient: NAME: dhclient - Dynamic Host Configuration Protocol Client. SYNOPSIS: dhclient [ -p port ] [ -d ] [ -e VAR=value ] [ -q ] [ -1 ] [ -r ] [ -x ] [ -lf lease-file ] [ -pf pid-file ] [ -cf config-file ] [ -sf script-file ] [ -s server ] [ -g relay ] [ -n ] [ -nw ] [ -w ] [ if0 [ ...ifN ] ] DESCRIPTION: The Internet Systems Consortium DHCP Client, dhclient, provides a means for configuring one or more network interfaces using the Dynamic Host Configuration Protocol, BOOTP protocol, or if these protocols fail, by statically assigning an address. Examples:  sudo dhclient eth0