Useful Linux Networking Commands – Part 1

 Networking  Comments Off on Useful Linux Networking Commands – Part 1
Jan 062013
 

Someone recently asked me what some of the more useful linux networking commands are and what some of the implementations are. Here is a compiled list for some of those commands:

(click continue reading below first before using the links… long page is long)
 
1. netstat
2. ping
3. traceroute
4. mtr
5. whois
6. finger
7. iptables
8. host
9. nslookup
10. ss
11. route

In my next post, I will be going over 10 more useful linux networking commands. I will be touching on:
ifconfig, iwconfig, ethtool, arp, tcpdump, tracepath, nmap, telnet and dig

Continue reading »

 Posted by at 12:25 pm

clearing the arp cache in linux

 Networking  Comments Off on clearing the arp cache in linux
Jan 242012
 

You can clear the arp cache using following commands:

Current arp cache
[email protected] [~]# arp -n
Address HWtype HWaddress Flags Mask Iface
70.167.140.1 ether 00:00:0C:9F:F0:04 C eth0

 
Clearing arp cache with verbose
[email protected] [~]# ip -s -s neigh flush all
70.167.140.1 dev eth0 lladdr 00:00:0c:9f:f0:04 ref 42 used 17/0/65 REACHABLE
*** Round 1, deleting 1 entries ***
70.167.140.1 dev eth0 ref 42 used 0/0/0 INCOMPLETE
*** Round 2, deleting 1 entries ***
*** Flush is complete after 2 rounds ***

 
Current entries
[email protected] [~]# arp -n
Address HWtype HWaddress Flags Mask Iface
69.167.140.1 ether 00:00:0C:9F:F0:04 C eth0

You can also delete specific arp entries using the two following command
[email protected] [~]# arp -d 192.168.1.1
[email protected] [~]# arp -d 192.168.1.2

 
Add a static arp entry

[email protected] [~]# arp -s 192.168.1.10 00:00:93:12:04:57

tested on CentOS release 5.7 (Final)

 Posted by at 3:26 pm