Author Archives: maligawa

Inter-VLAN Routing and Static Routes

Statement of the Problem:

A network engineer is required to create a new network according the following information.

Image

There are 3 site locations: one in Melbourne, one in Sydney and a data centre which houses a server farm. Restrictions on access is not important, except that all machines should be able to access FS4 and PC5 and each PC should only be able to access its own respective FS (File Server). For example: PC1 should be able to access FS1, but not FS2 or FS3. PC2 should only be to access FS2 etc.

The network should be addressed as below:

Before you begin, cable the network as shown in the diagram.

Step 1: Erase all configurations on the switches.

Switch>enable
Switch#delete flash:vpn.dat
Delete filename [vpn.dat]?
Delete flash:/vpn.dat? [confirm]
%Error deleting flash:/vpn.dat (No such file or directory)
Switch#erase startup-config
Erasing the nvram filesystem will remove all configuration files! Continue? [confirm]
[OK]
Erase of nvram: complete
%SYS-7-NV_BLOCK_INIT: Initialized the geometry of nvram
Switch#reload
Proceed with reload? [confirm]

Step 2: Set the 3 Melbourne switches with a basic default setup (S1,S2,S3).

The purpose of the commands below is to set the console and telnet to require a password ,cisco, its hostname and not to do IP domain lookup if a command has been mistyped.

Switch>enable
Switch#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
Switch(config)#hostname S1
S1(config)#line console 0
S1(config-line)#logging synchronous
S1(config-line)#password cisco
S1(config-line)#login
S1(config-line)#line vty 0 15
S1(config-line)#password cisco
S1(config-line)#login
S1(config-line)#exit
S1(config)#enable secret cisco
S1(config)#no ip domain-lookup
S1(config)#ip default-gateway 192.168.99.1
S1(config)#int range fa0/1-24
S1(config-if-range)#shutdown
S1(config-if-range)#end
S1#
%SYS-5-CONFIG_I: Configured from console by console

S1#wr
Building configuration…
[OK]

Step 3: Reopen the switch ports on S3 to allow our computers access to the network.

S2#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
S2(config)#int range fa0/6, fa0/11, fa0/18
S2(config-if-range)#switchport mode access
S2(config-if-range)#no shutdown

Step4: Set up VTP on the Melbourne switches according to the information provided in the table – VTP switch configurations

S1#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
S1(config)#vtp mode server
Device mode already VTP SERVER.
S1(config)#vtp domain Widgets
Changing VTP domain name from NULL to Widgets
S1(config)#vtp password cisco
Setting device VLAN database password to cisco

S3#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
S3(config)#vtp mode client
Setting device to VTP CLIENT mode.
S3(config)#vtp domain Widgets
Changing VTP domain name from NULL to Widgets
S3(config)#vtp password cisco
Setting device VLAN database password to cisco

S2#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
S2(config)#vtp mode client
Setting device to VTP CLIENT mode.
S2(config)#vtp domain Widgets
Changing VTP domain name from NULL to Widgets
S2(config)#vtp password cisco
Setting device VLAN database password to cisco

Step 5: Set all interface fa0/1-5 to trunking mode on S1,S2 and S3.

This will allow all Virtual LANs (VLAN) to access the trunk routes as well as untagged traffic.

S1(config)#int range fa0/1-5
S1(config-if-range)#switchport mode trunk
S1(config-if-range)#switchport trunk native vlan 99
S1(config-if-range)#no shutdown

%LINK-5-CHANGED: Interface FastEthernet0/1, changed state to down

%LINK-5-CHANGED: Interface FastEthernet0/2, changed state to down

%LINK-5-CHANGED: Interface FastEthernet0/3, changed state to down

%LINK-5-CHANGED: Interface FastEthernet0/4, changed state to down

%LINK-5-CHANGED: Interface FastEthernet0/5, changed state to down
S1(config-if-range)#end
S1#
%SYS-5-CONFIG_I: Configured from console by console

Step 6: Set up the VLANs according to the table which is at the top of this post.

S1#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
S1(config)#vlan 99
S1(config-vlan)#name management
S1(config-vlan)#exit
S1(config)#vlan 10
S1(config-vlan)#name sales
S1(config-vlan)#exit
S1(config)#vlan 20
S1(config-vlan)#name engineering
S1(config-vlan)#exit
S1(config-vlan)#vlan 30
S1(config-vlan)#name administration
S1(config-vlan)#exit

Step 7: Verify that the VLAN’s have been distrubuted accross S2 and S3.

S3#show vlan brief

VLAN Name                             Status    Ports
—- ——————————– ——— ——————————-
1    default                          active    Fa0/6, Fa0/7, Fa0/8, Fa0/9
Fa0/10, Fa0/11, Fa0/12, Fa0/13
Fa0/14, Fa0/15, Fa0/16, Fa0/17
Fa0/18, Fa0/19, Fa0/20, Fa0/21
Fa0/22, Fa0/23, Fa0/24, Gig1/1
Gig1/2
10   sales                            active    
20   engineering                      active    
30   administration                   active    
99   management                       active
1002 fddi-default                     active
1003 token-ring-default               active
1004 fddinet-default                  active
1005 trnet-default                    active

