Pages

Saturday, September 8, 2012

Calculations on Linux

Command Line calculator

how to perform standard calculations on the command line including addition, subtraction, multiplication, division, powers, square root, conversion.


From man pages

bc - An arbitrary precision calculator language


Monday, September 3, 2012

How to add source code in Blogspot

I was googling around to find a way to post source code in the blog pages that look better compare to the default.

I run into these :


  1. google-code-prettify
  2. syntaxhighlighter
  3. Format source code for blogspot


For now I'm using the last one.


Monday, August 27, 2012

Basic DHCP on Cisco Router

Configuring DHCP IOS DHCP server

Sequence of DHCP messages :
  1. Client sends a broadcast DHCPDISCOVER message to the server
  2. The DHCP server replies with a DHCPOFFER message containing the IP address, subnet mask , gateway and other parameters.
  3. The client sends a broadcast DHCPREQUEST message to the server, requesting the offered address.
  4. The DHCP server replies with a broadcast DHCPACK packet to the client.

DHCP server was designed to work within the same broadcast domain as the clients.
If DHCP server is behind another router , that router must become a DHCP Relay Agent. The DHCP relay will intercept the broadcast DHCP messages from the client and will forward them to the server as unicast messages. See at the end of this post a setup based on this scenario.


My network setup in GNS3 shown below 

Tuesday, August 14, 2012

SSH useful commands

I post below some useful SSH commands


Secure Copy File Transfer
SCP copies files between hosts on a network. It uses ssh for data transfer, and uses the same authentication and provides the same security as ssh. Some examples here


From a remote host to  local host
scp -P10022 192.168.2.10:/home/stelios/Desktop/Etherchannel.zip /home/stelios/Desktop/  
 Etherchannel.zip                                            100% 137KB 136.6KB/s  00:00   

More that one file from localhost to remote host
scp -P10022 test01.txt test02.txt 192.168.2.10:/home/stelios/Desktop/  
 test01.txt                                                 100%  0   0.0KB/s  00:00    
 test02.txt                                                 100%  0   0.0KB/s  00:00    

From the local host to a remote host
scp -P10022 /home/stelios/Desktop/Multicast.zip 192.168.2.10:/home/stelios/Desktop/  
 Multicast.zip                                               100%  75MB  1.5MB/s  00:49    

Secure Copy  directory from local to remote host
scp -P10022 -r /home/stelios/Desktop/scp_test 192.168.2.10:/home/stelios/Desktop/  
 WHowe_gns3_vbox.pdf                                       100% 1902KB  1.9MB/s  00:00    

Sunday, July 22, 2012

Installing GNS3 0.8.3 on Linux Mint 13 Maya

Below are the basic steps for installing GNS3 0.8.3 on Linux Mint 13 Maya (and Linux Mint 14)
Following same steps should work on Ubuntu Linux as well.

Tuesday, June 5, 2012

Installing GNS3 v0.8.2 on Ubuntu 12.04

Below are the basic steps for installing GNS3 0.8.2 on Ubuntu 12.04 and get it started. Video tutorials on  gns3 website .

(check out the three step installation for GNS3 v0.8.6 Installing GNS3 v0.8.6 on Linux)

Saturday, March 17, 2012

Cisco Routers/Switches - Command alias


You can create command alias on Cisco routers/swithces by using the command alias in the global configuration mode

See the origal documentation by Cisco Systems :
Using Aliases for CLI Commands

Syntax :
alias mode command-alias original-command
no alias mode [command-alias]


Saturday, December 3, 2011

Add Loopbacks in Ubuntu for GNS3


Running GNS3 on Linux and trying to reach the outside world, you will not be able to use your host PC to telnet to the virtual routers unless you create loopbacks. see related post in GNS3 forum
Below I post the steps for creating loopback on Ubuntu. After that you will be able to use your PC to telnet or ping to the virtual routers. (more details here)

Saturday, October 29, 2011

Add hosts in GNS3 using VPCS on Ubuntu

The Virtual PC Simulator (VPCS) is a program that runs within Windows or Linux. It has limited functionality, but it allows pings and traceroutes. if you want to save memory and CPU cycles , VPCS is the application to go.
The VPCS can simulate up to 9 PCs.

When VPCS starts, it listens the ports from 20000 to 20008 and waits the
dynamips to connect, and sends the packets to the ports from 30000 to 30008.

More info in the GNS3 website here. From the official website go here.

1. Download VPCS 
use this link here


Installing GNS3 0.7.4 on Ubuntu 10.10 maverick

GNS3 is  an excellent tool  for graphical network simulator that allows simulation from simple to complex networks.A complementary tool for network engineers and people wanting to study for certifications such as Cisco as well as Juniper.

It can also emulate many Cisco IOS router platforms , PIX/ASA Firewalls and Juniper JunOS
The program is an open source, free program and  may be used on multiple operating systems, including Windows, Linux, and MacOS X.

 Check GNS3 documentation website for more details.
Check the old tutorial (for basic) and another for more advance users


My machine has Ubuntu 10.10 maverick (32-bit ).


Wednesday, October 5, 2011

Linux secrets

I will be posting here Linux secrets commands that are not very well known


Space Invaders

OpenOffice.org 2.0/OpenOffice.org 3.2.1 
there's an entire game hidden in OpenOffice.org Calc. Open a new worksheet, and in any cell, type in the formula:
=game("StarWars")

and press Enter. You should see a Space Invaders-style arcade game.


Signature in ASCII graphics 

A sample output. ( press CTRL-D after you type the message)

$ boxes -d peek
STELIOS AGAPIOU
check my Blog
myhomelab.blogspot.com


Wednesday, July 6, 2011

How to see your public IP address from command line

Searching around I found few ways to do that while using Linux console. Upon entering the script , the prompt will return the public IP address

~$ wget -qO- whatismyip.org && echo

~$ wget -q -O - whatismyip.org;echo

~$ wget -q -O - checkip.dyndns.org|sed -e 's/.*Current IP Address: //' -e 's/<.*$//'