SlideShare a Scribd company logo
Linux Networking Commands Copyright, 2002 Š NTM Consulting Inc. TCP/IP  Lecture Series Professor Tom Mavroidis
Commands Reviewed Ifconfig dmesg netstat ping route traceroute nslookup arp dig
ifconfig ifconfig  is used to assign an address to a network interface and/or configure network interface parameters.  ifconfig  must be used at boot time to define the network address of each interface present on a machine; it may also be used at a later time to redefine an interface's address or other operating parameters.
ifconfig eth0  eth0  Link encap:Ethernet  HWaddr 00:04:AC:16:54:4C  inet addr:192.168.2.1  Bcast:192.168.2.255  Mask:255.255.255.0 inet6 addr: fe80::204:acff:fe16:544c/10 Scope:Link UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1 RX packets:116242 errors:0 dropped:0 overruns:0 frame:0 TX packets:123380 errors:0 dropped:0 overruns:0 carrier:0 collisions:9052  RX bytes:39103579 (37.2 Mb)  TX bytes:106270739 (101.3 Mb)
When would you use ifconfig? To determine if an interface has been recognized and configured on a system  To initially assign an IP address to an interface to bring an interface up or down
What should you do if the interface isn’t found? This kind of problem usually appears on initial setup of a machine [root@localhost root]# ifconfig eth3 up eth3: unknown interface: No such device
See if the device has been found - use dmesg The command 'dmesg', which is used to print kernel messages, is very useful in determining if a piece of hardware has been found, and if so, what the system is referring to it as. Don’t forger to monitor the /var/log/messages file for any strange activity.  TIP  pipe the dmesg to the less command or the reply will scroll off the screen dmesg | less
Before you have a useable interface  Determine if you can ping the localhost ping localhost or ping 127.0.0.1
Does the localhost respond? [root@localhost root]# ping localhost PING localhost.localdomain (127.0.0.1) from 127.0.0.1 : 56(84) bytes of data. 64 bytes from localhost.localdomain (127.0.0.1): icmp_seq=0 ttl=255 time=1.968 msec 64 bytes from localhost.localdomain (127.0.0.1): icmp_seq=1 ttl=255 time=113 usec 64 bytes from localhost.localdomain (127.0.0.1): icmp_seq=2 ttl=255 time=178 usec 64 bytes from localhost.localdomain (127.0.0.1): icmp_seq=3 ttl=255 time=116 usec
Confirm you have set up the interface correctly. ping the address returned by the ifconfig command “Ping 192.168.2.1” eth0  Link encap:Ethernet  HWaddr 00:04:AC:16:54:4C  inet addr: 192.168.2.1   Bcast:192.168.2.255  Mask:255.255.255.0 inet6 addr: fe80::204:acff:fe16:544c/10 Scope:Link UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1 RX packets:116242 errors:0 dropped:0 overruns:0 frame:0 TX packets:123380 errors:0 dropped:0 overruns:0 carrier:0 collisions:9052  RX bytes:39103579 (37.2 Mb)  TX bytes:106270739 (101.3 Mb)
ping System administration command. Confirm that a remote host is online and responding.  ping  is intended for use in network testing, measurement, and management. Because of the load it can impose on the network, it is unwise to use  ping  during normal operations or from automated scripts.
route Gateways route data between networks All devices make routing decisions local network? Deliver to destination remote network? Forward to local gateway
route -n -n prevents route from converting IP addresses to hostnames the 0.0.0.0 entry is the default gateway  [root@localhost root]# route -n Kernel IP routing table Destination  Gateway  Genmask  Flags Metric Ref  Use Iface 192.168.2.0  0.0.0.0  255.255.255.0  U  0  0  0 eth0 192.168.1.0  0.0.0.0  255.255.255.0  U  0  0  0 eth1 127.0.0.0  0.0.0.0  255.0.0.0  U  0  0  0 lo 0.0.0.0  192.168.1.1  0.0.0.0  UG  0  0  0 eth1
route -Cn (display cache table) [root@localhost root]# route -Cn Kernel IP routing cache Source  Destination  Gateway  Flags Metric Ref  Use Iface 192.168.1.101  192.168.1.55  192.168.1.55  il  0  0  65 lo 192.168.2.1  192.168.2.75  192.168.2.75  0  1  0 eth0 192.168.1.55  192.175.48.42  192.168.1.1  0  0  0 eth1 192.168.1.55  192.168.1.101  192.168.1.101  0  0  1 eth1 192.168.1.55  192.168.1.101  192.168.1.101  0  1  0 eth1 127.0.0.1  127.0.0.1  127.0.0.1  l  0  0  3 lo 192.168.1.101  192.168.1.255  192.168.1.255  ibl  0  0  4 lo 127.0.0.1  127.0.0.1  127.0.0.1  l  0  0  1 lo
traceroute Trace route taken by packets to reach network host.  traceroute  attempts tracing by launching UDP probe packets with a small TTL (time to live), then listening for an ICMP "time exceeded" reply from a gateway.  host  is the destination hostname or the IP number of host to reach.  packetsize  is the packet size in bytes of the probe datagram. Default is 38 bytes. Note  Traceroute has lost some of  its effectiveness since most  ISP’s disallow it from  running on their networks
nslookup Query Internet domain name servers.  nslookup  has two modes: interactive and noninteractive. Interactive mode allows the user to query name servers for information about various hosts and domains or to print a list of hosts in a domain. It is entered either when no arguments are given (default name server will be used) or when the first argument is a hyphen and the second argument is the hostname or Internet address of a name server. Noninteractive mode is used to print just the name and requested information for a host or domain. It is used when the name of the host to be looked up is given as the first argument. Any of the  keyword = value  pairs listed under the interactive  set  command can be used as an option on the command line by prefacing the keyword with a -. The optional second argument specifies a name server.
arp Physical networks have their own addressing scheme IP addresses are used to direct a datagram to a specific physical network
arp table arp maintains a table of translations between IP addresses and ethernet addresses [root@localhost root]# arp Address  HWtype  HWaddress  Flags Mask  Iface 192.168.1.1  ether  00:04:5A:DB:A1:C5  C  eth1 192.168.2.75  ether  00:10:E0:04:61:84  C  eth0 192.168.1.101  ether  00:09:B7:13:AA:13  C  eth1
/etc/hosts Setting the hosts file will resolve names to addresses [root@localhost root]# less /etc/hosts # Do not remove the following line, or various programs # that require network functionality will fail. 127.0.0.1  localhost.localdomain  localhost 192.168.1.1  gatewayout.tcp-ip.ca 192.168.2.75  basement.tcp-ip.ca 192.168.1.101  just_a_node.tcp-ip.ca
arp -a will then resolve Instead of just names, you also get IP addresses [root@localhost root]# arp -a gatewayout.tcp-ip.ca (192.168.1.1) at 00:04:5A:DB:A1:C5 [ether] on eth1 basement.tcp-ip.ca (192.168.2.75) at 00:10:E0:04:61:84 [ether] on eth0 just_a_node.tcp-ip.ca (192.168.1.101) at 00:09:B7:13:AA:13 [ether] on eth1
netstat The netstat command symbolically displays the contents of various net- work-related data structures. There are a number of output formats, de- pending on the options for the information presented. The first form of the command displays a list of active sockets for each protocol. The second form presents the contents of one of the other network data struc- tures according to the option selected. Using the third form, with a wait interval specified, netstat will continuously display the informa- tion regarding packet traffic on the configured network interfaces. The fourth form displays statistics about the named protocol.
netstat -nr [root@localhost root]# netstat -nr Kernel IP routing table Destination  Gateway  Genmask  Flags  MSS Window  irtt Iface 192.168.2.0  0.0.0.0  255.255.255.0  U  40 0  0 eth0 192.168.1.0  0.0.0.0  255.255.255.0  U  40 0  0 eth1 127.0.0.0  0.0.0.0  255.0.0.0  U  40 0  0 lo 0.0.0.0  192.168.1.1  0.0.0.0  UG  40 0  0 eth1
dig - supercharged nslookup oroot@localhost root]# dig cs.senecac.on.ca ; <<>> DiG 9.1.3 <<>> cs.senecac.on.ca ;; global options:  printcmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 10483 ;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 6, ADDITIONAL: 4 ;; QUESTION SECTION: ;cs.senecac.on.ca.  IN  A ;; ANSWER SECTION: cs.senecac.on.ca.  86400  IN  A  142.204.57.48
dig - better than nslookup ;; AUTHORITY SECTION: senecac.on.ca.  86400  IN  NS  ns.onet.on.ca. senecac.on.ca.  86400  IN  NS  ns2.senecac.on.ca. senecac.on.ca.  86400  IN  NS  hades.senecac.on.ca. senecac.on.ca.  86400  IN  NS  ittads.senecac.on.ca. senecac.on.ca.  86400  IN  NS  pulsar.senecac.on.ca. senecac.on.ca.  86400  IN  NS  nsprime.senecac.on.ca. ;; ADDITIONAL SECTION: ns2.senecac.on.ca.  86400  IN  A  142.204.10.100 hades.senecac.on.ca.  86400  IN  A  142.204.57.15 ittads.senecac.on.ca.  86400  IN  A  142.204.6.57 pulsar.senecac.on.ca.  86400  IN  A  142.204.119.97 ;; Query time: 2202 msec ;; SERVER: 127.0.0.1#53(127.0.0.1) ;; WHEN: Sun Sep 29 16:38:20 2002 ;; MSG SIZE  rcvd: 238
References For detailed syntax on these and other linux commands look at  http://www. oreillynet .com/ linux / cmd /