Step 8: Configure the management VLAN interfaces on S1, S2 and S3 according to the addressing table.

S1(config)#int vlan 99
S1(config-if)#
%LINK-5-CHANGED: Interface Vlan99, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan99, changed state to up

S1(config-if)#ip address 192.168.99.2 255.255.255.0
S1(config-if)#end

S2(config)#int vlan 99
S2(config-if)#
%LINK-5-CHANGED: Interface Vlan99, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan99, changed state to up

S2(config-if)#ip address 192.168.99.3 255.255.255.0
S2(config-if)#end

S3(config)#int vlan 99

%LINK-5-CHANGED: Interface Vlan99, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan99, changed state to up
S3(config-if)#
S3(config-if)#ip address 192.168.99.4 255.255.255.0
S3(config-if)#end

Step 9: Configure the switchports on S2 to the intended VLANs – check the switchport assignment table.

S2#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
S2(config)#int range fa0/6-10
S2(config-if-range)#switchport access vlan 10
S2(config-if-range)#interface range fa0/11-17
S2(config-if-range)#switchport access vlan 20
S2(config-if-range)#interface range fa0/18-24
S2(config-if-range)#switchport access vlan 30
S2(config-if-range)#end
S2#
%SYS-5-CONFIG_I: Configured from console by console

S2#wr
Building configuration…
[OK]

Step 10: Erase all three routers settings.

Router#erase startup
Erasing the nvram filesystem will remove all configuration files! Continue? [confirm]
[OK]
Erase of nvram: complete
%SYS-7-NV_BLOCK_INIT: Initialized the geometry of nvram
Router#reload
Proceed with reload? [confirm]

Step 11: Configure the Melbourne Router (MEL) with hostname, priveledged exec mode password, console and Telnet passwords.

Router#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#enable secret cisco
Router(config)#hostname MEL
MEL(config)#no ip domain-lookup
MEL(config)#line console 0
MEL(config-line)#logging synchronous
MEL(config-line)#password cisco
MEL(config-line)#login
MEL(config-line)#line vty 0 4
MEL(config-line)#password cisco
MEL(config-line)#login
MEL(config-line)#end
MEL#
%SYS-5-CONFIG_I: Configured from console by console

MEL#wr
Building configuration…
[OK]

Step 12: Configure the subinterfaces on the MEL router according to the table above.

Once this has been configured-  PC1, PC2 and PC3 will be able to ping each other.

MEL#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
MEL(config)#int fa0/0
MEL(config-if)#no shutdown

%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up

MEL(config-if)#
MEL(config-if)#int fa0/0.10
MEL(config-subif)#
%LINK-5-CHANGED: Interface FastEthernet0/0.10, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0.10, changed state to up

MEL(config-subif)#encapsulation dot1q 10
MEL(config-subif)#ip address 192.168.10.1 255.255.255.0
MEL(config-subif)#int fa0/0.20
MEL(config-subif)#
%LINK-5-CHANGED: Interface FastEthernet0/0.20, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0.20, changed state to up

MEL(config-subif)#encapsulation dot1q 20
MEL(config-subif)#ip address 192.168.20.1 255.255.255.0
MEL(config-subif)#int fa0/0.30

%LINK-5-CHANGED: Interface FastEthernet0/0.30, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0.30, changed state to up
MEL(config-subif)#
MEL(config-subif)#encapsulation dot1q 30
MEL(config-subif)#ip address 192.168.30.1 255.255.255.0
MEL(config-subif)#int fa0/0.99

%LINK-5-CHANGED: Interface FastEthernet0/0.99, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0.99, changed state to up
MEL(config-subif)#
MEL(config-subif)#encapsulation dot1q 99 native
MEL(config-subif)#ip address 192.168.99.1 255.255.255.0
MEL(config-subif)#end
MEL#
%SYS-5-CONFIG_I: Configured from console by console

MEL#wr
Building configuration…
[OK]

Step 13: Configure the Serial interface on the MEL router which connects to the DATA router. This side of the cable has the DCE.

MEL#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
MEL(config)#int serial 0/1/0
MEL(config-if)#ip address 192.168.0.2 255.255.255.252
MEL(config-if)#clock rate 64000
MEL(config-if)#no shutdown

Step 14: Configure the DATA router. It has the DTE end of the serial cable with the MEL router and the DCE end with the SYD router.

Router>en
Router#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#hostname DATA
DATA(config)#enable secret cisco
DATA(config)#line console 0
DATA(config-line)#logging synchronous
DATA(config-line)#password cisco
DATA(config-line)#login
DATA(config-line)#line vty 0 4
DATA(config-line)#password cisco
DATA(config-line)#login
DATA(config-line)#exit
DATA(config)#int serial 1/0
DATA(config-if)#ip address 192.168.0.1 255.255.255.252
DATA(config-if)#no shutdown

