Linux Network commands
description
Transcript of Linux Network commands
My ConnectionMy Connection
Network Configuration..Network Configuration..
$ smbtree$ smbtree
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??
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
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..
DNS Tools..DNS Tools..
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
nslookup
nslookup 66.102.13.103nslookup 66.102.13.103
$ whois 66.102.13.103
$ traceroute www.amazoon.com$ traceroute www.amazoon.com
How many hops until some destination?How many hops until some destination?
Netstat : List listening sockets ,
associated port# and process.
netstat -l -p -nnetstat --tcpnetstat --udpnetstat -inetstat -s
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>
finger: to contact the necessary server and retrieve info. about user.
finger Email || usernamefinger Email || username
Arp - Route
$ route -v$ route -v
$ arp $ arp
Show routing information
List ARP table (MAC-IP)
Security Tools
FireWall..FireWall..
sudo ufw enablesudo ufw enable disabledisable
Nmap:
sudo nmap 192.168.1.1-255 sudo nmap 192.168.1.1-255
nmap localhostnmap localhost
Netcat : The network Swiss army knife
$ nc -v -w1 localhost -z From-ToPort $ nc -v -w1 localhost -z From-ToPort
tcpdump : a packet sniffertcpdump : a packet sniffer
$ tcpdump -i eth0$ tcpdump -i eth0
$ 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
Browsers from Terminal!!
lynx www.google.com
lynx www.facebook.com
wget www.google.com
Talk (MultiUser)
talktalk
wallwall
writewrite
Telnet vs SSHTelnet vs SSH
$ ufw allow 23
$ telnet localhost
sudo apt-get install telnetd
Just try to ping it.. then telnet it
Telnet Telnet
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
PuTTY
An open source telnet and SSH Client for Windows ..
Send messages between 2 Ubuntu PCs
ssh <user name>@<ip address>
export DISPLAY=:0.0notify-send "Title” "message text"
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