More Related Content

What's hot (20)

PPTX
File permission in linux
Prakash Poudel
 
PPTX
Introduction to php
Taha Malampatti
 
PPTX
System calls
Bernard Senam
 
PPTX
Pipes and filters
bhatvijetha
 
PPT
Php Presentation
Manish Bothra
 
PDF
Shell scripting
Manav Prasad
 
PPTX
Filepermissions in linux
Subashini Pandiarajan
 
PPTX
IP tables and Filtering
Aisha Talat
 
PDF
Linux cheat-sheet
Zeeshan Rizvi
 
PPT
Sql ppt
Anuja Lad
 
PPT
Shell Scripting
Gaurav Shinde
 
PPT
Linux architecture
mcganesh
 
PDF
Putty
rajpreet
 
PPTX
Basic commands of linux
shravan saini
 
PPT
Linux presentation
Nikhil Jain
 
PPTX
Linux process management
Raghu nath
 
PPT
Secure shell ppt
sravya raju
 
PPT
Application layer protocols
JUW Jinnah University for Women
 
PPTX
Threads (operating System)
Prakhar Maurya
 
PPTX
Php with mysql ppt
Rajamanickam Gomathijayam
 
File permission in linux
Prakash Poudel
 
Introduction to php
Taha Malampatti
 