%LINK-5-CHANGED: Interface Serial1/0, changed state to up
DATA(config-if)#int serial 1/1
DATA(config-if)#clock rate 64000
DATA(config-if)#ip address 192.168.0.5 255.255.255.252
DATA(config-if)#no shut

%LINK-5-CHANGED: Interface Serial1/1, changed state to down
DATA(config-if)end
DATA#
%SYS-5-CONFIG_I: Configured from console by console
DATA#wr
Building configuration…
[OK]

Step 15: Configure the SYD Router. This router has both ends of serial connections with DTE.

Router>en
Router#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#hostname SYD
SYD(config)#enable secret cisco
SYD(config)#no ip domain-lookup
SYD(config)#line console 0
SYD(config-line)#logging syn
SYD(config-line)#logging synchronous
SYD(config-line)#password cisco
SYD(config-line)#login
SYD(config-line)#line vty 0 4
SYD(config-line)#password cisco
SYD(config-line)#login
SYD(config-line)#exit
SYD(config)#int serial 1/1
SYD(config-if)#ip address 192.168.0.6 255.255.255.252
SYD(config-if)#no shutdown

%LINK-5-CHANGED: Interface Serial1/1, changed state to up

SYD(config-if)#int serial 1/0
SYD(config-if)#ip address 192.168.0.10 255.255.255.252
SYD(config-if)#no shutdown

%LINK-5-CHANGED: Interface Serial1/0, changed state to down
SYD(config-if)#end
SYD#
%SYS-5-CONFIG_I: Configured from console by console

Step 16: Configure the MEL router Serial Interface to the SYD Router. This end has the DCE so the clock rate must be set.

MEL(config)#int serial 0/1/1
MEL(config-if)#clock rate 64000
MEL(config-if)#ip address 192.168.0.9 255.255.255.252
MEL(config-if)#no shut

%LINK-5-CHANGED: Interface Serial0/1/1, changed state to up

MEL(config-if)#
MEL(config-if)#end
%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/1/1, changed state to up

Step 17: Configure the Data Switch (DS) with the hostname, default-gateway and appropriate passwords.

Switch>enable
Switch#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
Switch(config)#hostname DS
DS(config)#enable secret cisco
DS(config)#no ip domain-lookup
DS(config)#ip default-gateway 192.168.199.1
DS(config)#line console 0
DS(config-line)#logging synchronous
DS(config-line)#password cisco
DS(config-line)#login
DS(config-line)#line vty 0 15
DS(config-line)#password cisco
DS(config-line)#login
DS(config-line)#exit
DS(config)#end
DS#
%SYS-5-CONFIG_I: Configured from console by console

DS#wr
Building configuration…
[OK]

Step 18: Configure the DS switch with the vlan information and addressing information that was supplied above.

DS#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
DS(config)#vlan 10
DS(config-vlan)#name sales
DS(config-vlan)#exit
DS(config)#vlan 20
DS(config-vlan)#name engineering
DS(config-vlan)#exit
DS(config)#vlan 30
DS(config-vlan)#name administration
DS(config-vlan)#exit
DS(config)#int fa0/1
DS(config-if)#switchport mode trunk
DS(config-if)#switchport trunk native vlan 99
DS(config-if)#no shutdown
DS(config-if)#exit
DS(config)#vlan 99
DS(config-vlan)#name management
DS(config-vlan)#exit
DS(config)#int vlan 99
DS(config-if)#
%LINK-5-CHANGED: Interface Vlan99, changed state to up

DS(config-if)#ip address 192.168.199.2 255.255.255.0
DS(config-if)#exit
DS(config)#int fa0/6
DS(config-if)#switchport access vlan 10
DS(config-if)#int fa0/11
DS(config-if)#switchport access vlan 20
DS(config-if)#int fa0/18
DS(config-if)#switchport access vlan 30
DS(config-if)#end
DS#
%SYS-5-CONFIG_I: Configured from console by console

Step 19: Configure the subinterfaces on the DATA router.
This will allow FS1, FS2,FS3 to ping each other.

DATA(config)#int fa0/0
DATA(config-if)#no shutdown

%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up
DATA(config-if)#int fa0/0.10
DATA(config-subif)#
%LINK-5-CHANGED: Interface FastEthernet0/0.10, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0.10, changed state to up

DATA(config-subif)#encapsulation dot1q 10
DATA(config-subif)#ip address 192.168.110.1 255.255.255.0
DATA(config-subif)#int fa0/0.20

%LINK-5-CHANGED: Interface FastEthernet0/0.20, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0.20, changed state to up
DATA(config-subif)#
DATA(config-subif)#encapsulation dot1q 20
DATA(config-subif)#ip address 192.168.120.1 255.255.255.0
DATA(config-subif)#int fa0/0.30

