Thursday, June 11, 2009

Doxygen in Ubuntu 9.04

Doxygen is a documentation system for C++, C, Java, Objective-C, Python, IDL (Corba and Microsoft flavors), Fortran, VHDL, PHP, C#, and to some extent D.

It can help you in three ways:

  1. It can generate an on-line documentation browser (in HTML) and/or an off-line reference manual (in $\mbox{\LaTeX}$) from a set of documented source files. There is also support for generating output in RTF (MS-Word), PostScript, hyperlinked PDF, compressed HTML, and Unix man pages. The documentation is extracted directly from the sources, which makes it much easier to keep the documentation consistent with the source code.
  2. You can configure doxygen to extract the code structure from undocumented source files. This is very useful to quickly find your way in large source distributions. You can also visualize the relations between the various elements by means of include dependency graphs, inheritance diagrams, and collaboration diagrams, which are all generated automatically.
  3. You can even `abuse' doxygen for creating normal documentation (as I did for this manual).

Doxygen is developed under Linux and Mac OS X, but is set-up to be highly portable. As a result, it runs on most other Unix flavors as well. Furthermore, executables for Windows are available.

Easy step to install Doxygen in Ubuntu 9.04
1. Install package doxygen and doxygen-gui
2. In the terminal, run doxygenwizard
3. Customize the Doxyfile using doxywizard

Note : to show the dependency graph you have to
1. install graphviz package
2. select dot feature in doxywizard
3. specify the dotty path (Normally, in /usr/bin/)

NS2 v2.29 - Doc using Doxygen
1. Download from here
2. To extract, type tar -zxvf "filename.tar.gz" in the terminal
3. open index.html in html folder

Optional 4. copy folder to html folder to web server folder

Note : To enable search engine capability you should install php package

Tuesday, June 9, 2009

Cisco Lab 2 : Spanning-tree

Objectives
1. Spanning tree protocol (STP)
2. Root bridge and port election
3. Rapid STP (RSTP)

Spanning Tree Protocol (STP)
1. Show STP
switch#show spanning-tree
Note
- Root bridge has lowest bridge ID (bridge priority+MAC address)
- All ports of root bridge is designated port
- Root port is the port with the lowest path cost or lowest port ID (port priority+port number) to the root bridge

Root bridge and port election
1. Changing bridge priority
switch#spanning-tree vlan "vlan number" priority "possible priority number"
switch#spanning-tree vlan "vlan number" root primary --> bridge priority=24586
2. Changing default path cost
switch(config-if)#spanning-tree vlan "vlan number" cost "path cost number"
3. Changing port ID
switch(config-if)#spanning-tree vlan "vlan number" port-priority "port priority number"

Rapid spanning tree (RSTP)
1. Enable RSTP
switch(config)#spanning-tree mode rapid-pvst

Sunday, June 7, 2009

Backup and restore configuration file on Catalyst 2950 and router 1721

Introduction

Routers often get upgraded or swapped out for a number of reasons. This document provides the user with some basic steps to migrate the configuration from an existing router to a new router.

Prerequisites

Requirements

Before you use the information in this document, make sure that you meet these requirements:

  • Access to a Trivial File Transfer Protocol (TFTP) or File Transfer Protocol (FTP) server.

  • Connectivity - Routers must be able to access the FTP or TFTP server. Use the ping command to verify connectivity.

Components Used

This document is not restricted to specific software and hardware versions.

The information in this document was created from the devices in a specific lab environment. All of the devices used in this document started with a cleared (default) configuration. If your network is live, make sure that you understand the potential impact of any command.

Conventions

Refer to Cisco Technical Tips Conventions for more information on document conventions.

Make a Backup of the Configuration

There are several methods to choose from in order to back up and restore a configuration:

Use a TFTP Server to Backup and Restore a Configuration

This is a step-by-step approach to copy a configuration from a router to a TFTP server, and back to another router. Before you proceed with this method, make sure you have a TFTP server on the network to which you have IP connectivity.

  1. At the Router> prompt, issue the enable command, and provide the required password when prompted.

    The prompt changes to Router#, which indicates that the router is now in privileged mode.

  2. Copy the running configuration file to the TFTP server:

    CE_2#copy running-config tftp:
    Address or name of remote host []? 64.104.207.171
    Destination filename [ce_2-confg]? backup_cfg_for_my_router
    !!
    1030 bytes copied in 2.489 secs (395 bytes/sec)
    CE_2#
  3. Open the configuration file with a text editor. Search for and remove any line that starts with "AAA".

    Note: This step is to remove any security commands that can lock you out of the router.

  4. Copy the configuration file from the TFTP server to a new router in privileged (enable) mode which has a basic configuration.

    Router#copy tftp: running-config
    Address or name of remote host []? 64.104.207.171
    Source filename []? backup_cfg_for_my_router
    Destination filename [running-config]?
    Accessing tftp://10.66.64.10/backup_cfg_for_my_router...
    Loading backup_cfg_for_router from 64.104.207.171 (via FastEthernet0/0): !
    [OK - 1030 bytes]

    1030 bytes copied in 9.612 secs (107 bytes/sec)
    CE_2#

Use an FTP Server to Backup and Restore a Configuration

In this procedure, an FTP server can be used in place of a TFTP server.

  1. At the Router> prompt, issue the enable command, and provide the required password when prompted.

    The prompt changes to Router#, which indicates that the router is now in privileged mode.

  2. Configure the FTP username and password.

    CE_2#config terminal
    CE_2(config)#ip ftp username cisco
    CE_2(config)#ip ftp password cisco123
    CE_2(config)#end
    CE_2#
  3. Copy the configuration to the FTP server.

    CE_2#copy running-config ftp:
    Address or name of remote host []? 10.66.64.10
    Destination filename [ce_2-confg]? backup_cfg_for_router
    Writing backup_cfg_for_router !
    1030 bytes copied in 3.341 secs (308 bytes/sec)
    CE_2#
  4. Open the configuration file with a text editor. Search for and remove any line that starts with "AAA".

    Note: This step is to remove any security commands that can lock you out of the router.

  5. Copy the configuration file from the FTP server to a router in privileged (enable) mode which has a basic configuration.

    Router#copy ftp: running-config
    Address or name of remote host [10.66.64.10]?
    Source filename [backup_cfg_for_router]?
    Destination filename [running-config]?
    Accessing ftp://10.66.64.10/backup_cfg_for_router...
    Loading backup_cfg_for_router !
    [OK - 1030/4096 bytes]
    1030 bytes copied in 13.213 secs (78 bytes/sec)
    CE_2#

Use a Terminal Emulation Program to Backup and Restore a Configuration

A terminal emualation program can be used to back up and restore a configuration. This is a description of the procedure using Microsoft Hyperterminal Terminal Emulation software:

  1. If the configuration needs to be copied from another router, connect to that router through the console or Telnet.

  2. At the Router> prompt, issue the enable command, and provide the required password when prompted.

    The prompt changes to Router#, which indicates that the router is now in privileged mode.

  3. Issue the terminal length 0 command in order to force the router to return the entire response at once, rather than one screen at a time.

    This allows you to capture the configuration without extraneous --more-- prompts generated when the router responds one screen at a time.

  4. On the HyperTerminal menu, choose Transfer > Capture Text.

    The Capture Text window appears.

  5. Name this file "config.txt."

  6. Click Start in order to dismiss the Capture Text window and begin the capture.

  7. Issue the show running-config command, and allow time for the router to complete its response. You will see:

    Building configuration...

    followed by the configuration.

  8. On the HyperTerminal menu, choose Transfer > Capture Text > Stop in order to end the screen capture.

  9. Open the config.txt file you created in any text editor, such as Notepad or Wordpad.

  10. Search for and remove any line that starts with "AAA".

    Note: This step is to remove any security commands that could lock you out of the router.

  11. Save the file.

  12. Connect to the router that needs the configuration.

  13. Open the config.txt file.

  14. Highlight the entire contents of the config.txt file.

    You can do this by dragging the cursor from before the first character to after the last character in the file while holding down the left mouse button. Alternatively, if you use Notepad, you can choose Edit > Select All from the menu.

  15. Copy the selected text to the Windows clipboard.

    You can either choose Edit > Copy from the text editor menu, or hold down the CTRL key and simultaneously press the C key in order to perform the copy.

  16. Switch to the HyperTerminal window, and issue the configure terminal command at the Router# prompt. Then press Enter.

  17. Paste the configuration file into the router by selecting Edit > Paste to Host on the HyperTerminal menu.

  18. After the configuration has finished pasting and the router brings you back to the configuration prompt, issue the copy running-config startup-config command in order to write the configuration into memory.

  19. Issue the exit command in order to return to the Router# prompt.

Automatic Backup of Configuration using the Kron Method

In order to get a router to copy the running-config to startup-config, for example every Sunday at 23:00, complete these steps:

  1. Create a kron policy list—This is the script that lists what commands the router should run at the scheduled time.

    Router(config)#kron policy-list SaveConfig

    Router(config-kron-policy)#cli write
    Router(config-kron-policy)#exit
    • cli—Specifies EXEC CLI commands within a Command Scheduler policy list.

    • Policy-list—Specifies the policy list associated with a Command Scheduler occurrence.

    Note: The reason why write was used rather than copy running-config startup-config is because kron does not support interactive prompts and the copy running-config startup-config command requires interaction. It is important to remember this when you create commands. Also, note that kron does not support configuration commands.

  2. Create a kron occurrence—This informs the router when and how often the policy should run.

    Router(config)#kron occurrence SaveConfigSchedule
    at 23:00 Sun recurring
    Router(config-kron-occurrence)#policy-list SaveConfig

    • SaveConfigSchedule—This is the name of occurrence. Length of occurrence-name is from 1 to 31 characters. If the occurrence-name is new, an occurrence structure will be created. If the occurrence-name is not new, the existing occurrence will be edited.

    • at—Identifies that the occurrence is to run at a specified calendar date and time.

    • recurring—Identifies that the occurrence is to run on a recurring basis.

  3. Verify the kron configuration by using the show command.

    Router#sh kron schedule
    Kron Occurrence Schedule
    SaveConfigSchedule inactive, will run again in 1 days 12:37:47 at 23:00 on Sun
    • inactive—Means that kron is not running the command(s) at present.

    • Active—Means that kron is running the current command(s).

    Router#show running-configuration
    kron occurrence SaveConfigSchedule at 23:00 Sun recurring
    policy-list SaveConfig
    kron policy-list SaveConfig
    cli write

Backup Configuration to a TFTP Server

This example is to save the running config to a TFTP server (10.1.1.1) every Sunday at 23:00:

Router(config)#kron policy-list Backup

Router(config-kron-policy)#cli show run | redirect
tftp://10.1.1.1/test.cfg
Router(config-kron-policy)#exit
!
Router(config)#kron occurrence Backup at 23:00 Sun recurring
Router(config-kron-occurrence)#policy-list Backup

Verify

Use the show running-config command to confirm that the configuration file has been copied to the destination router.

Backup Configuration file
1. Router 1721 : file
2. Catalyst 2950 : file

Reference
Cisco Techncal Support

Configuration file for proFTP in Ubuntu

For the one who have problem like me on proFTP. After googling for many many webpages, I've found the config file for anonymous access for proFTP

My modify config file : anonymous can do what ever they want.

Config file

Testing Ubuntu Jaunty Netbook Remix on Aspire One

I just have some time for fun testing Ubuntu netbook remix version of Jaunty. My testing environment is
OS : Ubuntu Jaunty Jackalope (9.04) netbook remix and PC version
Hardware : Acer Aspire one 110
Main Memory : 2GB
Non Volatile memory : Flash memory 8 GB
It is good at the first sight that it can boot on USB flash drive faster than Windows XP (home and professional edition). The interface is very nice and splendid animation. It has no question why I won't install this image into my aspire one. After all installation is complete which takes about 30 mins!!!, I've to wait for installing update about 1 hour ???.However, the new version still has some bugs. After I have change the look from netbook to classic, it cost me very much. The problem that I've face is that it cannot open X window after reboot (it says that the display is not composite or something like that ...). After fixing by using commandline, at last, I decided to newly install ubuntu using Desktop version instead.

The Ubuntu in desktop version costs only 2.3 GB for OS (less WinXP). The speed is , of course, also faster than older OS, Windows XP. Another impression about this Jaunty is that it can run compiz and wobbly effect (WOW!!!) like my laptop and the problem about the X windows is not happened in this version.

So, for the people who interests to install Ubuntu netbook remix version on Acer Aspire one, I recommend that you should not change the look from the default to the classic (as the system tells you) since it can cost you to install all of the thing again and again

Friday, June 5, 2009

Cisco Lab 3 : VLAN

Objectives
1. Setup and remove VLAN database
2. Static access port assignment in VLAN
3. Static trunk port VLAN setup
4. Virtual trunking protocol (vtp)
5. VTP pruning

Note : Maximum vlan support on Catalyst 2950 = 128

Setup VLAN database
1. Setup self IP address of switch
2. Setup VLAN database
switch#vlan database
3. Setup vlan record
switch(vlan)# vlan "vlan number (0,1,...,128)" name "vlan name"

Remove VLAN database
There are two alternative ways to remove vlan database
1. Remove by individual
switch#vlan database
switch(vlan)#no vlan "vlan number" e.g. #no vlan2
2. Remove all of database
switch#delete flash:vlan.dat

Static access port assignment in VLAN
1. Enter Global configuration mode
switch#conf t
2. port assignment : there are two alternative ways individual or group assignment
First way : individual port assignment
- Enter interface configuation
switch(config)#interface "interface-type" "module"/"number" e.g. #int fa0/1
- Set port access mode
switch(config-if)#switchport mode access
- Assign vlan to port
switch(config-if)#switchport access vlan "vlan number"

Second way : group of port assignment
- Enter group of interface configuation
switch(config)#interface range "interface-type" "module"/"begin number" - "end number" e.g. #int fa0/1 - 24
- Set port access mode
switch(config-if-range)#switchport mode access
- Assign vlan to port
switch(config-if-range)#switchport access vlan "vlan number"

Static trunk port assignment in VLAN
1. Enter interface of trunk port
switch(config)#interface "interface-type" "module"/"number"
2. Change mode to trunk mode
switch(config-if)#switchport mode trunk
3. Verify
switch#show interface status
switch#show interface
"interface-type" "module"/"number"
4. limited vlan to access trunk
switch(config-if)#switchport trunk allow vlan "begin vlan number"-"end vlan number"

Virtual trunking protocol (VTP)
1. Setup vtp domain
switch#vlan database
switch(vlan)#vtp domain "domain name"
2. Set mode of vtp equipment
switch(vlan)#vtp {server / client / transparent}
3. (optional) Set password on vtp
switch(vlan)#vtp password xxxx
4. Verify result
switch#show vtp status

VTP Pruning
1. Enable pruning
switch#vtp pruning

Wednesday, June 3, 2009

Cisco Lab 1 : LAN Switch Catalyst 2950

Objectives
1. Setup IP address of Ethernet switch
2. Configure telnet interface
3. Test switch features
3.1. Connection
3.2. Speed limit

Setup IP Address of Ethernet switch
1. Set interface of VLAN1 (management VLAN for telnet)
Switch(config) # int vlan1
2. Set IP address for interface VLAN1 (IP address of switch)
Switch(config-if) # ip address "IP_ADDR" "SUBNET_MASK"
3. Enable VLAN1
Switch(config-if) # no shutdown
4. Setting test
4.1. Switch # show running-configuration
4.2. Ping from computer connect from switch LAN interface (using static IP adress)

Configure telnet interface
1. Setup IP address of switch
2. Configure the maximum support sessions for telnet sessions (support to 5 sessions 0...4)
Switch(config) # line vty 0 4
3. Set the password for line vty (line virtual TeleType), we have to set since switch will not allow user to connect via telnet without password protection.
Switch(config-line) # password xxxxx
4. Set switch to prompt user to login
Switch(config-line) # login
5. Exit to Global configuration mode
Switch(config-if) # exit
6. Set up password for priviledge EXEC mode, we have to set for telnet user to configure the switch.
Switch(config) # enable secret xxxxxxxxxxxx

Test switch features
1. Test connection by using two laptops connect via FastEthernet port0/0 and 0/24
- Ping to see that ICMP packet.
- Test shutdown and no shutdown to disable and enable interface
2. Limit the speed 10 Mb or 100 Mb
- Select interface to set speed
Switch(config) # int FastEthernet0/0 ----> interface 0 port 0
Switch(config-if) # speed 100 ----> set speed to 100 Mbps
Switch(config-if) # duplex full ----> set full duplex communication
- See the result in laptop ethernet connection information

Tuesday, June 2, 2009

Cisco console

Introduction

People who work with Cisco network equipment need to be able to connect to the console port on their devices. In Windows, you can simply fire up HyperTerminal to get basic access to your devices. If you are using Linux, then you need to know how this can be done with an application called Minicom.

Hardware

First, you are going to need a Cisco console cable, a Cisco device, and a computer. If your computer has a serial port, then you can use the standard console cable that comes with every Cisco device.

If you do not have a serial port (like most new laptops), then you need to purchase a USB to Serial adapter that supports Linux. This device will allow you to use the standard Cisco cable, which has a serial port on one end.

Install Minicom

You can easily install Minicom by using "System > Administration > Synaptic Package Manager". Search for "minicom" and choose to install the package. Click "Apply" and Minicom should be installed within a few seconds.

Find the name of your serial port

Next, you need to find out is which device your serial port is mapped to. The easiest way to do this is to connect the console cable to a running Cisco device. Now open up a Terminal using "Applications > Accessories > Terminal" and type this command:

dmesg | grep tty

The output will look something like this:

Look in this output for words that contain "tty". In this case, it is "ttyS0". That meas the name of the device the corresponds to your serial port is "ttyS0". Now we are ready to configure Minicom to use this information.

Configure Minicom

Open a terminal using "Applications > Accessories > Terminal". Now type this command to enter the configuration menu of Minicom:

sudo minicom -s

Use the keyboard arrow keys to select the menu item labeled "Serial Port Setup" and then hit "Enter". This will open a window that looks similar to the one below:

Change your settings to match the ones in the picture above. Here is what I had to change:

  • Change the line speed (press E) to "9600"
  • Change the hardware flow control (press F) to "No"
  • Change the serial device (press A) to "/dev/ttyS0"
    • Be sure to use the device name that you learned in the previous step

Once your screen looks like mine, you can hit "Escape" to go back to the main menu. Next, you need to select "Save setup as dfl" and hit "Enter" to save these settings to the default profile. Then select "Exit Minicom" to exit Minicom... ;)

To find out if you have configured Minicom correctly, type this command in the terminal:

sudo minicom

After entering your Ubuntu user password, you should be connected to your Cisco device.

Note: You may want to delete the Minicom init string if you see a bunch of gibberish every time you connect to a device. To do this, enter Minicom configuration with:

sudo minicom -s

Then select "Modem and dialing". Press "A" to edit the Init string, and delete all characters so that it becomes empty. Make sure you save this to the default profile with "Save setup as dfl". You should no longer see gibberish when you connect to devices.

Create a desktop launcher

If you want to have quicker access to Minicom, you can create a desktop launcher.

  1. Right-click on the desktop and choose "Create launcher"
  2. Click on "Icon" and choose the picture you want to use
  3. Use the "Type" pull-down menu and select "Application in terminal"
  4. Create a name like "Cisco Console" in the field labeled "Name"
  5. Enter this command into the field labeled "Command"
    • sudo minicom
  6. Hit "OK" and your desktop launcher is ready for you to use.

References

Using the Cisco console in Linux