VLAN (Virtual LAN) is the logical technique that enables hosts across various LANs to communicate with each other as if they are on same LAN/wire.
VLAN splits the broadcast domain as host on one VLAN can't talk with host on another VLAN without the help of Layer 3 device.
There are two types of the switch port operation mode:
Trunk Mode: Allows multiple VLAN ID to pass through; Usually FastEthernet 0/24 port or GigabitEthernet port for inter-switch link. Multiple switches are interconnected via link connected to the port in Trunk mode.
Access Mode: Allows only one VLAN ID; Hosts are connected to the ports defined as Access mode. By default all ports on the switch are in Access Mode.
Let's see how to define VLAN, add interface/switch ports to VLAN and define TRUNK port
[ In this example we have FinanceDept and HumanResourceDept and we want to separate them using VLAN]
>en
Switch#config term
Switch#hostname Switch1
Switch1-config# vlan 2
Switch1-config-vlan#name HumanResourceDept
Switch1-config-vlan#vlan 3
Switch1-config-vlan#name FinanceDept
Switch1-config-vlan#exit
Switch1-config#exit
Switch1#show vlan
(Find which ports are being used by HumanResourceDept hosts and FinanceDept hosts; say F0/1,F0/2 are being used by HumanResourceDept hosts and F0/3 and F0/4 are being used by FinanceDept hosts)
Switch1#config term
Switch1-config#int F0/1
Switch1-config-if#switchport access vlan 2
Switch1-config-if#int F0/2
Swtich1-config-if#switchport access vlan 2
Switch1-config#int F0/3
Switch1-config-if#switchport access vlan 3
Switch1-config-if#int F0/4
Swtich1-config-if#switchport access vlan 3
Switch1-config-if# [press Ctrl + z]
Switch1#
Now check, if F0/1 and F0/2 are assigned to VLAN 2 , similarly check if F0/3 and F0/4 are assigned to VLAN 3
Switch1#show vlan
Now, hosts belonging to HumanResourceDept connected to Port F0/1 and F0/2 should be able to talk to each other. Perfom ping test.
Similarly do the test with FinanceDept hosts
VERY VERY IMPORTANT CONCEPTS:
>> Hosts on same vlan *must* has same subnet number. For example HumanResourceDept hosts should be under same subnet e.g 192.168.1.0/24 like Host1 IP: 192.168.1.2/24 Host2 IP: 192.168.1.3/24
>> Layer 3 device is required to establish communication between different VLANs
Now, lets define Trunk port on Switch1 so that we can interconnect it to another switch Switch2.
Switch1#config term
Switch1-config#int F0/24
Switch1-config-if#switchport mode trunk
Switch1-config-if# [Press Ctrl + z]
Switch1#show interface trunk
[This will show that F0/24 passes all the VLAN from one switch to another switch. Thus TRUNK mode is only enabled on FastEthernet port and GigabitEthernet port as it requires high bandwidth to pass all VLAN]
Do the same on Switch2
Switch>en
Switch#hostname Switch2
Switch2#config term
Switch2-config#int F0/24
Switch2-config-if#switchport mode trunk
Switch2-config-if# [Press Ctrl + z]
Switch2#show interface trunk
Let's say there is one host of FinanceDept plugged in on port F0/10 of switch2. For the hosts of FinanceDept on switch1 to talk with host on switch2, you have to define VLAN on switch2 and add the desired access port (here in our example: it's port F0/10 on that vlan 3).
Switch2#config term
Switch2-config#int F0/10
Switch2-config-if#switchport access vlan 3
Now, perform ping test between hosts of FinanceDept plugged in to Switch1 and Switch2. [ Friendly reminder: Hosts on same vlan should have same subnet number.]
Tuesday, March 8, 2011
Monday, February 14, 2011
Console Port Connection in Cisco Routers
The router has an EIA/TIA-232 asynchronous serial console port (RJ-45). Depending on the cable and the adapter used, this port appears as a DTE or DCE device at the end of the cable.
For connection to a PC running terminal emulation software e.g HyperTerminal in Windows machine, router is provided with an RJ-45 to DB-9 adapter cable (blue cable).
The default parameters for the console port are 9600 baud, 8 data bits, 1 stop bit, and no parity. The console port does not support hardware flow control.
For general overview of Hardware installation and Software configuration, please go thru' following links:
Software Configuration with upgrade techniques
Sunday, February 6, 2011
Update JAVA and Install NetBeans in Mac OS X 10.5
Mac OS X:
Check Mac OS X version by executing
> sw_vers
ProductName: Mac OS X
ProductVersion: 10.5.8
BuildVersion: 9L31a
Version 10.5.x
Java Version:
Check Java version in your system by executing
>java -version
java version "1.5.0_13"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_13-b05-237)
Java HotSpot(TM) Client VM (build 1.5.0_13-119, mixed mode, sharing)
This is J2SE 5.0
[On the top right corner, there is spotlight/search. Search for "Java Preferences". Open that application. It allows you to select/de-select various versions of Java in your system ]
Our task: Update J2SE 5.0 to Java 6 [ Java SE 6] :
[ Java replaced name J2SE with Java SE starting from version 6 ]
Step 1: Go to http://support.apple.com/downloads/ and search for " java for mac os x 10.5 "
Step 2: Download the Java for Mac OS X 10.5 update 4
http://support.apple.com/kb/DL848
Java for Mac OS X 10.5 Update 4 delivers improved reliability, security, and compatibility for Java SE 6, J2SE 5.0 and J2SE 1.4.2 on Mac OS X 10.5.7 and later. This release updates Java SE 6 to version 1.6.0_13, J2SE 5.0 to version 1.5.0_19, and J2SE 1.4.2 to 1.4.2_21.
Check java version:
>java -version
java version "1.6.0_13"
Java(TM) SE Runtime Environment (build 1.6.0_13-b03-211)
Java HotSpot(TM) 64-Bit Server VM (build 11.3-b02-83, mixed mode)
Step 3: Download the Java for Mac OS X 10.5 update 5
http://support.apple.com/kb/DL924
Caution: After installation of update 5, you have to restart the system.
Java for Mac OS X 10.5 Update 5 delivers improved reliability, security, and compatibility for Java SE 6, J2SE 5.0 and J2SE 1.4.2 on Mac OS X 10.5 .8 and later. This release updates Java SE 6 to version 1.6.0_15, J2SE 5.0 to version 1.5.0_20, and J2SE 1.4.2 to 1.4.2_22.
Check Java Version:
>java -version
java version "1.6.0_15"
Java(TM) SE Runtime Environment (build 1.6.0_15-b03-226)
Java HotSpot(TM) 64-Bit Server VM (build 14.1-b02-92, mixed mode)
Step 4: Download the Java for Mac OS X 10.5 update 8
Check Mac OS X version by executing
> sw_vers
ProductName: Mac OS X
ProductVersion: 10.5.8
BuildVersion: 9L31a
Version 10.5.x
Java Version:
Check Java version in your system by executing
>java -version
java version "1.5.0_13"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_13-b05-237)
Java HotSpot(TM) Client VM (build 1.5.0_13-119, mixed mode, sharing)
This is J2SE 5.0
[On the top right corner, there is spotlight/search. Search for "Java Preferences". Open that application. It allows you to select/de-select various versions of Java in your system ]
Our task: Update J2SE 5.0 to Java 6 [ Java SE 6] :
[ Java replaced name J2SE with Java SE starting from version 6 ]
Step 1: Go to http://support.apple.com/downloads/ and search for " java for mac os x 10.5 "
Step 2: Download the Java for Mac OS X 10.5 update 4
http://support.apple.com/kb/DL848
Java for Mac OS X 10.5 Update 4 delivers improved reliability, security, and compatibility for Java SE 6, J2SE 5.0 and J2SE 1.4.2 on Mac OS X 10.5.7 and later. This release updates Java SE 6 to version 1.6.0_13, J2SE 5.0 to version 1.5.0_19, and J2SE 1.4.2 to 1.4.2_21.
Check java version:
>java -version
java version "1.6.0_13"
Java(TM) SE Runtime Environment (build 1.6.0_13-b03-211)
Java HotSpot(TM) 64-Bit Server VM (build 11.3-b02-83, mixed mode)
Step 3: Download the Java for Mac OS X 10.5 update 5
http://support.apple.com/kb/DL924
Caution: After installation of update 5, you have to restart the system.
Java for Mac OS X 10.5 Update 5 delivers improved reliability, security, and compatibility for Java SE 6, J2SE 5.0 and J2SE 1.4.2 on Mac OS X 10.5 .8 and later. This release updates Java SE 6 to version 1.6.0_15, J2SE 5.0 to version 1.5.0_20, and J2SE 1.4.2 to 1.4.2_22.
Check Java Version:
>java -version
java version "1.6.0_15"
Java(TM) SE Runtime Environment (build 1.6.0_15-b03-226)
Java HotSpot(TM) 64-Bit Server VM (build 14.1-b02-92, mixed mode)
Step 4: Download the Java for Mac OS X 10.5 update 8
http://support.apple.com/kb/DL971
Java for Mac OS X 10.5 Update 8 delivers improved compatibility, security, and reliability by updating J2SE 5.0 to 1.5.0_26, and updating Java SE 6 to 1.6.0_22 for 64-bit capable Intel-based Macs . J2SE 1.4.2 is no longer being updated to fix bugs or security issues and remains disabled by default in this update.
Check Java version
>java -version
java version "1.6.0_22"
Java(TM) SE Runtime Environment (build 1.6.0_22-b04-307-9M3263)
Java HotSpot(TM) 64-Bit Server VM (build 17.1-b03-307, mixed mode)
After updating Java from J2SE 5.0 to Java SE 6.0 with latest updates, we are now ready to install NetBeans ( IDE for Java,C,PHP.. more Programming)
Go to http://netbeans.org/downloads/index.html
and download your desired bundle for the Mac OS. It has pretty neat chart showing the NetBeans IDE support integration.
Since I am going to do basic Java SE programming, I will download very basic NetBeans IDE.
Install the downloaded .dmg file for NetBeans IDE and you are good to go.
[I have assumed that you know how to install the download .dmg file for Mac. It's easy. Just double click the respective downloaded .dmg file, the wizard will automatically walk you through the installation process]
Java for Mac OS X 10.5 Update 8 delivers improved compatibility, security, and reliability by updating J2SE 5.0 to 1.5.0_26, and updating Java SE 6 to 1.6.0_22 for 64-bit capable Intel-based Macs . J2SE 1.4.2 is no longer being updated to fix bugs or security issues and remains disabled by default in this update.
Check Java version
>java -version
java version "1.6.0_22"
Java(TM) SE Runtime Environment (build 1.6.0_22-b04-307-9M3263)
Java HotSpot(TM) 64-Bit Server VM (build 17.1-b03-307, mixed mode)
After updating Java from J2SE 5.0 to Java SE 6.0 with latest updates, we are now ready to install NetBeans ( IDE for Java,C,PHP.. more Programming)
Go to http://netbeans.org/downloads/index.html
and download your desired bundle for the Mac OS. It has pretty neat chart showing the NetBeans IDE support integration.
Since I am going to do basic Java SE programming, I will download very basic NetBeans IDE.
Install the downloaded .dmg file for NetBeans IDE and you are good to go.
[I have assumed that you know how to install the download .dmg file for Mac. It's easy. Just double click the respective downloaded .dmg file, the wizard will automatically walk you through the installation process]
Sunday, October 10, 2010
How e-mail works? .. even a caveman can understand, yes even a caveman
SMTP (Port 25): handles outgoing mail
POP3/IMAP (Port 110/143): handles incoming mail
Let's have scenario: John Doe at hotmail.com sends email to Laura Johnson at gmail.com. John Doe uses Outlook to send an email. Laura uses web interface for gmail.com to access the email from John.
(Outlook, web interface are the front end for the users. Those are just the GUI interface)
John uses Outlook--> sends email from Hotmail.com account to Laura Johnson at Gmail.com account--> Laura checks email at www.gmail.com
1. Outlook connects to SMTP server at hotmail.com using Port 25
John writes an email to Laura
From: John.Doe@hotmail.com
To: Laura.Johnson@gmail.com
Subject: Hi Laura
Body: Hi Laura, How are you? What's your plan for this weekend? Let's go to the state fair at Dallas.
2. SMTP server at hotmail.com reads "TO" field and breaks it into two parts e.g Laura.Johnson@gmail.com is broken into "Laura.Johnson" and "gmail.com"
3. SMTP server at hotmail.com queries to DNS server; Who is SMTP server at gmail.com?
DNS server looks into MX records and replies back with one or more SMTP servers at gmail.com
4. SMTP server at hotmail.com connects to one of the SMTP server at gmail.com and handles the message. SENDMAIL and POSTFIX are the most popular MTA (Mail Transfer Agent) to deliver mail from one SMTP server to another another SMTP server. My preference is POSTFIX as it's free, easy, secure, customizable and popular too.
5. SMTP server at gmail.com recognizes that "Laura.Johnson" is the user at gmail.com and it handover the message to gmail POP3/IMAP server which puts the message in the Laura.Johnson's INBOX.
6. Laura logs in to www.gmail.com and checks her email.
It's that easy. Remember, we didn't talk about handling the junk emails.
It goes little bit complex for handling the junk emails. Please google about that if you want to know more...
Extra Treat:
SMTP commands:
HELO
EHLO
MAIL FROM
RCPT TO
DATA
RESET
QUIT
HELP
VRFY
EXPN
VERB
POP3 commands:
USER
PASS
QUIT
LIST
RETR
DELE
TOP
Wednesday, October 6, 2010
How can I setup VLAN on my Windows XP or Workstation?
If you have Intel NIC card, you are lucky. Intel PROset utility/driver allows you to add/remove VLAN on your workstation.
You could download Intel PROset from http://downloadcenter.intel.com/
Go to Downloads and Drivers and search for Intel PROset and choose your operating system
Install the downloaded executable file
(While installing it will prompt if you want to use MMC for the management, select YES)
It will also ask if you want to remove old drivers and settings, you can say NO
Once it is installed, Right Click "My Computer" --> Manage --> Device Manager --> Network Adapters --> Right Click "Inter(R) XXXX whatever it shows " --> Properties --> VLAN and add your desired VLAN ID
Try to access other devices on the same VLAN. It should work. If not contact your network administrator.
Other TIPS:
1. Start --> Run --> winmsd
if Processor properties has x86, your OS is 32 bit
if Processor properties has ia64, your OS is 64 bit
2. Device manager will show you the vendor of your NIC card. It could be Realtek, INTEL, Broadcom. The above procedure for VLAN will only work for INTEL NIC.
You could download Intel PROset from http://downloadcenter.intel.com/
Go to Downloads and Drivers and search for Intel PROset and choose your operating system
Install the downloaded executable file
(While installing it will prompt if you want to use MMC for the management, select YES)
It will also ask if you want to remove old drivers and settings, you can say NO
Once it is installed, Right Click "My Computer" --> Manage --> Device Manager --> Network Adapters --> Right Click "Inter(R) XXXX whatever it shows " --> Properties --> VLAN and add your desired VLAN ID
Try to access other devices on the same VLAN. It should work. If not contact your network administrator.
Other TIPS:
1. Start --> Run --> winmsd
if Processor properties has x86, your OS is 32 bit
if Processor properties has ia64, your OS is 64 bit
2. Device manager will show you the vendor of your NIC card. It could be Realtek, INTEL, Broadcom. The above procedure for VLAN will only work for INTEL NIC.
Monday, October 4, 2010
Remote Desktop in console mode
If you are using Windows XP RDP client, for RDP in console mode
mstsc /console
If you are using Windows Vista or above, it doesn't use /console session, it uses /admin session
mstsc /admin
mstsc /console
If you are using Windows Vista or above, it doesn't use /console session, it uses /admin session
mstsc /admin
Thursday, September 23, 2010
Rename multiple files in Linux
Lets' change all files with extension ‘.html’ to ‘.php’.
Rename all *.html files in one folder
rename
#rename .html .php *.html
Do the same operation recursively in a directory tree
find . -name "*.html" -exec rename .html .php {} \;
Those double quotes around *.info are important
If you want to be expert go to following link and don't forget to read all the comments :)
http://www.thegeekstuff.com/2009/06/how-to-rename-files-in-group/
Rename all *.html files in one folder
rename
#rename .html .php *.html
Do the same operation recursively in a directory tree
find . -name "*.html" -exec rename .html .php {} \;
Those double quotes around *.info are important
If you want to be expert go to following link and don't forget to read all the comments :)
http://www.thegeekstuff.com/2009/06/how-to-rename-files-in-group/
Subscribe to:
Posts (Atom)