%LINK-5-CHANGED: Interface FastEthernet0/0.30, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0.30, changed state to up
DATA(config-subif)#
DATA(config-subif)#encapsulation dot1q 30
DATA(config-subif)#ip address 192.168.130.1 255.255.255.0
DATA(config-subif)#int fa0/0.99

%LINK-5-CHANGED: Interface FastEthernet0/0.99, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0.99, changed state to up
DATA(config-subif)#encapsulation dot1q 99 native
DATA(config-subif)#ip address 192.168.199.1 255.255.255.0
DATA(config-subif)#end
DATA#
%SYS-5-CONFIG_I: Configured from console by console

Step 20: Add in static routes to route traffic between the MEL router and the DATA router
After this setp PC1,PC2, PC3, PC4 will be able to access FS1,FS2 and FS3 – plus all interfaces (except for the unconfigured devices behind SYD router)

DATA(config)#ip route 192.168.10.0 255.255.255.0 serial 1/0
DATA(config)#ip route 192.168.20.0 255.255.255.0 serial 1/0
DATA(config)#ip route 192.168.30.0 255.255.255.0 serial 1/0
DATA(config)#ip route 192.168.99.0 255.255.255.0 serial 1/0

MEL(config)#ip route 192.168.110.0 255.255.255.0 serial 0/1/0
MEL(config)#ip route 192.168.120.0 255.255.255.0 serial 0/1/0
MEL(config)#ip route 192.168.130.0 255.255.255.0 serial 0/1/0
MEL(config)#ip route 192.168.199.0 255.255.255.0 serial 0/1/0

Beginner Sinhala – Lesson 9 – Verbs – Past

As far as verb forms go in Sinhala, the past tense form is the most difficult to master. It is here that irregular verb forms become truly irregular and even the regular verbs change their base substantially.
The easiest method I believe is to go through the exceptions first and then cover the rules later.
The verb එනවා “enawaa”  has a past tense of ආවා “aawaa” . The verb root has changed from “e” to “aa”. The එ “e” can be considered its present tense verb root and ආ “aa” the past tense verb root.
The verb යනවා “yanawaa” has a past tense of ගියා “giyaa”. The verb root has changed from ය “ya” to ගි “gi”. Both the verbs are similar to their respective hindi counterparts (aayaa and gayaa) which indicates a strong relationship with sanskrit.
The verb කරනවා “karanawaa” has a past tense of කලා “kalaa” (or colloquially කරා “karaa”). The verb බොනවා “bonawaa” has a past tense of බීවා “biiwa”. බී “bii” is the past tense verb root.
The verb තියෙනවා “thiyenawa” has a past tense of තියුනා “thiyunaa” and තිබුනා “thibunaa” (of which තියුනා “thiyuna” is regular). The verb ඉන්නවා “innawa” has a past tense of හිටියා “hitiyaa”. The verb වෙනවා “wenawaa” has a past tense of වුනා “wunaa” / උනා “unaa”.
The verb දෙනවා “denawaa” has a past tense of දුන්නා “dunnaa” and the verb ගන්නවා “gannawaa” has a past tense of ගත්තා “gaththaa”.

Lets put some of these irregular verb forms into practice.

මම පොතක් දුන්නා
mama pothak dunnaa
I gave a book

ඊයේ ඔයා වැඩ කළා
iiyee oya wAda kalaa
You worked ( වැඩ කරන්න / wAda karanna = to work) yesterday

එයා බත් ගත්තා
eyaa bath gaththaa
He/she took the rice

මිනිහා ආවා… මනිහා ගියා
minihaa aawaa.. minihaa giyaa
The man came… the man went..

 

Beginner Sinhala Lesson 8 – Relative phrases I

In English, there is a number of relative pronouns (such as who, what, that, which), which denote a relationship between a verb and a noun which is not the main emphasis of the sentence. For example: The train that comes today – The boy who read the book. In Sinhala there is no relative pronouns, so a special verb form takes place of the relative pronoun in English. There are two forms which we will cover in this lesson – both of which are built upon the present tense verb root.

The first one is the present tense form minus the වා waa. This forms the present relative verb form.  The second one is the present tense verb base, with a පු pu added to the end. This form one of the past relative forms. Lets take the above two English sentences and translate them into Sinhala:

1. අද එන කෝච්චිය
ada ena koochchiya
today that-comes train
The train that comes today.

2. පොත කියවපු කොල්ලා
potha kiyawapu kollaa
book who-read boy
The boy who read the book.

Even though these sentences are a complete idea, they are not complete sentences. Lets complete them.
1. අද එන කෝච්චිය පරක්කුයි
ada ena koochchiya parakkuy
today that-comes train late (is)
The train that comes today is late.

2. පොත කියවපු කොල්ලා ගෙදර යනවා
potha kiyawapu kollaa gedara yanawaa
book who-read  boy      home  is going
The boy who read the book is going home.