System calls
Bernard Senam
 
Pipes and filters
bhatvijetha
 
Php Presentation
Manish Bothra
 
Shell scripting
Manav Prasad
 
Filepermissions in linux
Subashini Pandiarajan
 
IP tables and Filtering
Aisha Talat
 
Linux cheat-sheet
Zeeshan Rizvi
 
Sql ppt
Anuja Lad
 
Shell Scripting
Gaurav Shinde
 
Linux architecture
mcganesh
 
Putty
rajpreet
 
Basic commands of linux
shravan saini
 
Linux presentation
Nikhil Jain
 
Linux process management
Raghu nath
 
Secure shell ppt
sravya raju
 
Application layer protocols
JUW Jinnah University for Women
 
Threads (operating System)
Prakhar Maurya
 
Php with mysql ppt
Rajamanickam Gomathijayam
 

Viewers also liked (19)

ODT
RHCE FINAL Questions and Answers
Radien software
 
PDF
Linux Network commands
Hanan Nmr
 
PDF
Top 100 Linux Interview Questions and Answers 2014
iimjobs and hirist
 
PDF
Redhat training &certification
Ahmed Abbas Ahmed
 
PPT
Red Hat Enterprise Linux 7
Mazenetsolution
 
PPTX
Red hat enterprise linux 7 (rhel 7)
Ramola Dhande
 
