somenetworkcommands
no way to compare when less than two revisions
Differences
This shows you the differences between two versions of the page.
— | somenetworkcommands [2013/01/28 04:29] (current) – created - external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | | | ||
+ | ^ NETWORK COMMAND BASICS** | This category contains the most basic network commands available on Linux platform. | | ||
+ | |**w** | Shows who is currently logged in and where they are logged in from. | | ||
+ | |**who** | This also shows who is on the server in an shell. | | ||
+ | |**netstat** | Shows all current network connections. | | ||
+ | |**netstat -an** | Shows all connections to the server, the source and destination ips and ports. | | ||
+ | |**netstat -rn** | Shows routing table for all ips bound to the server. | | ||
+ | |**netstat -an | grep :80 | wc -l** | Show how many active connections there are to apache (httpd runs on port 80) | | ||
+ | |**top** | Shows live system processes in a formatted table, memory information, | ||
+ | |**top -u root** | Show processes running by user root only. | | ||
+ | |**route -n** | Shows routing table for all ips bound to the server. | | ||
+ | |**route add default gw****// | ||
+ | |**nslookup _yahoo.com_** | Query your default domain name server (DNS) for an Internet name (or IP number) host_to_find. | | ||
+ | |**traceroute _yahoo.com_** | Have a look how you messages travel to yahoo.com | | ||
+ | |**tracepath****// | ||
+ | |**ifconfig** | Display info on the network interfaces. | | ||
+ | |**ifconfig -a** | Display into on all network interfaces on server, active or inactive.. | | ||
+ | |**ifconfig eth0 down** | This will take eth0 (assuming the device exists) down, it won't be able to receive or send anything until you put the device back &# | ||
+ | |**ifconfig eth0 up** | You guessed it. This would take eth0 up and available to receive or send packets. | | ||
+ | |**/ | ||
+ | |**ifup eth0** | Will bring eth0 up if it is currently down. | | ||
+ | |**ifdown eth0** | Will bring eth0 down if it is currently up. | | ||
+ | |**ifcfg** | Use**ifcfg** to configure a particular interface. Simply type ifcfg to get help on using this script. | | ||
+ | |**ifcfg eth0 del 192.168.0.1** | This command takes eth0 down and removes the assigned IP 192.168.0.1 | | ||
+ | |**ifcfg eth0 add 192.168.0.2** | This command brings eth0 up and assigns the new IP 192.168.0.2 | | ||
+ | |**ping** | Sends test packets to a specified server to check if it is responding properly | | ||
+ | |**ping****// | ||
+ | |**mii-tool** | Checks what your duplex settings are. | | ||
+ | |**arp** | Command mostly used for checking existing Ethernet connectivity and IP address | | ||
+ | |**hostname** | Tells the user the host name of the computer they are logged into. | | ||
+ | |**findsmb** | Used to list info about machines that respond to SMB name queries.****// | ||
+ | |**host****// | ||
+ | |**dig****// | ||
+ | |**dig -x _66.94.234.13_** | Looks up the address and returns the associated domain name.**dig** takes a huge number of options (at the point of being too many), refer to the manual page for more information. | | ||
+ | |**whois** | Used to look up the contact information from the &# | ||
+ | |**ftp** | File transfer protocol. Transfers files to another host (insecure) | | ||
+ | |**rdesktop** | Display remote desktop on Linux Machine. You can use to connect to Windows. | | ||
+ | ^ ADVANCED NETWORK TIPS** | All the remote network administration related tools and techniques available on Linux platform. | | ||
+ | |**ssh** | Secure shell, an alternative but secure to telnet/rsh and all the non-secure methods of logging in to remote servers. All connections get encrypted. | | ||
+ | |**ssh username@hostname** | Connect to a remote server by specifying your username and hostname you're logging into. | | ||
+ | |**scp & | ||
+ | |**scp -r jose@remote1:/ | ||
+ | |**scp remote:/ | ||
+ | |**sftp** | Secure ftp, another part of the ssh package. This command is similar to ftp but uses an encrypted tunnel to connect to an ftp server and is therefore more secure than just plain ftp. | | ||
+ | |**rsync** | An open source utility that provides fast incremental file transfer. Can be transferred via ssh. | | ||
+ | |**rsync -av -e ssh remote@server:/ | ||
+ | |**tcpdump** | <p />Print all the network traffic going through the network. Do a 'man tcpdump' | ||
+ | |**tcpdump -v** | Display the verbose output | | ||
+ | |**tcpdump -D** | Display network interfaces available for the capture | | ||
+ | |**tcpdump -n** | Display numerical addresses rather than symbolic (DNS) addresses | | ||
+ | |**tcpdump -i eth0** | Capture the traffic of eth0 interface | | ||
+ | |**tcpdump udp** | Capture the UDP traffic | | ||
+ | |**tcpdump -w capture.log** | Send the capture output in a file instead of directly on the screen | | ||
+ | |**tcpdump -r capture.log** | Read a capture file | | ||
+ | |**tcpdump port http** | Capture the TCP port 80 traffic | | ||
+ | |**tcpdump -i eth0 host 66.94.234.13** | Listen to all traffic on interface eth0 going to 66.94.234.13. This troubleshooting technique can determine why a web connection is not reaching yahoo.com (66.94.234.13). | | ||
+ | |**tcpdump host www.yahoo.com** | Display the packets having " | ||
+ | |**tcpdump src 192.168.1.2 and dst 192.168.1.3 and port ftp** | Display the FTP packets coming from 192.168.1.2 to 192.168.1.3 | | ||
+ | |**nmap** | A very advanced network tool used to query machines (local or remote) as to whether they are up and what ports are open on these machines. Download it from _insecure.org// | ||
+ | |**nmap _host_name_** | This would query _host_name// | ||
+ | |**nc** | Netcat. A networking utility which reads and writes data across network connections, | ||
+ | |**wget** | (GNU Web get) used to download files from the World Wide Web. To archive a single web-site.< | ||
+ | -m or --mirror --> To archive a single website. <br />\ | ||
+ | -nc --> no clobber option to stop wget from overwriting a file if you already have it. <br />\ | ||
+ | -c or --continue --> Continue a file that was unfinished by wget or another program.< | ||
+ | Wget has a large list of options. Please check the manual pages for more details. | | ||
+ | |**wget !http:// | ||
+ | |**curl** | Another remote downloader similar to wget. This remote downloader is designed to work without user interaction and supports a variety of protocols, can upload/ | ||
+ | |**curl -M** | To access the full manual. There are too many options and variations for examples. Please refer to manual for in depth examples and techniques. | | ||
+ | |**curl -u username: | ||
+ | ^ Apache Shell Commands** | Some of the basic and helpful apache commands. | | ||
+ | |**httpd -v** | Outputs the build date and version of the Apache server. | | ||
+ | |**httpd -l** | Lists compiled in Apache modules | | ||
+ | |**httpd status** | Only works if mod_status is enabled and shows a page of active connections | | ||
+ | |**service httpd restart** | Restarted Apache web server | | ||
+ | |**ab -n 100 -c 5 !http:// | ||
+ | ^ NETWORK CONFIGURATION FILES** | All the network related configuration files on a Linux platform. | | ||
+ | |**/etc** | This directory contains most of the basic Linux system-configuration Files. | | ||
+ | |**/ | ||
+ | |**/ | ||
+ | |**/ | ||
+ | |**/ | ||
+ | |**/ | ||
+ | |**/ | ||
+ | |**/ | ||
+ | |**/ | ||
+ | |**/var** | Contains variable data like system logging files, mail and printer spool directories, | ||
+ | |**/ | ||
+ | |**/ | ||
+ | |**/ | ||
+ | |**/ | ||
+ | ^ Network Open Source Network Utilities** | Some of the most useful network tools available for Linux. | | ||
+ | |**[[http:// | ||
+ | |**[[http:// | ||
+ | |**[[http:// | ||
+ | |**[[http:// | ||
+ | |**[[http:// | ||
+ | |**[[http:// | ||
+ | |**[[http:// | ||
+ | |**[[http:// | ||
+ | |**[[http:// | ||
+ | |**[[http:// | ||
+ | |||
+ | -- FredPettis - 26 Mar 2009 | ||
somenetworkcommands.txt · Last modified: 2013/01/28 04:29 by 127.0.0.1