Below is small table which shows a sample of verb forms. Notice that all the present relative verb forms are regular. The past tense relative verb forms for common verbs tends to be irregular, with the form for went (ගිය giya) not even closely resembling the present form or ending with the පු pu suffix. The reason will be shown in the next lesson. As a side note, in Sinhala there is only around 15 verbs that can be considered irregular – with five only being truly troublesome.

එනවා (someone) comes
enawaa
එන (that/which/who) comes
ena
ආපු (that/which/who) came
aapu
ගහනවා  (someone) beats
gahanawaa
ගහන (that/which/who) beats
gahana
ගහපු (that/which/who) beat
gahapu
උයනවා (someone) cooks
uyanawaa
උයන (that/which/who) cooks
uyana
උයපු (that/which/who) cooked
uyapu
බලනවා (someone) watches
balanawaa
බලන (that/which/who) watches
balana
බලපු (that/which/who) watched
balapu
දුවනවා (someone) runs
duwanawaa
දුවන (that/which/who)  runs
duwana
දුවපු (that/which/who) ran
duwapu
දෙනවා (someone) gives
denawaa
දෙන (that/which/who) gives
dena
දීපු (that/which/who) gave
diipu
යනවා (someone) goes
yanawaa
යන (that/which/who) goes
yana
ගිය (that/which/who) went
giya
කරනවා (someone) does
karanawaa
කරන (that/which/who) does
karana
කරපු (that/which/who) did
karapu

Now that we have the paradigm for forming relative phrases, lets provide some meaningful examples.

ගහේ නඟින කොල්ලට බලන්න
gahee naGina kollata balanna
Look at the boy who climbs the tree.

අම්මා ගිය කඩේ වහනවා
ammaa giya kadee wahanawaa
The shop Mummy went to is closing.
මම කියවන පොත හොඳයි
mama kiyawana potha honday
The book I am reading is good.

ඔයා ගහපු කොල්ලා එනවා
oyaa gahapu kollaa enawaa
The boy you hit is coming.

අරහේ පියාඹන කුරුල්ලට බලන්න
arahee piyaaBana kurullata balanna
Look at the bird who is flying away.

සින්දු කියපු ඒ කෙල්ල තරඟයේ දිනයි
sindu kiyapu ee kella tharaGayee dinay
That girl who sung will win the competition.

Beginner Sinhala Lesson 7 – Infinitive / Imperative

In the Sinhala language, the infinitive and the imperative are identical – that is the verb stem + න්න “nna”.
The infinitive in English is rendered as “to” + verb. To come, to go, to run are all infinitives. Imperatives are rendered “Come”, “Go”, “Run” which are used as a command. Therefore, in English the verb root and the imperative form is the same – as the infinitive form and the imperative are the same in Sinhala. In Sinhala, the  න්න “nna” form is also the polite form – which is often translated as please + verb. There are impolite forms, which we will also cover. The verb root + පන් “pan” signifies speaking with someone who you know well. It is impolite to use this form with strangers.  The verb root + පිය “piya” has an even more impolite connotation and is never used, except to show anger towards the hearer. It is advisable that foreigners only use  න්න “nna” until they know exactly what they are doing.

Please come
එන්න “enna”
Come!
වරෙන් “varen”
Come thou!
Please go
යන්න “yanna”
Go!
පලයන් “palayan”
Go Away!
පලාපිය “palapiya”
Please give
දෙන්න “denna”
Give
දීපන් / දීයන් diipan / diiyan
Give thou
දීපිය “diipiya”
Please hit
ගහන්න “gahanna”
Hit!
ගහපන් “gahapan”
Hit Thou!
ගහපිය “gahapiya”
Please eat
කන්න “kanna”
Eat!
කාපන් “kaapan”
Eat Thou!
කාපිය “kaapiya”
Please take
ගන්න “ganna”
Take!
ගනින් “ganin”
Take Thou!
ගනිපිය “ganipiya”
Please do
කරන්න “karanna”
Do!
කරපන් “karapan”
Do Thou!
කරපිය “karapiya”
Please search
හොයන්න “hoyanna”
Search!
හොයපන් “hoyapan”
Search Thou!
හොයපිය “hoyapiya”
Please drink
බොන්න “bonna”
Drink!
බීපන් “biipan”
Drink Thou!
බීපිය “biipiya

From looking at the table one can notice that a number of the verbs have altered corresponding forms. Noticeably the ones that would be commonly used in a rough manner (Go, Come, Give, Take). Of all the forms, the command for come is the most interesting. Its infinitive form is එන්න enna, but its impolite imperative form is varen – which bares no resemblance. What is even more odd is that the only explanation for it is that it derives from tamil “Vaa” where varen means  “I come”. Come, Go , Take and Give are all irregular verbs. The impolite imperative form for go actually derives from the verb පලනවා palanava – “flee” – so that form isn’t stictly irregular. Give’s (දෙන්න) forms are also due to the fact that the past tense root and participle root are different to the present tense root. The other differences between forms are due the past tense form being used in the impolite imperative.