ODP
Introduction to Red Hat
Albert Wong
 
DOCX
Linux admin interview questions
Kavya Sri
 
PDF
Basic linux commands
Aniket Thakur
 
PPTX
Linux networking commands
Sayed Ahmed
 
PPTX
Network configuration
engshemachi
 
PDF
Linux Network Administration (LPI-1,LPI-2)
laonap166
 
PPT
Linux command ppt
kalyanineve
 
PPTX
Steps to Submit an Application at Passport Seva Kendra
passportindia
 
PPT
Unix command-line tools
Eric Wilson
 
PPT
How To Check The Indian Passport Status
Alfred Samuel
 
DOC
Ephata 614
Vu Mai JMV
 
PPTX
Dorchester
James Bauhs, CPIM, PMP
 
PDF
Renuncia de Felipe Bulnes - Agente Chileno en La Haya
Christian Pino Lanata
 
RHCE FINAL Questions and Answers
Radien software
 
Linux Network commands
Hanan Nmr
 
Top 100 Linux Interview Questions and Answers 2014
iimjobs and hirist
 
Redhat training &certification
Ahmed Abbas Ahmed
 
Red Hat Enterprise Linux 7
Mazenetsolution
 
Red hat enterprise linux 7 (rhel 7)
Ramola Dhande
 
Introduction to Red Hat
Albert Wong
 
Linux admin interview questions
Kavya Sri
 
Basic linux commands
Aniket Thakur
 
Linux networking commands
Sayed Ahmed
 
Network configuration
engshemachi
 
Linux Network Administration (LPI-1,LPI-2)
laonap166
 
Linux command ppt
kalyanineve
 
Steps to Submit an Application at Passport Seva Kendra
passportindia
 
Unix command-line tools
Eric Wilson
 
How To Check The Indian Passport Status
Alfred Samuel
 
Ephata 614
Vu Mai JMV
 
Renuncia de Felipe Bulnes - Agente Chileno en La Haya
Christian Pino Lanata
 
Ad

Similar to Linux Networking Commands (20)

PPT
dokumen.tips_linux-networking-commands.ppt
ThorOdinson55
 
PPTX
linux networking laboratory presentation .pptx
AnuradhaJadiya1
 
PPTX
Linux networking
Arie Bregman
 
PDF
Handy Networking Tools and How to Use Them
Sneha Inguva
 
