33

Linux Network commands

Embed Size (px)

DESCRIPTION

Basic Network Commands Over Linux platfrom.. By: Nadine Shorbaji Hanan Nimer

Citation preview

Page 1: Linux Network commands
Page 2: Linux Network commands

My ConnectionMy Connection

Page 3: Linux Network commands

Network Configuration..Network Configuration..

Page 4: Linux Network commands
Page 5: Linux Network commands

$ smbtree$ smbtree

Page 6: Linux Network commands

Think about it for a second !!!! Think about it for a second !!!!

Why single physical interface Why single physical interface should be limited to single IP should be limited to single IP

address?? address??

Page 7: Linux Network commands

ifconfig eth0 <ip> netmask 10.248.255.0 upifconfig eth0 <ip> netmask 10.248.255.0 up

sudo route add default gw 10.1.1.2sudo route add default gw 10.1.1.2

Page 8: Linux Network commands

Test Connection..Test Connection..

user@computer-name:~$ ping www.google.comuser@computer-name:~$ ping www.google.comPING www.l.google.com (66.102.13.106) 56(84) bytes of dataPING www.l.google.com (66.102.13.106) 56(84) bytes of data..

Page 9: Linux Network commands

DNS Tools..DNS Tools..

Page 10: Linux Network commands

host:used to map names to IP add.host:used to map names to IP add.

$ host www.google.com$ host www.google.com www.google.com is an alias for www.l.google.com.www.google.com is an alias for www.l.google.com. www.l.google.com has address 66.102.13.104www.l.google.com has address 66.102.13.104

Page 11: Linux Network commands

nslookup

nslookup 66.102.13.103nslookup 66.102.13.103

Page 12: Linux Network commands

$ whois 66.102.13.103

Page 13: Linux Network commands

$ traceroute www.amazoon.com$ traceroute www.amazoon.com

How many hops until some destination?How many hops until some destination?

Page 14: Linux Network commands

Netstat : List listening sockets ,

associated port# and process.

netstat -l -p -nnetstat --tcpnetstat --udpnetstat -inetstat -s

Page 15: Linux Network commands

ethtool:ethtool:What driver is responsible for What driver is responsible for

certain network interfacecertain network interface

$ ethtool -i <interface>$ ethtool -i <interface>

$ ethtool <interface>$ ethtool <interface>

Page 16: Linux Network commands

finger: to contact the necessary server and retrieve info. about user.

finger Email || usernamefinger Email || username

Page 17: Linux Network commands

Arp - Route

$ route -v$ route -v

$ arp $ arp

Show routing information

List ARP table (MAC-IP)

Page 18: Linux Network commands

Security Tools

Page 19: Linux Network commands

FireWall..FireWall..

sudo ufw enablesudo ufw enable disabledisable

Page 20: Linux Network commands

Nmap:

sudo nmap 192.168.1.1-255 sudo nmap 192.168.1.1-255

nmap localhostnmap localhost

Page 21: Linux Network commands

Netcat : The network Swiss army knife

$ nc -v -w1 localhost -z From-ToPort $ nc -v -w1 localhost -z From-ToPort

Page 22: Linux Network commands

tcpdump : a packet sniffertcpdump : a packet sniffer

$ tcpdump -i eth0$ tcpdump -i eth0

Page 23: Linux Network commands

$ tcpdump -w file -i eth0$ tcpdump -w file -i eth0

$ tcpdump -tttt -r file$ tcpdump -tttt -r file

$ tcpdump -n -i eth0$ tcpdump -n -i eth0

$ tcpdump -i eth0 arp$ tcpdump -i eth0 arp

$ tcpdump -i eth0 port 22$ tcpdump -i eth0 port 22

Capture packets > file

from particular port

packets of protocol type

Capture packets with IPs

Read sniffing data

Page 24: Linux Network commands

Browsers from Terminal!!

lynx www.google.com

lynx www.facebook.com

Page 25: Linux Network commands

wget www.google.com

Page 26: Linux Network commands

Talk (MultiUser)

talktalk

wallwall

writewrite

Page 27: Linux Network commands

Telnet vs SSHTelnet vs SSH

Page 28: Linux Network commands
Page 29: Linux Network commands

$ ufw allow 23

$ telnet localhost

sudo apt-get install telnetd

Just try to ping it.. then telnet it

Telnet Telnet

Page 30: Linux Network commands

SSHSecure Shell, a network protocol for remote

administration of Unix computers

$ sudo apt-get install openssh-server

$ ufw allow 22

$ nmap localhost

$ ssh user@pc-name

Page 31: Linux Network commands

PuTTY

An open source telnet and SSH Client for Windows ..

Page 32: Linux Network commands

Send messages between 2 Ubuntu PCs

ssh <user name>@<ip address>

export DISPLAY=:0.0notify-send "Title” "message text"

Page 33: Linux Network commands

References:

1.http://www.alexonlinux.com/useful-linux-networking-commands2.http://www.alexonlinux.com/tcpdump-for-dummies

3.http://www.karakas-online.de/gnu-linux-tools-summary/network-commands.html

4.http://www.linuxplanet.com/linuxplanet/tutorials/7044/1/5.http://aalagha.com/blog/2008/01/22/netcat-swiss-army-knife

6.http://www.dd-wrt.com/wiki/index.php/SSH7.http://www.slideshare.net/tmavroidis/linuxnetworkingcommands

8. http://sectools.org/9.http://askubuntu.com/questions/31582/send-messages-between

-2-ubuntu-pcs-net-send-style10.http://ubuntuforums.org/showthread.php?t=100198

11.http://linux.about.com/od/commands/l/blcmdl1_talk.htm12.http://forum.codecall.net/linux-networking/index3.html