There is also another imperative form that is impolite which is used for more than one person, which is verb root + පල්ලා “pallaa”. For example: කරපල්ලා “karapalla” you all do! දීපල්ලා “diipalla” you all give බීපල්ලා “biipalla” you all drink.

Now its time to demonstrate the above and see the imperative and infinitive in action.
මෙහේ එන්න
mehee enna
Please come here

කන්න එන්න
kanna enna
Please come to eat

ඉස්කෝලෙට යන්න
iskooleta yanna
Please go to school

අරහේ පලයන්
arahee palayan
Go there! (Go away!)

මම කෑම කන්න පටන් ගන්නන්
mama k@@ma kanna patan gannan
I will start to eat food.

කන්න මම ගෙදර යනවා
kanna mama gedara yanawaa
I am going home to eat (to eat, I home go-am)

මේ බීම බීපල්ලා
me biima biipallaa
(You all) drink this drink!

මම ඉගෙන ගන්න ඉස්කෝලේ යනවා
mama igena ganna iskoolee yanawaa
I go to school to learn (I to learn school[to] go-am)
(learn = ඉගෙන ගන්නවා)

Beginner Sinhala – Lesson 5 – Present tense.

The present tense in spoken Sinhala ends in -නවා “nawaa” (which is also the dictionary form of all the verbs in sinhala). The Sinhala verb is composed of the root plus a suffix which denotes tense and aspect. In written Sinhala the verb also agrees in number and person, but for the spoken Sinhala present tense, there is only one common marker.

Below is a list of some common verbs in Sinhala.

Verb Present Verb root
එනවා
enawaa “comes”

e
යනවා
yanawaa “goes”

ya
දෙනවා
denawaa “gives”
දෙ
de
ගහනවා
gahawaa “beats”
ගහ
gaha
අරිනවා
arinawaa “opens”
අරි
ari
අහනවා
Ahanawaa “listens”,”asks”
අහ
aha
වහනවා
wahanawaa “closes”
වහ
waha
නානවා
naanawa “bathe”
නා
naa
බලනවා
balanawaa “watches”
බල
bala
කරනවා
karanawaa “does”
කර
kara
කතා කරනවා
katha karanava “talks”
(කතා) කර
kathaa kara

Sinhala is basically a Subject – Object – Verb (SOV) language (compared to English which is SVO) but the order can change freely – unlike in English. The basic sentence structure is demonstrated below and show the function of the present tense marker (නවා).

මම ටී වී එක බලනවා
mama tee vee eka balanawaa
I watch television

ඔයා මට පොතක් දෙනවා
oyaa mata pothak denawaa
You give me a book

මගේ මල්ලී එනවා
magee malii enawaa
My younger brother comes

එයාල ගෙදර යනවා
eyaala gedara yanawaa
They are going home

මම එයාගෙන් අහනවා
mama eyaagen ahanawa
I ask them (lit, I ask from them)

මගේ අම්මා දොර අරිනවා
magee ammaa dora arinawaa
My Mum opens the door

තාත්ත නානවා
thaaththa naanawaa
Father bathes

එයා කොටුවෙන් ඔයාට ගහනවා
eyaa kotuwen oyaata gahanawaa
He beats you with the stick

The verb “to be” is translated by two seperate verbs in Sinhala – according to whether the subject is living or non-living.
For a living subject, ඉන්නවා “innawaa” is used to express that something “is” For example: මම ගෙදර ඉන්නවා “mama gedara innawa” “I am home”.

For a non living subject, තියෙනවා “thiyenawaa” is used. For example: පොත මෙසේ උඩ තියෙනවා , “potha mesee uda thiyenawa” “The book is on the table”. Here the posposition උඩ, uda is employed to mean on. We will cover this in a later lesson. When a subject and තියෙනවා “thiyenawaa” is expressed without a locational object it is best translated to mean “there is” for example: කාර් එකක් තියෙනවා   “kaar ekak thiyenava” – there is a car.

Examples:

මම ගහේ ඉන්නවා
mama gahee innawaa
I am in the tree

එයා කාර් එකේ ඉන්නවා
eyaa kaar ekee innawa
She is in the car

අපි ගෙදර ඉන්නවා
api gedara innawaa
We are home

ගස් තියෙනවා
gas thiyenawaa
There are trees

මෙහෙ කාර් තියෙනවා
mehe kaar thiyenawaa
There are cars here

 

Beginner Sinhala Lesson 4 – Pronouns

Beginner Sinhala Lesson 4

Pronouns.

Pronouns in Sinhala are divided into four distinct classes according to distance. මේ “me” indicates that the thing or person being referred to is in close proximity to the speaker. ඔ “o” indicates that the thing or person being referred to is in close proximity to the hearer. Infact in modern Sinhala, words such as ඔයා “Oya”, there person near you, are taking to literally mean “you”. අර “ara” indicates that the thing or person is relatively distant to both the speaker and the listener – “over there”. එ “e” refers to a person or thing that was mentioned earlier in the conversation or something that both are already aware of.

