Top 30 Nmap Commands

The purpose of this post is to introduce a user to the nmap command line tool to scan a host and/or network, so to find out the possible vulnerable points in the hosts. You will also learn how to use Nmap for offensive and defensive purposes.

nmap in action
More about nmap

From the man page:

Nmap (“Network Mapper”) is an open source tool for network exploration and security auditing. It was designed to rapidly scan large networks, although it works fine against single hosts. Nmap uses raw IP packets in novel ways to determine what hosts are available on the network, what services (application name and version) those hosts are offering, what operating systems (and OS versions) they are running, what type of packet filters/firewalls are in use, and dozens of other characteristics. While Nmap is commonly used for security audits, many systems and network administrators find it useful for routine tasks such as network inventory, managing service upgrade schedules, and monitoring host or service uptime.

It was originally written by Gordon Lyon and it can answer the following questions easily:

What computers did you find running on the local network?
What IP addresses did you find running on the local network?
What is the operating system of your target machine?
Find out what ports are open on the machine that you just scanned?
Find out if the system is infected with malware or virus.
Search for unauthorized servers or network service on your network.
Find and remove computers which don’t meet the organization’s minimum level of security.
Sample setup (LAB)

Port scanning may be illegal in some jurisdictions. So setup a lab as follows:

+———+
+———+ | Network | +——–+
| server1 |———–+ swtich +———|server2 |
+———+ | (sw0) | +——–+
+—-+—-+
|
|
+———+———-+
| wks01 Linux/OSX |
+——————–+
Where,

wks01 is your computer either running Linux/OS X or Unix like operating system. It is used for scanning your local network. The nmap command must be installed on this computer.
server1 can be powered by Linux / Unix / MS-Windows operating systems. This is an unpatched server. Feel free to install a few services such as a web-server, file server and so on.
server2 can be powered by Linux / Unix / MS-Windows operating systems. This is a fully patched server with firewall. Again, feel free to install few services such as a web-server, file server and so on.
All three systems are connected via switch.
How do I install nmap?

See:

Debian / Ubuntu Linux: Install nmap Software For Scanning Network
CentOS / RHEL: Install nmap Network Security Scanner
OpenBSD: Install nmap Network Security Scanner
#1: Scan a single host or an IP address (IPv4)

### Scan a single ip address ###
nmap 192.168.1.1

## Scan a host name ###
nmap server1.cyberciti.biz

## Scan a host name with more info###
nmap -v server1.cyberciti.biz

Sample outputs:

Fig.01: nmap output
#2: Scan multiple IP address or subnet (IPv4)

nmap 192.168.1.1 192.168.1.2 192.168.1.3
## works with same subnet i.e. 192.168.1.0/24
nmap 192.168.1.1,2,3
You can scan a range of IP address too:

nmap 192.168.1.1-20
You can scan a range of IP address using a wildcard:

nmap 192.168.1.*
Finally, you scan an entire subnet:

nmap 192.168.1.0/24
#3: Read list of hosts/networks from a file (IPv4)

The -iL option allows you to read the list of target systems using a text file. This is useful to scan a large number of hosts/networks. Create a text file as follows:
cat > /tmp/test.txt

Sample outputs:

server1.cyberciti.biz
192.168.1.0/24
192.168.1.1/24
10.1.2.3
localhost
The syntax is:

nmap -iL /tmp/test.txt
#4: Excluding hosts/networks (IPv4)

When scanning a large number of hosts/networks you can exclude hosts from a scan:

nmap 192.168.1.0/24 –exclude 192.168.1.5
nmap 192.168.1.0/24 –exclude 192.168.1.5,192.168.1.254
OR exclude list from a file called /tmp/exclude.txt

nmap -iL /tmp/scanlist.txt –excludefile /tmp/exclude.txt
#5: Turn on OS and version detection scanning script (IPv4)

nmap -A 192.168.1.254
nmap -v -A 192.168.1.1
nmap -A -iL /tmp/scanlist.txt
#6: Find out if a host/network is protected by a firewall

nmap -sA 192.168.1.254
nmap -sA server1.cyberciti.biz
#7: Scan a host when protected by the firewall

nmap -PN 192.168.1.1
nmap -PN server1.cyberciti.biz
#8: Scan an IPv6 host/address

The -6 option enable IPv6 scanning. The syntax is:

nmap -6 IPv6-Address-Here
nmap -6 server1.cyberciti.biz
nmap -6 2607:f0d0:1002:51::4
nmap -v A -6 2607:f0d0:1002:51::4
#9: Scan a network and find out which servers and devices are up and running

This is known as host discovery or ping scan:

nmap -sP 192.168.1.0/24
Sample outputs:

