SlideShare a Scribd company logo
1 of 18
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

What's hot

Resource scheduling algorithm
Resource scheduling algorithmResource scheduling algorithm
Resource scheduling algorithm
Shilpa Damor
 
Cluster based routing protocol
Cluster based routing protocolCluster based routing protocol
Cluster based routing protocol
Sudhansu Dash
 
Localization in WSN
Localization in WSNLocalization in WSN
Localization in WSN
Yara Ali
 

What's hot (20)

Global state routing
Global state routingGlobal state routing
Global state routing
 
Networking in cloud computing
Networking in cloud computingNetworking in cloud computing
Networking in cloud computing
 
Grid computing notes
Grid computing notesGrid computing notes
Grid computing notes
 
Encryption techniques
Encryption techniques Encryption techniques
Encryption techniques
 
MapReduce in Cloud Computing
MapReduce in Cloud ComputingMapReduce in Cloud Computing
MapReduce in Cloud Computing
 
Application Virtualization presentation
Application Virtualization presentationApplication Virtualization presentation
Application Virtualization presentation
 
Distributed information system
Distributed information systemDistributed information system
Distributed information system
 
Resource scheduling algorithm
Resource scheduling algorithmResource scheduling algorithm
Resource scheduling algorithm
 
Distance Vector Multicast Routing Protocol (DVMRP) : Presentation
Distance Vector Multicast Routing Protocol (DVMRP) : PresentationDistance Vector Multicast Routing Protocol (DVMRP) : Presentation
Distance Vector Multicast Routing Protocol (DVMRP) : Presentation
 
Security Design Principles.ppt
 Security Design Principles.ppt Security Design Principles.ppt
Security Design Principles.ppt
 
Cluster based routing protocol
Cluster based routing protocolCluster based routing protocol
Cluster based routing protocol
 
Data aggregation in wireless sensor network
Data aggregation in wireless sensor networkData aggregation in wireless sensor network
Data aggregation in wireless sensor network
 
Massive parallel processing database systems mpp
Massive parallel processing database systems mppMassive parallel processing database systems mpp
Massive parallel processing database systems mpp
 
Ip Spoofing
Ip SpoofingIp Spoofing
Ip Spoofing
 
Localization in WSN
Localization in WSNLocalization in WSN
Localization in WSN
 
On-Demand Multicast Routing Protocol
On-Demand Multicast Routing ProtocolOn-Demand Multicast Routing Protocol
On-Demand Multicast Routing Protocol
 
DNS spoofing/poisoning Attack
DNS spoofing/poisoning AttackDNS spoofing/poisoning Attack
DNS spoofing/poisoning Attack
 
iptv over ngn
iptv over ngniptv over ngn
iptv over ngn
 
CLOUD COMPUTING BY SIVASANKARI
CLOUD COMPUTING BY SIVASANKARICLOUD COMPUTING BY SIVASANKARI
CLOUD COMPUTING BY SIVASANKARI
 
Network security and viruses
Network security and virusesNetwork security and viruses
Network security and viruses
 

Similar to Basic linux commands

Arp Dan Ipconfig Syntax
Arp Dan Ipconfig  SyntaxArp Dan Ipconfig  Syntax
Arp Dan Ipconfig Syntax
guestcc37e8c
 
Introduction to tcpdump
Introduction to tcpdumpIntroduction to tcpdump
Introduction to tcpdump
Lev Walkin
 
Lession3 Routing
Lession3 RoutingLession3 Routing
Lession3 Routing
leminhvuong
 
11 module configuring novell ipx
11  module configuring novell ipx11  module configuring novell ipx
11 module configuring novell ipx
Asif
 
Ciso 4 ospf
Ciso 4 ospfCiso 4 ospf
Ciso 4 ospf
myciokas
 

Similar to Basic linux commands (20)

Arp Dan Ipconfig Syntax
Arp Dan Ipconfig  SyntaxArp Dan Ipconfig  Syntax
Arp Dan Ipconfig Syntax
 
CN 1.docx
CN 1.docxCN 1.docx
CN 1.docx
 
nwlab-ex1.pdf
nwlab-ex1.pdfnwlab-ex1.pdf
nwlab-ex1.pdf
 
Introduction to tcpdump
Introduction to tcpdumpIntroduction to tcpdump
Introduction to tcpdump
 
Computer networks
Computer networksComputer networks
Computer networks
 
Tcpdump
TcpdumpTcpdump
Tcpdump
 
Routing
RoutingRouting
Routing
 
Lession3 Routing
Lession3 RoutingLession3 Routing
Lession3 Routing
 
Command.pptx presentation
Command.pptx presentationCommand.pptx presentation
Command.pptx presentation
 
11 module configuring novell ipx
11  module configuring novell ipx11  module configuring novell ipx
11 module configuring novell ipx
 
Ns2 introduction 2
Ns2 introduction 2Ns2 introduction 2
Ns2 introduction 2
 
8c21da14 1c9c-44ee-8e24-9a1ddd64ca82-150211062639-conversion-gate02
8c21da14 1c9c-44ee-8e24-9a1ddd64ca82-150211062639-conversion-gate028c21da14 1c9c-44ee-8e24-9a1ddd64ca82-150211062639-conversion-gate02
8c21da14 1c9c-44ee-8e24-9a1ddd64ca82-150211062639-conversion-gate02
 
Netcat
NetcatNetcat
Netcat
 
5 - Networking in Red Hat
5 - Networking in Red Hat5 - Networking in Red Hat
5 - Networking in Red Hat
 
Ccna Imp Guide
Ccna Imp GuideCcna Imp Guide
Ccna Imp Guide
 
DEF CON 27 - workshop - HUGO TROVAO and RUSHIKESH NADEDKAR - scapy dojo v1
DEF CON 27 - workshop - HUGO TROVAO and RUSHIKESH NADEDKAR - scapy dojo v1DEF CON 27 - workshop - HUGO TROVAO and RUSHIKESH NADEDKAR - scapy dojo v1
DEF CON 27 - workshop - HUGO TROVAO and RUSHIKESH NADEDKAR - scapy dojo v1
 
Ciso 4 ospf
Ciso 4 ospfCiso 4 ospf
Ciso 4 ospf
 
Linux networking
Linux networkingLinux networking
Linux networking
 
Cisco asa firewall command line technical guide
Cisco asa firewall command line technical guideCisco asa firewall command line technical guide
Cisco asa firewall command line technical guide
 
Tcpdump
TcpdumpTcpdump
Tcpdump
 

Recently uploaded

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Recently uploaded (20)

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 

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 your_username@remotehost.edu:/some/remote/directory  scp your_username@remotehost.edu: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