මම
mama
I
මගේ
magee
My
මගෙන්
magen
From / by me
මට
mata
to me
මාව
maawa
Me
මෙයා
Meyaa
‘This one’
මෙයාගේ
Meyaagee
‘This one’ ‘s
මෙයාගෙන්
Meyaagen
From/by ‘this one’
මෙයාට
meyaata
to ‘this one’
මෙයාව
Meyaawa
‘This one’ (acc)
 ඔයා
oyaa
You
ඔයාගේ
oyaagee
Your
ඔයාගෙන්
oyaagen
From / by you
ඔයාට
oyaata
To you
ඔයාව
oyaawa
You (acc)
අරයා
arayaa
‘That one there’
අරයාගේ
arayaagee
‘That one there’ ‘s
අරයාගෙන්
arayaagen
From /by ‘that one there’
අරයාට
arayaata
To ‘that one there’
අරයාව
arayaawa
‘That one there’ (acc)
එයා
eyaa
He / She
එයාගේ
eyaagee
His / Her
එයාගෙන්
eyaagen
From / by him / her
එයාට
eyaata
to him / her
එයාව
eyaawa
him / her
අපි
api
We
අපේ
apee
Our
අපෙන්
apen
From / by us
අපිට
apita
To us
අපිව
apiwa
us
ඔයාලා
oyaalaa
You (plural)
ඔයාලගේ
oyalaage
Your (plural)
ඔයාලගෙන්
From / by you (plural)
ඔයාලට
To you (plural)
ඔයාලව
you (acc plural)

The plural affix “ලා” can be added to මෙයා, අරයා and එයා (meyaa, arayaa, eyaa) to make them plural in number.

Examples

ඔයාට පොතක් තියෙනවා
oyaata pothak thiyenawaa
‘You have a book’ (lit. to you a book there is)

මගේ කාර් එක
magee kaar eka
‘My car’

එයාගෙන් අහන්න
eyaagen ahanna
‘Ask from him

අපි එයාව දැක්කා
api eyaawa d@kkaa
We saw him

මෙයාලගේ කෑම
meyalaage k@@ma
These one’s food

Hardware Keylogger

Hardware Keylogger schematic

Cisco Routers – Delay down for backup connections.

Currently in my job I am using a Cisco Series 2900 router.

The Cisco router has a primary connection (which is fibre), a secondary connection (which is ADSL) and a tertiary connection (which is through mobile 3G connection).

We had been noticing that our site-to-site VPN links have been going down – and that some users have been losing some of their work through our ERP system. Upon investigation, the problem seemed to be our fibre link dropping momentarily. Everytime the link was dropping, the backup connection tried to take over and failed due to the site-to-site VPNs not being configured to take the backup link automatically. In fact, there is no way to re-establish a VPN link automatically because VPNs route the traffic according to subnet and only one subnet can be assigned to one tunnel with one endpoint.

Since the link was going down for about 5 seconds (due to saturation and ISP issues) and the client ERP software could only handle a drop out of up to 30 seconds before it would lose all data and users would become angry – I had to find a solution. And I found one!

conf t
track 1 ip sla 1 reachability
delay down 180
track 2 ip sla 1 reachability
delay down 180
[Ctrl Z]
wr

I typed the following into a telnet session to our Cisco router. Apparently the backups have a maximum delay  of 3 minutes (180) of being in a state of “down” (delay down) before it would try the next backup link. This was just what I needed as it would take me around 3 minutes to manually switch over our main site-to-site VPN connection to the backup connections. As the drop outs were occuring for no longer than 5 seconds, the users were not losing valuable data.

track 1 refers to the first backup and track 2 refers to the second backup

After employing a fix, I then began to work with our ISP into making our connection much more reliable – but I was quite happy to find this fix.

Hash Search – In C

#include <stdio.h>
#include <string.h>
#include <malloc.h>

#define MAXLEN 80
#define HASHSIZE 31             // random prime.
#define SHIFTBY 3               // each group size in hashing.

typedef struct node node;
typedef char *type;
typedef node *hashtable[HASHSIZE];

struct node {
   int val;
   char *key;
   node *next;
};

int hGetIndex(char *key) {
   /*
    * returns index into hashtable applying hash function.
    * uses shift-folding followed by mod function for hashing.
    */
   int i, n, finaln=0;
   char *keyptr;

   for(keyptr=key; *keyptr; finaln+=n)
       for(i=0, n=0; i<SHIFTBY && *keyptr; ++i, ++keyptr)
              n = n*10 + *keyptr;
   finaln %= HASHSIZE;

   return finaln;
}

