Pages

Showing posts with label networking. Show all posts
Showing posts with label networking. Show all posts

Saturday, January 31, 2015

Configuring Web IOU

Web IOU is a very useful software for novice network engineers as it provides the ability to simulate routers as well as switches and give you a simulation environment without taking much memory and processing power as GNS 3 does.

Steps to configure:

1. Create a virtual machine in VMWare Worskstation
          Download VM Ware Workstation. Clik Open under File and select the iou-web file.

2. VMWare Settings:
         In the virtual machine, click on Edit virtual machine settings. Make sure that you have a network adapter (VMNet1 Host Only) . This is a host only adapter which is used to connect to host machine as we need to use web browser in host to access the GUI.



3. Network Settings:
         A static ip address need to be provided to the virtual machine. Since, this is a linux machine, we can use the same command as we use in linux.

Also, In the Properties of your VMWare adapter(as highlighted below) listed in the network connections,set the ip address to 192.169.80.1 and check whether you can ping the above configured ip address. If it pings then you have successfully configured the web-iou.
                                                                                                                                                                   

Monday, December 8, 2014

Connecting Mininet Hosts to Internet

While working on my project on open vswitch I had to connect mininet hosts to internet to enable some functionalities in mininet hosts. After working on it for two days, I came to realise that its just 4 easy steps. If you are struggling with the same here is the solution.

Step 1: Make sure that your guest OS ie mininet OS is connected to the internet.

In virtualbox network setting make sure that you have a NAT interface enabled that allows you to connect to internet. It will have an ip address like this : 10.0.3.15 ie a class A address
Test by pinging www.google.com to make sure you are connected to internet from the guest OS ie Mininet OS.




Step 2: Start the network

Start a mininet netowrk with a switch and a host or any topology you prefer.

sudo mn  --switch ovsk --mac --topo single,2

The above command creates a network with single switch and two hosts.
This will create a switch s1 and two hosts h1 and h2.

Step 3: Connect the guest interface(that connects to the internet) to the ovs bridge

The command used to achieve this is an ovs-vsctl command which is used for quering and configuring openvswitchd(this is a process of openvswitch).

Open an xterm window for s1 as this command does not run directly on mininet.For this you need to ssh the guest OS from the host OS. If you don't know how to do this, you can refer to my earlier post titled "Error: Cannot Connect to Display"

Check the openvswitch configuration using the command: ovs-vsctl show
My switch had the following configuration.

root@mininet-vm:~# ovs-vsctl show
d27a9060-3edf-4ee7-a4cf-09e705c93f56
    Bridge "s1"
        Controller "ptcp:6634"
        Controller "tcp:127.0.0.1:6633"
            is_connected: true
        fail_mode: secure
        Port "s1-eth1"
            Interface "s1-eth1"
        Port "s1-eth2"
            Interface "s1-eth2"
        Port "s1"
            Interface "s1"
                type: internal
    ovs_version: "2.0.1"

Now, run the following command to connect eth1 to s1: ovs-vsctl add-port s1 eth1

Check the configuration again using ovs-vsctl show. The new interface that is added has been highlighted in red.

root@mininet-vm:~# ovs-vsctl show
d27a9060-3edf-4ee7-a4cf-09e705c93f56
    Bridge "s1"
        Controller "ptcp:6634"
        Controller "tcp:127.0.0.1:6633"
            is_connected: true
        fail_mode: secure
        Port "eth1"
            Interface "eth1"
        Port "s1-eth1"
            Interface "s1-eth1"
        Port "s1-eth2"
            Interface "s1-eth2"
        Port "s1"
            Interface "s1"
                type: internal
    ovs_version: "2.0.1"

Step 4: Run dhclient on hosts.

Open  xterm windows for h1 and h2 and run the following commands. The first command removes the ip from h1-eth0,the second command gets the ip address for h1-eth0 from dhcp server. The second command shows the interface description.

root@mininet-vm:~# ifconfig h1-eth0 0
root@mininet-vm:~# dhclient h1-eth0
root@mininet-vm:~# ifconfig
h1-eth0   Link encap:Ethernet  HWaddr 00:00:00:00:00:01
          inet addr:10.0.3.16  Bcast:10.0.3.255  Mask:255.255.255.0
          inet6 addr: fe80::200:ff:fe00:1/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:24 errors:0 dropped:0 overruns:0 frame:0
          TX packets:12 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:3304 (3.3 KB)  TX bytes:1764 (1.7 KB)

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:1252 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1252 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:151432 (151.4 KB)  TX bytes:151432 (151.4 KB)

Now check the internet connectivity using ping.