Host 192.168.1.1 is up (0.00035s latency).
MAC Address: BC:AE:C5:C3:16:93 (Unknown)
Host 192.168.1.2 is up (0.0038s latency).
MAC Address: 74:44:01:40:57:FB (Unknown)
Host 192.168.1.5 is up.
Host nas03 (192.168.1.12) is up (0.0091s latency).
MAC Address: 00:11:32:11:15:FC (Synology Incorporated)
Nmap done: 256 IP addresses (4 hosts up) scanned in 2.80 second
#10: How do I perform a fast scan?

nmap -F 192.168.1.1
#11: Display the reason a port is in a particular state

nmap –reason 192.168.1.1
nmap –reason server1.cyberciti.biz
#12: Only show open (or possibly open) ports

nmap –open 192.168.1.1
nmap –open server1.cyberciti.biz
#13: Show all packets sent and received

nmap –packet-trace 192.168.1.1
nmap –packet-trace server1.cyberciti.biz
14#: Show host interfaces and routes

This is useful for debugging (ip command or route command or netstat command like output using nmap)

nmap –iflist
Sample outputs:

Starting Nmap 5.00 ( http://nmap.org ) at 2012-11-27 02:01 IST
************************INTERFACES************************
DEV (SHORT) IP/MASK TYPE UP MAC
lo (lo) 127.0.0.1/8 loopback up
eth0 (eth0) 192.168.1.5/24 ethernet up B8:AC:6F:65:31:E5
vmnet1 (vmnet1) 192.168.121.1/24 ethernet up 00:50:56:C0:00:01
vmnet8 (vmnet8) 192.168.179.1/24 ethernet up 00:50:56:C0:00:08
ppp0 (ppp0) 10.1.19.69/32 point2point up

**************************ROUTES**************************
DST/MASK DEV GATEWAY
10.0.31.178/32 ppp0
209.133.67.35/32 eth0 192.168.1.2
192.168.1.0/0 eth0
192.168.121.0/0 vmnet1
192.168.179.0/0 vmnet8
169.254.0.0/0 eth0
10.0.0.0/0 ppp0
0.0.0.0/0 eth0 192.168.1.2

#15: How do I scan specific ports?

map -p [port] hostName
## Scan port 80
nmap -p 80 192.168.1.1

## Scan TCP port 80
nmap -p T:80 192.168.1.1

## Scan UDP port 53
nmap -p U:53 192.168.1.1

## Scan two ports ##
nmap -p 80,443 192.168.1.1

## Scan port ranges ##
nmap -p 80-200 192.168.1.1

## Combine all options ##
nmap -p U:53,111,137,T:21-25,80,139,8080 192.168.1.1
nmap -p U:53,111,137,T:21-25,80,139,8080 server1.cyberciti.biz
nmap -v -sU -sT -p U:53,111,137,T:21-25,80,139,8080 192.168.1.254

## Scan all ports with * wildcard ##
nmap -p “*” 192.168.1.1

## Scan top ports i.e. scan $number most common ports ##
nmap –top-ports 5 192.168.1.1
nmap –top-ports 10 192.168.1.1

Sample outputs:

Starting Nmap 5.00 ( http://nmap.org ) at 2012-11-27 01:23 IST
Interesting ports on 192.168.1.1:
PORT STATE SERVICE
21/tcp closed ftp
22/tcp open ssh
23/tcp closed telnet
25/tcp closed smtp
80/tcp open http
110/tcp closed pop3
139/tcp closed netbios-ssn
443/tcp closed https
445/tcp closed microsoft-ds
3389/tcp closed ms-term-serv
MAC Address: BC:AE:C5:C3:16:93 (Unknown)

Nmap done: 1 IP address (1 host up) scanned in 0.51 seconds

#16: The fastest way to scan all your devices/computers for open ports ever

nmap -T5 192.168.1.0/24
#17: How do I detect remote operating system?

You can identify a remote host apps and OS using the -O option:

nmap -O 192.168.1.1
nmap -O –osscan-guess 192.168.1.1
nmap -v -O –osscan-guess 192.168.1.1
Sample outputs:

Starting Nmap 5.00 ( http://nmap.org ) at 2012-11-27 01:29 IST
NSE: Loaded 0 scripts for scanning.
Initiating ARP Ping Scan at 01:29
Scanning 192.168.1.1 [1 port]
Completed ARP Ping Scan at 01:29, 0.01s elapsed (1 total hosts)
Initiating Parallel DNS resolution of 1 host. at 01:29
Completed Parallel DNS resolution of 1 host. at 01:29, 0.22s elapsed
Initiating SYN Stealth Scan at 01:29
Scanning 192.168.1.1 [1000 ports]
Discovered open port 80/tcp on 192.168.1.1
Discovered open port 22/tcp on 192.168.1.1
Completed SYN Stealth Scan at 01:29, 0.16s elapsed (1000 total ports)
Initiating OS detection (try #1) against 192.168.1.1
Retrying OS detection (try #2) against 192.168.1.1
Retrying OS detection (try #3) against 192.168.1.1
Retrying OS detection (try #4) against 192.168.1.1
Retrying OS detection (try #5) against 192.168.1.1
Host 192.168.1.1 is up (0.00049s latency).
Interesting ports on 192.168.1.1:
Not shown: 998 closed ports
PORT STATE SERVICE
22/tcp open ssh
80/tcp open http
MAC Address: BC:AE:C5:C3:16:93 (Unknown)
Device type: WAP|general purpose|router|printer|broadband router
Running (JUST GUESSING) : Linksys Linux 2.4.X (95%), Linux 2.4.X|2.6.X (94%), MikroTik RouterOS 3.X (92%), Lexmark embedded (90%), Enterasys embedded (89%), D-Link Linux 2.4.X (89%), Netgear Linux 2.4.X (89%)
Aggressive OS guesses: OpenWrt White Russian 0.9 (Linux 2.4.30) (95%), OpenWrt 0.9 – 7.09 (Linux 2.4.30 – 2.4.34) (94%), OpenWrt Kamikaze 7.09 (Linux 2.6.22) (94%), Linux 2.4.21 – 2.4.31 (likely embedded) (92%), Linux 2.6.15 – 2.6.23 (embedded) (92%), Linux 2.6.15 – 2.6.24 (92%), MikroTik RouterOS 3.0beta5 (92%), MikroTik RouterOS 3.17 (92%), Linux 2.6.24 (91%), Linux 2.6.22 (90%)
No exact OS matches for host (If you know what OS is running on it, see http://nmap.org/submit/ ).
TCP/IP fingerprint:
OS:SCAN(V=5.00%D=11/27%OT=22%CT=1%CU=30609%PV=Y%DS=1%G=Y%M=BCAEC5%TM=50B3CA
OS:4B%P=x86_64-unknown-linux-gnu)SEQ(SP=C8%GCD=1%ISR=CB%TI=Z%CI=Z%II=I%TS=7
OS:)OPS(O1=M2300ST11NW2%O2=M2300ST11NW2%O3=M2300NNT11NW2%O4=M2300ST11NW2%O5
OS:=M2300ST11NW2%O6=M2300ST11)WIN(W1=45E8%W2=45E8%W3=45E8%W4=45E8%W5=45E8%W
OS:6=45E8)ECN(R=Y%DF=Y%T=40%W=4600%O=M2300NNSNW2%CC=N%Q=)T1(R=Y%DF=Y%T=40%S
OS:=O%A=S+%F=AS%RD=0%Q=)T2(R=N)T3(R=N)T4(R=Y%DF=Y%T=40%W=0%S=A%A=Z%F=R%O=%R
OS:D=0%Q=)T5(R=Y%DF=Y%T=40%W=0%S=Z%A=S+%F=AR%O=%RD=0%Q=)T6(R=Y%DF=Y%T=40%W=
OS:0%S=A%A=Z%F=R%O=%RD=0%Q=)T7(R=N)U1(R=Y%DF=N%T=40%IPL=164%UN=0%RIPL=G%RID
OS:=G%RIPCK=G%RUCK=G%RUD=G)IE(R=Y%DFI=N%T=40%CD=S)
Uptime guess: 12.990 days (since Wed Nov 14 01:44:40 2012)
Network Distance: 1 hop
TCP Sequence Prediction: Difficulty=200 (Good luck!)
IP ID Sequence Generation: All zeros
Read data files from: /usr/share/nmap
OS detection performed. Please report any incorrect results at http://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 12.38 seconds
Raw packets sent: 1126 (53.832KB) | Rcvd: 1066 (46.100KB)
See also: Fingerprinting a web-server and a dns server command line tools for more information.

#18: How do I detect remote services (server / daemon) version numbers?

nmap -sV 192.168.1.1
Sample outputs:

Starting Nmap 5.00 ( http://nmap.org ) at 2012-11-27 01:34 IST
Interesting ports on 192.168.1.1:
Not shown: 998 closed ports
PORT STATE SERVICE VERSION
22/tcp open ssh Dropbear sshd 0.52 (protocol 2.0)
80/tcp open http?
1 service unrecognized despite returning data.
#19: Scan a host using TCP ACK (PA) and TCP Syn (PS) ping

If firewall is blocking standard ICMP pings, try the following host discovery methods:

nmap -PS 192.168.1.1
nmap -PS 80,21,443 192.168.1.1
nmap -PA 192.168.1.1
nmap -PA 80,21,200-512 192.168.1.1
#20: Scan a host using IP protocol ping

nmap -PO 192.168.1.1
#21: Scan a host using UDP ping

This scan bypasses firewalls and filters that only screen TCP:

nmap -PU 192.168.1.1
nmap -PU 2000.2001 192.168.1.1
#22: Find out the most commonly used TCP ports using TCP SYN Scan

### Stealthy scan ###
nmap -sS 192.168.1.1

### Find out the most commonly used TCP ports using TCP connect scan (warning: no stealth scan)
### OS Fingerprinting ###
nmap -sT 192.168.1.1

### Find out the most commonly used TCP ports using TCP ACK scan
nmap -sA 192.168.1.1

### Find out the most commonly used TCP ports using TCP Window scan
nmap -sW 192.168.1.1

### Find out the most commonly used TCP ports using TCP Maimon scan
nmap -sM 192.168.1.1

#23: Scan a host for UDP services (UDP scan)

Most popular services on the Internet run over the TCP protocol. DNS, SNMP, and DHCP are three of the most common UDP services. Use the following syntax to find out UDP services:

nmap -sU nas03
nmap -sU 192.168.1.1
Sample outputs:

Starting Nmap 5.00 ( http://nmap.org ) at 2012-11-27 00:52 IST
Stats: 0:05:29 elapsed; 0 hosts completed (1 up), 1 undergoing UDP Scan
UDP Scan Timing: About 32.49% done; ETC: 01:09 (0:11:26 remaining)
Interesting ports on nas03 (192.168.1.12):
Not shown: 995 closed ports
PORT STATE SERVICE
111/udp open|filtered rpcbind
123/udp open|filtered ntp
161/udp open|filtered snmp
2049/udp open|filtered nfs
5353/udp open|filtered zeroconf
MAC Address: 00:11:32:11:15:FC (Synology Incorporated)

Nmap done: 1 IP address (1 host up) scanned in 1099.55 seconds

#24: Scan for IP protocol

This type of scan allows you to determine which IP protocols (TCP, ICMP, IGMP, etc.) are supported by target machines:

nmap -sO 192.168.1.1
#25: Scan a firewall for security weakness

The following scan types exploit a subtle loophole in the TCP and good for testing security of common attacks:

## TCP Null Scan to fool a firewall to generate a response ##
## Does not set any bits (TCP flag header is 0) ##
nmap -sN 192.168.1.254

## TCP Fin scan to check firewall ##
## Sets just the TCP FIN bit ##
nmap -sF 192.168.1.254

## TCP Xmas scan to check firewall ##
## Sets the FIN, PSH, and URG flags, lighting the packet up like a Christmas tree ##
nmap -sX 192.168.1.254

See how to block Xmas packkets, syn-floods and other conman attacks with iptables.

#26: Scan a firewall for packets fragments

The -f option causes the requested scan (including ping scans) to use tiny fragmented IP packets. The idea is to split up the TCP header over
several packets to make it harder for packet filters, intrusion detection systems, and other annoyances to detect what you are doing.

nmap -f 192.168.1.1
nmap -f fw2.nixcraft.net.in
nmap -f 15 fw2.nixcraft.net.in
## Set your own offset size with the –mtu option ##
nmap –mtu 32 192.168.1.1
#27: Cloak a scan with decoys

The -D option it appear to the remote host that the host(s) you specify as decoys are scanning the target network too. Thus their IDS might report 5-10 port scans from unique IP addresses, but they won’t know which IP was scanning them and which were innocent decoys:

nmap -n -Ddecoy-ip1,decoy-ip2,your-own-ip,decoy-ip3,decoy-ip4 remote-host-ip
nmap -n -D192.168.1.5,10.5.1.2,172.1.2.4,3.4.2.1 192.168.1.5
#28: Scan a firewall for MAC address spoofing

### Spoof your MAC address ##
nmap –spoof-mac MAC-ADDRESS-HERE 192.168.1.1

### Add other options ###
nmap -v -sT -PN –spoof-mac MAC-ADDRESS-HERE 192.168.1.1

### Use a random MAC address ###
### The number 0, means nmap chooses a completely random MAC address ###
nmap -v -sT -PN –spoof-mac 0 192.168.1.1

#29: How do I save output to a text file?

The syntax is:

nmap 192.168.1.1 > output.txt
nmap -oN /path/to/filename 192.168.1.1
nmap -oN output.txt 192.168.1.1
#30: Not a fan of command line tools?

Try zenmap the official network mapper front end:

Zenmap is the official Nmap Security Scanner GUI. It is a multi-platform (Linux, Windows, Mac OS X, BSD, etc.) free and open source application which aims to make Nmap easy for beginners to use while providing advanced features for experienced Nmap users. Frequently used scans can be saved as profiles to make them easy to run repeatedly. A command creator allows interactive creation of Nmap command lines. Scan results can be saved and viewed later. Saved scan results can be compared with one another to see how they differ. The results of recent scans are stored in a searchable database.

You can install zenmap using the following apt-get command:
$ sudo apt-get install zenmap

Sample outputs:

[sudo] password for vivek:
Reading package lists… Done
Building dependency tree
Reading state information… Done
The following NEW packages will be installed:
zenmap
0 upgraded, 1 newly installed, 0 to remove and 11 not upgraded.
Need to get 616 kB of archives.
After this operation, 1,827 kB of additional disk space will be used.
Get:1 http://debian.osuosl.org/debian/ squeeze/main zenmap amd64 5.00-3 [616 kB]
Fetched 616 kB in 3s (199 kB/s)
Selecting previously deselected package zenmap.
(Reading database … 281105 files and directories currently installed.)
Unpacking zenmap (from …/zenmap_5.00-3_amd64.deb) …
Processing triggers for desktop-file-utils …
Processing triggers for gnome-menus …
Processing triggers for man-db …
Setting up zenmap (5.00-3) …
Processing triggers for python-central …
Type the following command to start zenmap:
$ sudo zenmap

Sample outputs

Basic Samba Share Ubuntu 12.04 Server.

Here are simple instructions for a simple samba file share on ubuntu 12.04 server.

All commands are ran as root. If you are not root use sudo before the commands.

1. Install samba.

apt-get install samba

2. nano /etc/samba/smb.conf

[share]
comment = share
path = /share
browsable = yes
guest ok = no
read only = no
available = yes
public = no
writable = yes
valid users = user

3. (the share is called share. make sure you have a user called user on your server or replace with a valid user on your server)
save and restart samba.
4. restart smbd
restart nmbd

5. chmod -R 0775 share (You can use filezilla over sftp if you want)

https://help.ubuntu.com/12.04/serverguide/samba-fileserver.html
http://ubuntuserverhelp.com/basic-samba-configuration/

Setting Static IP in Ubuntu Server 12.04.1

from the command line as root or su

nano /etc/network/interfaces

iface eth0 inet static
address 192.168.1.2
netmask 255.255.255.0
gateway 192.168.1.1
dns-nameservers 192.168.1.1 8.8.8.8

First change your adapter from dhcp to static.
Enter the information as above with your ip address settings.
crtl-x in nano and overwrite interfaces file.

restart networking with this command. (if over ssh make sure to adjust your ssh connection to the new ip address)

/etc/init.d/networking restart

Enabling Telnetd on the RV042 / RV082 and RV016

This Tutorial was first shown on the RV042 Information Thread (started by noaaah)

I have now extracted the relevant information on enabling the Telnet Daemon, and found whilst playing with the ifconfig that the Port Interfaces MTU settings , amoungst other things, can be changed.

Enabling Telnetd

1. From your web browser type the following:

http://<Router IP Address>/sysinfo123.htm?ConsoleSimulation=1

eg: http://192.168.1.1/sysinfo123.htm?ConsoleSimulation=1

This has temporarily enabled Telnet. (A reboot and it has gone)

To make Telnet permanent

2. Using PuTTy or some other telnet client, logon to the routers OpenRG’s command line inferface. (cli)

telnet?192.168.1.1

Username:admin
Password:admin

rg_conf_set /nk/telnetd_enabled 1
flash_commit
reboot

cli example:

Username: admin
Password: ***********
> rg_conf_set /nk/telnetd_enabled 1
Returned 3280760
> flash_commit
Returned 0
> reboot

Once the router has rebooted the telnetd is now permanent. (except for full reset)

Now comes the fun part.

If you have the chance of having Dual WAN internet service from independant sources, like Cable and DSL, you could possibly have a problem on your hands. The fact is MTU settings for Cable defaults at 1500, and for DSL connections it is 1492. However in the GUI of the router you can only set a default MTU for both ports.

Note: MTU set to Auto = 576. this should NEVER be used. set to manual and use 1500 (Cable) or 1492 (DSL)

So how do we get both WANS to have a seperate MTU size? Telnet!!!

once again we goto Telnet and logon in. Now. the RV main OS is OpenRG. if has is own commands, but the easiest option is to load the BusyBox shell.

So one you have logged into OpenRG cli type:

> shell
Returned 0
>

BusyBox v0.50 (2006.06.08-12:45+0000) Built-in shell (lash)
Enter ‘help’ for a list of built-in commands.

/ #

From he we now type ifconfig (the linux variant of windows ipconfig)

LAN = ixp0
WAN1 = ixp1
WAN2 = ixp2

/ # ifconfig
ipsec0 Link encap:Ethernet HWaddr xx:xx:xx:xx:xx:xx
inet addr:xx.xx.xx.xxx Mask:255.255.252.0
UP NOTRAILERS RUNNING MULTICAST MTU:1440 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:10
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)

ipsec1 Link encap:Ethernet HWaddr xx:xx:xx:xx:xx:xx
inet addr:xx.xx.xx.xxx Mask:255.255.255.0
UP NOTRAILERS RUNNING MULTICAST MTU:1440 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:10
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)

ixp0 Link encap:Ethernet HWaddr xx:xx:xx:xx:xx:xx
inet addr:xx.xx.xx.xxx Bcast:xx.xx.xx.xxx Mask:255.255.255.0
UP BROADCAST NOTRAILERS RUNNING MULTICAST MTU:1500 Metric:1
RX packets:369768 errors:0 dropped:0 overruns:0 frame:0
TX packets:413845 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:65344557 (62.3 Mb) TX bytes:186222521 (177.5 Mb)

ixp1 Link encap:Ethernet HWaddr xx:xx:xx:xx:xx:xx
inet addr:xx.xx.xx.xxx Bcast:xx.xx.xx.xxx Mask:255.255.252.0
UP BROADCAST NOTRAILERS RUNNING MULTICAST MTU:1500 Metric:1
RX packets:367303 errors:0 dropped:0 overruns:0 frame:0
TX packets:355931 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:171435537 (163.4 Mb) TX bytes:60698066 (57.8 Mb)

ixp2 Link encap:Ethernet HWaddr xx:xx:xx:xx:xx:xx
inet addr:xx.xx.xx.xxx Bcast:xx.xx.xx.xxx Mask:255.255.255.0
UP BROADCAST NOTRAILERS RUNNING MULTICAST MTU:1500 Metric:1
RX packets:18 errors:0 dropped:0 overruns:0 frame:0
TX packets:15 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:5932 (5.7 kb) TX bytes:2986 (2.9 kb)

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK NOTRAILERS RUNNING MULTICAST MTU:16436 Metric:1
RX packets:62 errors:0 dropped:0 overruns:0 frame:0
TX packets:62 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:5004 (4.8 kb) TX bytes:5004 (4.8 kb)

/ #

Now I have highligthed the MTU settings of ixp0/ixp1 (WAN1/WAN2)

but if we had cable on WAN1 and DSL on WAN2 then WAN2 could run into problems. now we set MTU for ixp1 to 1492 so type:

/ # ifconfig ixp2 mtu 1492
/ #
and to check:

/ # ifconfig ixp2
ixp2 Link encap:Ethernet HWaddr 00:12:17:4D:0C:4E
inet addr:89.75.1.100 Bcast:89.75.1.255 Mask:255.255.255.0
UP BROADCAST NOTRAILERS RUNNING MULTICAST MTU:1492 Metric:1
RX packets:101 errors:0 dropped:0 overruns:0 frame:0
TX packets:120 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:8404 (8.2 kb) TX bytes:13189 (12.8 kb)

/ #

so now you have WAN1 MTU 1500 and WAN2 MTU 1492

One last MTU setting is for VPN tunnels. The MTU setting for ipsec0 (IPSec over WAN1) and ipsec1 (IPSec over WAN2) defaults to 1440 for IPSEC VPN Tunnels. If you need to change them you can. using this command within the Busybox shell of the RV0x2 Unit.

ifconfig <interface name> mtu bytes

Router Interface
LAN = ixp0
WAN = ixp1
WAN2 = ixp2

VPN IPSec Interfaces
WAN1 = ipsec0
WAN2 = ipsec1

Available commands for OpenRG 
Once you are logged onto the OpenRG cli, Press the TAB key. it will list all available commands.

Available commands for shell
Once you are logged onto the OpenRG cli, type “shell” (without the “”) then Press the TAB key. it will list all available commands.

Note: 

1. I was told a while back the RV016 has no known workaround yet for the Telnet feature. however this Tutorial does work on the RV016 with v2.0.10 firmware.

2. Rebooting the router will reset the MTU setting. no known fix as yet. if you find one let me know!

 

Original source:  http://www.linksysinfo.org/index.php?threads/enabling-telnetd-on-the-rv042-rv082-and-rv016.16069/

Fing Usage

 

Configure the Network Discovery

Posted in Documentation

 

The network discovery provides a complete view of any network: fing engine automatically detects the underlying network type and uses the best technique to take the picture of the target network.

The best results are surely achieved on ethernet LAN’s (WiFi ones included), where fing can make use of the dedicated data-link layer discovery engine which is the faster one and the more accurate one also, as it’s able to detect all the hosts present in the network, super-firewalled ones included!

Discoveries performed on non-local networks (or non-ethernet networks) are handled by a network layer discovery engine, which relies on TCP/IP network layer, i.e. ICMP (ping) and TCP queries. When you start a discovery fing tells you the actual engine which is being used; in case of specific needs, it is possible to configure and tune each engine for optimal results, creating dedicated discovery profiles in the related configuration properties file: discovery.properties.

fing configuration files are all in the same format: properties format, i.e. a list of declarations like settings=value. Configuration files are placed in /etc/fing on Linux and Mac, while on Windows they are placed in your application data folder: %APPDATA%\Overlook\Fing\conf. On Windows you also have a shortcut to that folder in fing’s program files start menu.

When you start fing without arguments, it takes the nearest of your available networks and starts performing a discovery on it, reporting stuff directly on console. But you can perform discovery on any network, by providing your target network to fing in the command line:

fing -n 192.168.1.0/24 or fing -n www.overlooksoft.com/24

If you do not provide any output parameter, fing uses default ones (as specified in its fing.propertiesconfiguration file). But for a running discovery you can setup as many output formats as you need, by providing a command line argument like: fing -o setupFormat1 setupFormat2 … setupFormatN

The output format setup syntax is pretty simple: there are 2 main categories of output flows, table and log. The table flow produces a network table dump every time a discovery round is completed, while the log flow logs each network event as soon as it’s detected.

If you want to change the discovery round frequency, edit the related round.interval setting indiscovery.properties configuration file. Note that for each profile you declare you must provide both configurations for data-link and network layer discovery classes.

The log flow allows you to log network events in real-time, on the console itself or in a specific file. Currently there are two formats supported for log flows: text and CSV.E.g. to start fing producing textual log in console and a CSV log in a file:

fing -o log,text log,csv,my-network-log.csv

The table flow instead produces a network table view refreshed each time a discovery round finishes. The most popular formats are text and HTML but here it is the complete list: stext (short text for 80-columns console), text (plain text), htmlcsv, and xml. E.g. on Windows to make fing report network discovery to an HTML file on your desktop and also produce a short text console output both as table and log:

fing -o log,text table,stext table,html,"%USERPROFILE%\Desktop\network.html"

 

The network table report contains details for each host found in the network, and it’s refreshed in real-time at each round: IP address, MAC address, hostname and host friendly name. The latter is a friendly name you can associate to the hosts by means of the hosts.properties configuration file, where you are able to define your custom names for hosts (by IP address or MAC address) and for networks.

By default when you close fing the discovery session is lost, unless you want to save session data into a session file; in this case fing can be closed and restarted when you need, without losing any discovery session data. To exploit discovery session feature you have to simply provide fing the session file name to use. E.g. to make fing generate an HTML report and save session data in a folder named report:

fing -n 192.168.1.0/24 -o table,html,c:\report\lan.html --session c:\report\lansessiondata

Rutorrent easy script

flizbox version 7 (seedbox install script)

Lighttpd web server | rtorrent 0.9.3 | libtorrent 0.13.3 | RuTorrent 3.5 + all official plugins | autodl-irrsi with plugin for RuTorrent | vsftpd (very secure ftp using ssl) | mktorrent 1.0 | all required dependancies | a unique ssl cetificate for each weblink needed to your server (vsftp, rutorrent, deluge etc).

Option to install Deluge 1.3.5, ZNC 1.0 and Webmin (deluge option does not replace the rutorrent installation).

Tested 100% working on 64-bit versions of:-

– Debian 6
– Ubuntu 12.10 Server
– Ubuntu 12.04 Server
– Ubuntu 11.10 Server
– Ubuntu 11.04 Server
– Ubuntu 10.04 Server

This script is for a single seedbox user only.

How to use:-

After a fresh Linux install, log in as the ROOT USER using the password they give you into SSH and paste the following lines in turn:-

wget http://sourceforge.net/projects/flizbox/files/flizbox-v7.sh
bash flizbox-v7.sh

Any questions or suggestions contact axoree@gmail.com

flizbox Web Site

IF USING A VPS OR PREINSTALLED ENVIRONMENT.  MAKE SURE APACHE2 IS NOT INSTALLED.  IF SO RUN THIS AS ROOT.

apt-get remove apache2*

 

5 Alternatives To Unity For Ubuntu Users

We’ve previously written about Ubuntu’s Unity desktop environment, which we touted as a “big leap forward” for Linux when it was introduced with Ubuntu 11.04. Unity was certainly a big leap in a new direction, but it left a lot of users behind.

Luckily, Linux is all about choice and Ubuntu’s software repositories contain a variety of excellent alternatives to Unity. Each desktop environment you install appears as an option when you click the gear icon on Ubuntu’s login screen. You can install as many as you want and find the one that’s right for you.

GNOME Shell (GNOME 3)

GNOME Shell is definitely the most obvious alternative to Unity, given that Ubuntu has historically shipped a pretty standard GNOME desktop environment. Ubuntu still includes most of GNOME 3; Unity just replaces the GNOME Shell launcher with Ubuntu’s own interface.

alternatives to unity

GNOME 3 feels pretty slick, but disaffected Unity users may be disappointed with what GNOME has become. Far from the traditional GNOME 2 interface, GNOME 3 includes its own full-screen application launcher and feels pretty similar to Unity. Some users will prefer GNOME Shell to Unity, but if you’re yearning for a more traditional interface, look elsewhere.

Click here to install GNOME Shell if you’re using Ubuntu. You can also search for it in theUbuntu Software Center or use the following command:

sudo apt-GET install gnome-shell

KDE

The KDE project alienated much of its own user base when KDE 4 was released, but it’s had a lot of time to add polish and work out the kinks. Currently at version 4.7, KDE has traditionally been the second most popular Linux desktop environment and primary alternative to GNOME.

 

alternatives to ubuntu unity

KDE has its own alternatives to the GNOME applications you’re familiar with, but you can continue to use GNOME applications on KDE. They may look slightly out of place, since KDE uses the QT toolkit instead of GNOME’s GTK toolkit.

Click here to get KDE if you’re already using Ubuntu. You can also look for Kubuntu-Desktop in the Ubuntu Software Center or execute the following command:

sudo apt-GET install kubuntu-desktop

The Kubuntu project provides a Ubuntu installer disc that comes with KDE instead of Unity.

XFCE

XFCE doesn’t try to reinvent the desktop like GNOME 3 and Unity do, but it does provide an environment that long-time GNOME 2 and Ubuntu users will feel at home with. XFCE was once GNOME’s less resource-intensive and more minimal cousin, but GNOME’s shift has made XFCE a distinct environment. XFCE uses the same GTK toolkit that GNOME does, so GNOME applications will fit right in on an XFCE desktop.

alternatives to ubuntu unity

Did you know that Linus Torvalds, Linux’s creator, now uses XFCE? GNOME 3 pushed him to XFCE, just as KDE 4 pushed him to GNOME 2. Follow in Linus’s footsteps by clicking here, installing the Xubuntu-Desktop package from the Ubuntu Software Center or running the following command:

sudo apt-GET install xubuntu-desktop

Use the Xubuntu installer disc to install Ubuntu with an XFCE desktop instead of Unity.

LXDE

LXDE is a lightweight desktop environment targeted at machines with less powerful hardware. LXDE’s focus on minimal resource consumption makes it a great choice if you’re looking for a desktop environment that doesn’t try to do too much and just gets out of your way. It’s lighter than Xubuntu’s XFCE desktop, which was previously considered the lightweight version of Ubuntu.

alternatives to ubuntu unity

Check out our post about Lubuntu for a more in-depth overview of the LXDE desktop environment or click here to start installing LXDE if you’re sold on it. You can also grab the Lubuntu-Desktop package from the Ubuntu Software Center or use the following command:

sudo apt-GET install lubuntu-desktop

Download an Lubuntu disk image if you want to install Ubuntu with LXDE from scratch.

Xmonad

For the Linux user who’s really sick of having their hand held, Xmonad is less a desktop environment and more a toolkit for building your own. Xmonad is a tiling window manager, so it arranges windows for you and doesn’t make you drag them around. That’s about all that Xmonad does for you — Xmonad doesn’t even provide an application launcher or panel by default, but you can add those yourself.

alternatives to unity

Log into Xmonad and all you’ll see is the normal login screen background. From there, you can press Alt-Shift-Enter to open a terminal where you can launch additional applications. Check out the official Xmonad guided tour for an introduction to using Xmonad.

Click here to install Xmonad, grab it from the Ubuntu Software Center or run the following command:

sudo apt-GET install xmonad

More Options

Ubuntu also provides GNOME Session Fallback, which appears as GNOME Classic on the login screen after you install it. Don’t let the name fool you — GNOME Session Fallback is just a hack on top of GNOME 3. It’s designed to function similarly to GNOME 2 and has the same basic menu structure, but GNOME 2 fans will notice a lot of features missing. Install it byclicking here or running the following command, if you’re interested:

sudo apt-GET install gnome-session-fallback

If you just think Unity needs more configuration options, then Confity or the CompizConfig Settings Manager might do it for you.

Creating Batch File to Map Network Drive

Creating Batch File to Map Network Drive

If you want to save time by creating a batch file that when you click on it it will automatically map the drive for you.  Or if the map network drive keep disconnecting every time you restart your computer, then you can put the batch file in the start up folder so that it run every log in. 

  1. Open Notepad (Start>Run>Type Notepad or Start>Programs>Accessories>Notepad)
  2. Type @echo Create new L: drive mapping (The drive letter could be any letter)
  3. Type @net use L: \\Network path /persistent: yes (The Network path is the path where you want to mapped to)
  4. If you want to mapped multiple drive just keep repeating step 2 and 3
  5. Type :exit
  6. @pause
  7. Click File and select Save As
  8. Navigate to where you want to save it
  9. Name it and Make sure at the end of the name you add .bat
  10. Click OK
  11. Now navigate to where you save it and click on it
  12. A command prompt should appear
  13. Then Press any key to exit

It should looks something like this:

@echo Create new L: drive mapping
@net use L: \\network path /persistent:yes
@echo Create new K: drive mapping
@net use K: \\
network path /persistent:yes
:exit