void hInsert(hashtable h, char *key, int val) {
    /*
     * insert s in hashtable h.
     * use shift-folding followed by mod function for hashing.
     * does NOT check for duplicate insertion.
     */
   node *ptr = (node *)malloc(sizeof(node));
   int index = hGetIndex(key);

   ptr->key = strdup(key);
   ptr->val = val;
   ptr->next = h[index];

   h[index] = ptr;
   printf("h[%d] = %s.\n", index, key);
}

int hGetVal(hashtable h, char *key) {
   /*
    * returns val corresponding to key if present in h else −1.
    */
   node *ptr;

   for(ptr=h[hGetIndex(key)]; ptr && strcmp(ptr->key, key); ptr=ptr->next)
      ;
   if(ptr)
       return ptr->val;
   return −1;
}

void printHash(hashtable h) {
    /*
     * print the hashtable rowwise.
     */
   int i;
   node *ptr;

   for(i=0; i<HASHSIZE; ++i) {
       printf("%d: ", i);
       for(ptr=h[i]; ptr; ptr=ptr->next)
              printf("%s=%d ", ptr->key, ptr->val);
       printf("\n");
   }
}

int main() {
    char s[MAXLEN];
    int i = 0;
    hashtable h = {"abc"};

    printf("Enter the string to be hashed: ");
    gets(s);

    while(*s) {
       hInsert(h, s, i++);
       printf("Enter the string to be hashed(enter to end): ");
       gets(s);
    }
    printf("Enter the string to be searched: ");
    gets(s);

    while(*s) {
       printf("%s was inserted at number %d.\n", s, hGetVal(h, s));
       printf("\nEnter the string to be searched(enter to end): ");
       gets(s);
    }
    //printHash(h);

    return 0;
}

Intermediate Sinhala – Lesson 10 – Politics

Intermediate Sinhala – Lesson 10

Dialogue

ගයන්: එන සුමනේ චන්දෙ තියෙන හින්ද විරුද්ද පක්ෂ විසින් විහාරමහාදේවි පාර්ක් එකේ රැළියක් පවත්තනවා. කැම්පස් එකෙන් යාළුවන් සහම්රු ඒකට යනවා එක්සත් ජාතික පක්ෂයට ආධාර දෙන්න. මමයි යන එක ගැන සලකනවා.
රොමේෂ්: අනේ යන්න එපා. දේශපාලනේ නම් වැඩක් නැහැ. කොච්චර ට්‍රයි කලත් මුකුත් වෙනස් වෙන්නේ නැහැ. හොඳ අදහසක් සමග තියෙන ය වත් පක්ෂයකට ඈඳුනාම එයා ආදර්ශ කරන ජනතා ගැන ඉක්මනට අමතක වෙලා තමන්ම ගැන විතරක් හිතා ගන්නවා.
ගයන්: නමුත් මචං. අපේ ජනපති අපේ රටට වැරදි ගොඩක් කරනවා වගේයි. කොහොම හරි අපේ තරහ පෙන්නෙන්න ඔනෑ නේ?
රොමේෂ්: වෙන්න ඇති එත් වෙන පොරා එයාට වැඩ හොඳ නැහැනේ.. ඉතින් මේ චන්දෙ මග අරිනවා. චන්දෙ දෙන එක වත් එපා කරනවා.
ගයන්: කෝ ඉතින් ඔහොම ඉන්න. මම යනවා.
රොමේෂ්: පරිස්සමින් ඉන්න. සමහර වෙලාව රැලිය තදබල වෙන්න පුළුවන්. ගල් වලින් හැපෙයි. පොලිස් කාරයන් උඹලට ගහයි.
ගයන්: මම බලා ගන්නන්. බය ගන්නන්න එපා. මම රැලියේ ඉන්න කොට ඔය මොනවාද කරන්නේ?
රොමේෂ්: අනිද්දා විබාගයක් තියෙනවා. මම ඒකට පොතක් කියවන්න ඔනෑ.
ගයන්: හොඳි. හවසේ හමු වෙමු.
රොමේෂ්: හමු වෙමු.

Gayan: There is a political rally being held in Vihara Maha Devi Park by the Opposition parties because there is the election next week. Some of my friends from University (campus) are going to support the United National Party. I am also considering about going.

Romesh: Oh Please don’t go! Politics is useless. No matter how much (one) tries nothing will change. Even those who are with a good intention, when they join to a party forget soon about the people who they represent and only think about themselves.

Gayan: But buddy! It seems our President is doing a lot of wrong to our country. We must show our anger somehow, isn’t it?

Romesh: It may be, but The other guy is no better than him. I’m avoiding this election. I hate even voting.

Gayan: Ok just be like that then. I’m going

Romesh: Be careful. Sometimes political rallies may become violent. (You) may get hit by stones. The police may beat you.

Gayan: I will take care. Don’t frighten me. While I am at the rally what will you do?

Romesh: Tommorow there is an exam. I am have to read a book for it.

Gayan: Ok. See you in the evening.

Romesh: See you.

Vocabulary

I will add later.

Grammar

I will add later.