root@mininet-vm:~# ping www.google.com
PING www.google.com (216.58.216.164) 56(84) bytes of data.
64 bytes from sea15s02-in-f4.1e100.net (216.58.216.164): icmp_seq=14 ttl=54 time=61.9 ms
64 bytes from sea15s02-in-f4.1e100.net (216.58.216.164): icmp_seq=15 ttl=54 time=60.7 ms
^C
--- www.google.com ping statistics ---
15 packets transmitted, 2 received, 86% packet loss, time 14065ms
rtt min/avg/max/mdev = 60.707/61.336/61.965/0.629 ms

Summary:

The command that we have used to achieve internet connectivity to hosts are:

ovs-vsctl add-port s1 eth1
ifconfig h1-eth0 0
dhclient h1-eth0

Monday, November 25, 2013

Rebooting Alcatel


1. Run the command 'show bof' and copy the name of primary config file
 *A:NS085167016# show bof

2. Run the command 'file'
 *A:NS085167016# file
3. Run the command  delete
*A:NS085167016>file cf3:\ # delete config.cfg
4. Run the command 'admin reboot'
*A:NS085167016# admin reboot

In actual scenario the steps will be as follows:

*A:NS085167016# show bof
===============================================================================
BOF (Memory)
===============================================================================
    primary-image    cf3:\TiMOS-8.0.R10
    primary-config   cf3:\config.cfg
    autonegotiate
    duplex           full
    speed            100
    wait             3
    persist          off
    no li-local-save
    no li-separate
    console-speed    9600
===============================================================================
*A:NS085167016# file
*A:NS085167016>file cf3:\ # delete config.cfg
MINOR: CLI Could not find cf3:\config.cfg.
*A:NS085167016>file cf3:\ # exit
*A:NS085167016# admin reboot


Wednesday, November 20, 2013

Spanning Tree Protocol: Port states and roles


Spanning-Tree Port States
1.            Disabled - The port in this state does not participate in the STP operation (it is shut down).
2.            Blocking (BPDU processing state)- The port does NOT forward any Ethernet frames, does NOT accept any Ethernet frames (discards arriving frames), does NOT learn any MAC addresses. However, the portDOES process BPDU frames received from a neighboring switch. If the port transitions to this state (blocking), it can stay blocked for 20 seconds by default (max_age).
3.            Listening (Loop free technology learning state)- The port in this state CAN send and receive the BPDU frames. However, the port in this state does NOT learn any MAC addresses, and does NOT forward or process incoming frames either. All Ethernet frames are being discarded. The computation of loop free topology takes place in this state. If the port transitions to this state (listening), it can stay in this state for 15 seconds by default (forward_delay).
4.            Learning (MAC addresses learning state)- The port in this state already knows its role (root port or designated port ) in the STP domain. However, the port will not forward any Ethernet frames yet. It will be learning MAC addresses from the frames arriving at the port in order to populate MAC address table. This helps avoid too much flooding when the port transition to the forwarding state. If the port transitions to this state (learning), it can stay in this state for 15 seconds by default (forward_delay).
5.            Forwarding (Frames forwarding state)- The port in this state will forward all Ethernet frames as per switch operation. Also, the port will process all incoming Ethernet frames and will actively learn MAC addresses from the arriving traffic.

Spanning-Tree Port Roles
Root Port (RP) - It is a port on a non-root switch, which is the shortest (the best) path towards the root bridge. Root bridge does NOT have any root ports. (no shortest path to itself ;-))
Designated Port (DP) - It is a port that is in the forwarding state. All ports of the root bridge are designated ports (they are never in a blocking state). BPDU frames our sent out this port.


Non-Designated Port (NDP) or Blocking Port - It is a port that is in a blocking state in the STP topology.


                                                             STP PortFast 

PortFast allows switch ports that connect a host device (such as a printer or 
a workstation), to bypass the usual progression of STP states. Theoretically, 
a port connecting to a host device can never create a switching loop. Thus, 
Port Fast allows the interface to move from a blocking state to a forwarding 
state immediately, eliminating the normal 30 second STP delay. 

To configure PortFast on an interface: 

Switch(config)# int fa0/10 
Switch(config-if)# spanning-tree portfast 

To enable PortFast globally on all interfaces: 

Switch(config)# spanning-tree portfast default 

PortFast should not be enabled on switch ports connecting to another 
hub/switch, as this may result in a loop. Note that PortFast does not disable 
STP on an interface - it merely speeds up the convergence. 

PortFast additionally reduces unnecessary BPDU traffic, as TCN BPDU’s 

will not be sent out for state changes on a PortFast-enabled interface.