PDF
Internet Technology (Practical Questions Paper) [CBSGS - 75:25 Pattern] {2013...
Mumbai B.Sc.IT Study
 
PPTX
Linux Commands
lucita cabral
 
PPTX
5 - Networking in Red Hat
Shafaan Khaliq Bhatti
 
PPTX
5-Networking-Red-Hat-Commands-slides.pptx
ChSheraz3
 
PDF
Linux network tools (Maarten Blomme)
Avansa Mid- en Zuidwest
 
PPTX
14 network tools
Shay Cohen
 
PPT
Networking session-4-final by aravind.R
Navaneethan Naveen
 
PDF
Linuxnetworkingcommands
Manikanta Pushadapu
 
PDF
packet traveling (pre cloud)
iman darabi
 
PDF
The ifconfig Command
Kevin OBrien
 
PPTX
Commands.pptx
ssuser39789f
 
RTF
Useful linux-commands
Himani Singh
 
DOCX
Useful Linux commands
Sukanta Pradhan
 
PPT
NW_Tools.ppt
jaba kumar
 
PDF
Course 102: Lecture 20: Networking In Linux (Basic Concepts)
Ahmed El-Arabawy
 
PDF
Boost your network troubleshooting skills with Top Usefeul IP Commands for wi...
priyanshamadhwal2
 
dokumen.tips_linux-networking-commands.ppt
ThorOdinson55
 
linux networking laboratory presentation .pptx
AnuradhaJadiya1
 
Linux networking
Arie Bregman
 
Handy Networking Tools and How to Use Them
Sneha Inguva
 
Internet Technology (Practical Questions Paper) [CBSGS - 75:25 Pattern] {2013...
Mumbai B.Sc.IT Study
 
Linux Commands
lucita cabral
 
5 - Networking in Red Hat
Shafaan Khaliq Bhatti
 
5-Networking-Red-Hat-Commands-slides.pptx
ChSheraz3
 
Linux network tools (Maarten Blomme)
Avansa Mid- en Zuidwest
 
14 network tools
Shay Cohen
 
Networking session-4-final by aravind.R
Navaneethan Naveen
 
Linuxnetworkingcommands
Manikanta Pushadapu
 
packet traveling (pre cloud)
iman darabi
 
The ifconfig Command
Kevin OBrien
 
Commands.pptx
ssuser39789f
 
Useful linux-commands
Himani Singh
 
Useful Linux commands
Sukanta Pradhan
 
NW_Tools.ppt
jaba kumar
 
Course 102: Lecture 20: Networking In Linux (Basic Concepts)
Ahmed El-Arabawy
 
Boost your network troubleshooting skills with Top Usefeul IP Commands for wi...
priyanshamadhwal2
 
Ad

More from tmavroidis (18)

PPT
What Is Tcp Ip
tmavroidis
 
PPT
Transport Layer
tmavroidis
 
PPT
Tcp Udp Icmp And The Transport Layer
tmavroidis
 
PPT
Splitting A Class C Network Into 4 Subnets
tmavroidis
 
PPT
Samba
tmavroidis
 
PPT
Physical And Data Link Layers
tmavroidis
 
PPT
Nfs
tmavroidis
 
PPT
Network Basics
tmavroidis
 
PPT
Nad710 Network Address Translation
tmavroidis
 
PPT
Nad710 Introduction To Networks Using Linux
tmavroidis
 
PPT
Manchester Encoding
tmavroidis
 
PPT
Ip Addressing Basics
tmavroidis
 
PPT
Introduction To Networks Using Linux
tmavroidis
 
PPT
Introduction To Networks
tmavroidis
 
PPT
Dynamic Routing
tmavroidis
 
PPT
Dns
tmavroidis
 
PPT
About Connection Types
tmavroidis
 
PPT
What Is A Carrier
tmavroidis
 
What Is Tcp Ip
tmavroidis
 
Transport Layer
tmavroidis
 
Tcp Udp Icmp And The Transport Layer
tmavroidis
 
Splitting A Class C Network Into 4 Subnets
tmavroidis
 
Samba
tmavroidis
 
Physical And Data Link Layers
tmavroidis
 
Nfs
tmavroidis
 
Network Basics
tmavroidis
 
Nad710 Network Address Translation
tmavroidis
 
Nad710 Introduction To Networks Using Linux
tmavroidis
 
Manchester Encoding
tmavroidis
 
Ip Addressing Basics
tmavroidis
 
Introduction To Networks Using Linux
tmavroidis
 
Introduction To Networks
tmavroidis
 
Dynamic Routing
tmavroidis
 
Dns
tmavroidis
 
About Connection Types
tmavroidis
 
What Is A Carrier
tmavroidis
 

Recently uploaded (20)

PDF
Python basic programing language for automation
DanialHabibi2
 
PPT
Interview paper part 3, It is based on Interview Prep
SoumyadeepGhosh39
 
PDF
NewMind AI - Journal 100 Insights After The 100th Issue
NewMind AI
 
PDF
SFWelly Summer 25 Release Highlights July 2025
Anna Loughnan Colquhoun
 
PPTX
Top iOS App Development Company in the USA for Innovative Apps
SynapseIndia
 
PDF
Achieving Consistent and Reliable AI Code Generation - Medusa AI
medusaaico
 
PDF
Transcript: New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
PDF
DevBcn - Building 10x Organizations Using Modern Productivity Metrics
Justin Reock
 
PPTX
✨Unleashing Collaboration: Salesforce Channels & Community Power in Patna!✨
SanjeetMishra29
 
PPTX
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
PDF
Windsurf Meetup Ottawa 2025-07-12 - Planning Mode at Reliza.pdf
Pavel Shukhman
 
PDF
HCIP-Data Center Facility Deployment V2.0 Training Material (Without Remarks ...
mcastillo49
 
PDF
Bitcoin for Millennials podcast with Bram, Power Laws of Bitcoin
Stephen Perrenod
 
PDF
Chris Elwell Woburn, MA - Passionate About IT Innovation
Chris Elwell Woburn, MA
 
PDF
Timothy Rottach - Ramp up on AI Use Cases, from Vector Search to AI Agents wi...
AWS Chicago
 
PDF
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
PDF
Blockchain Transactions Explained For Everyone
CIFDAQ
 
PDF
Fl Studio 24.2.2 Build 4597 Crack for Windows Free Download 2025
faizk77g
 
PDF
Jak MŚP w Europie Środkowo-Wschodniej odnajdują się w świecie AI
dominikamizerska1
 
PDF
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
Python basic programing language for automation
DanialHabibi2
 
Interview paper part 3, It is based on Interview Prep
SoumyadeepGhosh39
 
NewMind AI - Journal 100 Insights After The 100th Issue
NewMind AI
 
SFWelly Summer 25 Release Highlights July 2025
Anna Loughnan Colquhoun
 
Top iOS App Development Company in the USA for Innovative Apps
SynapseIndia
 
Achieving Consistent and Reliable AI Code Generation - Medusa AI
medusaaico
 
Transcript: New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
DevBcn - Building 10x Organizations Using Modern Productivity Metrics
Justin Reock
 
✨Unleashing Collaboration: Salesforce Channels & Community Power in Patna!✨
SanjeetMishra29
 
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
Windsurf Meetup Ottawa 2025-07-12 - Planning Mode at Reliza.pdf
Pavel Shukhman
 
HCIP-Data Center Facility Deployment V2.0 Training Material (Without Remarks ...
mcastillo49
 
Bitcoin for Millennials podcast with Bram, Power Laws of Bitcoin
Stephen Perrenod
 
Chris Elwell Woburn, MA - Passionate About IT Innovation
Chris Elwell Woburn, MA
 
Timothy Rottach - Ramp up on AI Use Cases, from Vector Search to AI Agents wi...
AWS Chicago
 
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
Blockchain Transactions Explained For Everyone
CIFDAQ
 
Fl Studio 24.2.2 Build 4597 Crack for Windows Free Download 2025
faizk77g
 
Jak MŚP w Europie Środkowo-Wschodniej odnajdują się w świecie AI
dominikamizerska1
 
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 

Linux Networking Commands

  • 1. Linux Networking Commands Copyright, 2002 Š NTM Consulting Inc. TCP/IP Lecture Series Professor Tom Mavroidis
  • 2. Commands Reviewed Ifconfig dmesg netstat ping route traceroute nslookup arp dig
  • 3. ifconfig ifconfig is used to assign an address to a network interface and/or configure network interface parameters. ifconfig must be used at boot time to define the network address of each interface present on a machine; it may also be used at a later time to redefine an interface's address or other operating parameters.
  • 4. ifconfig eth0 eth0 Link encap:Ethernet HWaddr 00:04:AC:16:54:4C inet addr:192.168.2.1 Bcast:192.168.2.255 Mask:255.255.255.0 inet6 addr: fe80::204:acff:fe16:544c/10 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:116242 errors:0 dropped:0 overruns:0 frame:0 TX packets:123380 errors:0 dropped:0 overruns:0 carrier:0 collisions:9052 RX bytes:39103579 (37.2 Mb) TX bytes:106270739 (101.3 Mb)
  • 5. When would you use ifconfig? To determine if an interface has been recognized and configured on a system To initially assign an IP address to an interface to bring an interface up or down
  • 6. What should you do if the interface isn’t found? This kind of problem usually appears on initial setup of a machine [root@localhost root]# ifconfig eth3 up eth3: unknown interface: No such device
  • 7. See if the device has been found - use dmesg The command 'dmesg', which is used to print kernel messages, is very useful in determining if a piece of hardware has been found, and if so, what the system is referring to it as. Don’t forger to monitor the /var/log/messages file for any strange activity. TIP pipe the dmesg to the less command or the reply will scroll off the screen dmesg | less
  • 8. Before you have a useable interface Determine if you can ping the localhost ping localhost or ping 127.0.0.1
  • 9. Does the localhost respond? [root@localhost root]# ping localhost PING localhost.localdomain (127.0.0.1) from 127.0.0.1 : 56(84) bytes of data. 64 bytes from localhost.localdomain (127.0.0.1): icmp_seq=0 ttl=255 time=1.968 msec 64 bytes from localhost.localdomain (127.0.0.1): icmp_seq=1 ttl=255 time=113 usec 64 bytes from localhost.localdomain (127.0.0.1): icmp_seq=2 ttl=255 time=178 usec 64 bytes from localhost.localdomain (127.0.0.1): icmp_seq=3 ttl=255 time=116 usec
  • 10. Confirm you have set up the interface correctly. ping the address returned by the ifconfig command “Ping 192.168.2.1” eth0 Link encap:Ethernet HWaddr 00:04:AC:16:54:4C inet addr: 192.168.2.1 Bcast:192.168.2.255 Mask:255.255.255.0 inet6 addr: fe80::204:acff:fe16:544c/10 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:116242 errors:0 dropped:0 overruns:0 frame:0 TX packets:123380 errors:0 dropped:0 overruns:0 carrier:0 collisions:9052 RX bytes:39103579 (37.2 Mb) TX bytes:106270739 (101.3 Mb)
  • 11. ping System administration command. Confirm that a remote host is online and responding. ping is intended for use in network testing, measurement, and management. Because of the load it can impose on the network, it is unwise to use ping during normal operations or from automated scripts.
  • 12. route Gateways route data between networks All devices make routing decisions local network? Deliver to destination remote network? Forward to local gateway
  • 13. route -n -n prevents route from converting IP addresses to hostnames the 0.0.0.0 entry is the default gateway [root@localhost root]# route -n Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 192.168.2.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0 192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1 127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 lo 0.0.0.0 192.168.1.1 0.0.0.0 UG 0 0 0 eth1
  • 14. route -Cn (display cache table) [root@localhost root]# route -Cn Kernel IP routing cache Source Destination Gateway Flags Metric Ref Use Iface 192.168.1.101 192.168.1.55 192.168.1.55 il 0 0 65 lo 192.168.2.1 192.168.2.75 192.168.2.75 0 1 0 eth0 192.168.1.55 192.175.48.42 192.168.1.1 0 0 0 eth1 192.168.1.55 192.168.1.101 192.168.1.101 0 0 1 eth1 192.168.1.55 192.168.1.101 192.168.1.101 0 1 0 eth1 127.0.0.1 127.0.0.1 127.0.0.1 l 0 0 3 lo 192.168.1.101 192.168.1.255 192.168.1.255 ibl 0 0 4 lo 127.0.0.1 127.0.0.1 127.0.0.1 l 0 0 1 lo
  • 15. traceroute Trace route taken by packets to reach network host. traceroute attempts tracing by launching UDP probe packets with a small TTL (time to live), then listening for an ICMP &quot;time exceeded&quot; reply from a gateway. host is the destination hostname or the IP number of host to reach. packetsize is the packet size in bytes of the probe datagram. Default is 38 bytes. Note Traceroute has lost some of its effectiveness since most ISP’s disallow it from running on their networks
  • 16. nslookup Query Internet domain name servers. nslookup has two modes: interactive and noninteractive. Interactive mode allows the user to query name servers for information about various hosts and domains or to print a list of hosts in a domain. It is entered either when no arguments are given (default name server will be used) or when the first argument is a hyphen and the second argument is the hostname or Internet address of a name server. Noninteractive mode is used to print just the name and requested information for a host or domain. It is used when the name of the host to be looked up is given as the first argument. Any of the keyword = value pairs listed under the interactive set command can be used as an option on the command line by prefacing the keyword with a -. The optional second argument specifies a name server.
  • 17. arp Physical networks have their own addressing scheme IP addresses are used to direct a datagram to a specific physical network
  • 18. arp table arp maintains a table of translations between IP addresses and ethernet addresses [root@localhost root]# arp Address HWtype HWaddress Flags Mask Iface 192.168.1.1 ether 00:04:5A:DB:A1:C5 C eth1 192.168.2.75 ether 00:10:E0:04:61:84 C eth0 192.168.1.101 ether 00:09:B7:13:AA:13 C eth1
  • 19. /etc/hosts Setting the hosts file will resolve names to addresses [root@localhost root]# less /etc/hosts # Do not remove the following line, or various programs # that require network functionality will fail. 127.0.0.1 localhost.localdomain localhost 192.168.1.1 gatewayout.tcp-ip.ca 192.168.2.75 basement.tcp-ip.ca 192.168.1.101 just_a_node.tcp-ip.ca
  • 20. arp -a will then resolve Instead of just names, you also get IP addresses [root@localhost root]# arp -a gatewayout.tcp-ip.ca (192.168.1.1) at 00:04:5A:DB:A1:C5 [ether] on eth1 basement.tcp-ip.ca (192.168.2.75) at 00:10:E0:04:61:84 [ether] on eth0 just_a_node.tcp-ip.ca (192.168.1.101) at 00:09:B7:13:AA:13 [ether] on eth1
  • 21. netstat The netstat command symbolically displays the contents of various net- work-related data structures. There are a number of output formats, de- pending on the options for the information presented. The first form of the command displays a list of active sockets for each protocol. The second form presents the contents of one of the other network data struc- tures according to the option selected. Using the third form, with a wait interval specified, netstat will continuously display the informa- tion regarding packet traffic on the configured network interfaces. The fourth form displays statistics about the named protocol.
  • 22. netstat -nr [root@localhost root]# netstat -nr Kernel IP routing table Destination Gateway Genmask Flags MSS Window irtt Iface 192.168.2.0 0.0.0.0 255.255.255.0 U 40 0 0 eth0 192.168.1.0 0.0.0.0 255.255.255.0 U 40 0 0 eth1 127.0.0.0 0.0.0.0 255.0.0.0 U 40 0 0 lo 0.0.0.0 192.168.1.1 0.0.0.0 UG 40 0 0 eth1
  • 23. dig - supercharged nslookup oroot@localhost root]# dig cs.senecac.on.ca ; <<>> DiG 9.1.3 <<>> cs.senecac.on.ca ;; global options: printcmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 10483 ;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 6, ADDITIONAL: 4 ;; QUESTION SECTION: ;cs.senecac.on.ca. IN A ;; ANSWER SECTION: cs.senecac.on.ca. 86400 IN A 142.204.57.48
  • 24. dig - better than nslookup ;; AUTHORITY SECTION: senecac.on.ca. 86400 IN NS ns.onet.on.ca. senecac.on.ca. 86400 IN NS ns2.senecac.on.ca. senecac.on.ca. 86400 IN NS hades.senecac.on.ca. senecac.on.ca. 86400 IN NS ittads.senecac.on.ca. senecac.on.ca. 86400 IN NS pulsar.senecac.on.ca. senecac.on.ca. 86400 IN NS nsprime.senecac.on.ca. ;; ADDITIONAL SECTION: ns2.senecac.on.ca. 86400 IN A 142.204.10.100 hades.senecac.on.ca. 86400 IN A 142.204.57.15 ittads.senecac.on.ca. 86400 IN A 142.204.6.57 pulsar.senecac.on.ca. 86400 IN A 142.204.119.97 ;; Query time: 2202 msec ;; SERVER: 127.0.0.1#53(127.0.0.1) ;; WHEN: Sun Sep 29 16:38:20 2002 ;; MSG SIZE rcvd: 238
  • 25. References For detailed syntax on these and other linux commands look at http://www. oreillynet .com/ linux / cmd /