Saturday, June 28, 2008

BGP-LAB on OLIVE

While i was doing my JNCIA, i was also doing labs , one out of three OLIVE started crashing during the BGP lab, this OLIVE router had both IBGP & EBGP sessions. The problem got resloved after the implementation of vlan-taging on interface and multihop in BGP.

The topology of BGP lab is pasted below.

My routers configuration look likes

---------------------OLIVE-R1-----------------------

root@OLIVE-R1# show
## Last changed: 2008-06-28 20:43:32 UTC
version 8.5R1.14;
system {
host-name OLIVE-R1;
root-authentication {
encrypted-password "$1$zF.CaZ4G$5TG9KcfyrXXaJHDfijA3Q0"; ## SECRET-DATA
}
syslog {
user * {
any emergency;
}
file messages {
any notice;
authorization info;
}
file interactive-commands {
interactive-commands any;
}
}
}
interfaces {
fxp0 {
vlan-tagging;
unit 0 {
vlan-id 10;
family inet {
address 202.123.240.1/24;
address 202.123.240.6/24;
}
family mpls;
}
}
fxp1 {
vlan-tagging;
unit 0 {
vlan-id 13;
family inet {
address 202.123.245.1/24;
}
}
}
}
routing-options {
static {
route 202.123.241.0/24 next-hop 202.123.240.2;
route 202.123.244.0/24 next-hop 202.123.240.2;
}
autonomous-system 29992;
}
protocols {
bgp {
group ext {
type external;
multihop;
export static-exp;
neighbor 202.123.240.2 {
peer-as 29991;
}
}
}
}
policy-options {
policy-statement static-exp {
from protocol static;
then accept;
}
}


--------------------OLIVE-R2---------------

root@OLIVE-R2# show
## Last changed: 2008-06-28 20:50:34 UTC
version 8.5R1.14;
system {
host-name OLIVE-R2;
root-authentication {
encrypted-password "$1$n1OnMRWz$XAleXeHPArW1mzoGFHnKS0"; ## SECRET-DATA
}
syslog {
user * {
any emergency;
}
file messages {
any notice;
authorization info;
}
file interactive-commands {
interactive-commands any;
}
}
}
interfaces {
fxp0 {
vlan-tagging;
unit 0 {
vlan-id 10;
family inet {
address 202.123.240.2/24;
}
family mpls;
}
}
fxp1 {
vlan-tagging;
unit 0 {
vlan-id 11;
family inet {
address 202.123.241.1/24;
}
family mpls;
}
}
}
routing-options {
static {
route 202.123.245.0/24 next-hop 202.123.240.1;
}
autonomous-system 29991;
}
protocols {
bgp {
group ext {
type external;
multihop;
export static-exp;
neighbor 202.123.240.1 {
peer-as 29992;
}
}
group int {
type internal;
multihop;
local-address 202.123.241.1;
export static-exp;
neighbor 202.123.241.2;
}
}
}
policy-options {
policy-statement static-exp {
from protocol static;
then accept;
}
}


----------OLIVE-R3--------------------

root@OLIVE-R3# show
## Last changed: 2008-06-28 20:47:54 UTC
version 8.5R1.14;
system {
host-name OLIVE-R3;
root-authentication {
encrypted-password "$1$hvEE7u3l$F4cZsUfGSD0Z7Y8HdefxR/"; ## SECRET-DATA
}
syslog {
user * {
any emergency;
}
file messages {
any notice;
authorization info;
}
file interactive-commands {
interactive-commands any;
}
}
}
interfaces {
fxp0 {
vlan-tagging;
unit 0 {
vlan-id 11;
family inet {
address 202.123.241.2/24;
}
family mpls;
}
}
fxp1 {
vlan-tagging;
unit 0 {
vlan-id 12;
family inet {
address 202.123.244.2/24;
}
}
}
}
routing-options {
static {
route 202.123.240.0/24 next-hop 202.123.241.1;
}
autonomous-system 29991;
}
protocols {
bgp {
group int {
type internal;
multihop;
local-address 202.123.241.2;
neighbor 202.123.241.1 {
export static-exp;
}
}
}
}
policy-options {
policy-statement static-exp {
from protocol static;
then accept;
}
}

And for verification of the configuration

root@OLIVE-R3# run show route protocol bgp

inet.0: 6 destinations, 6 routes (6 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both

202.123.245.0/24 *[BGP/170] 00:29:48, localpref 100
AS path: I
> to 202.123.241.1 via fxp0.0, label-switched-path 3-to-1

So the doubt about for QEMU regarding BGP is no more in my mind.

Sunday, May 18, 2008

JunOS OLIVE & GNS3

As GNS3 team is planning to add JunOS OLIVE in GNS3 , which is an exiting news for all of us.

But as an interim solution i would like to discuss the procedure by which i got success in creating point to point Ethernet connection between JunOS Olive instance running on my PC & CISCO router instance in GNS3, the procedure is very simple. I already have the JunOS Olive installed in my PC and you guys can get the installation procedure from my previous post http://tclteam.blogspot.com/2008/05/how-to-make-olive-alive.html

1.) I started my JunOS olive from command prompt. I change the directory to qemu and type "jqemu.exe -L . -m 256 -hda Olive.img -serial telnet::1002,server -localtime -net nic,vlan=1,macaddr=00:aa:00:00:01:01,model=i82559er -net nic,vlan=1,macaddr=00:aa:00:00:01:03,model=i82559er -vnc :1 -usbdevice tablet -net tap,vlan=1,ifname=Tap1" . My JunOS olive has two fxp0 interface and JunOS has the interface with Tap1 interface which is in vlan1.

2.) For accessing the JunOS Olive, i will do telnet to 127.0.0.1 at 1002 port.

3.) Now i need to start the GNS3. I have added a CISCO 3600 series router & a netwrok cloud.

4.) I have configure the cloud and defined the Tap1 interface in it.





5.) I have selected the Tap1 interface and now i create an ethernet link between N/W cloud and CISCO in GNS3. Also i started my CISCO in GNS3.


6.) I did telnet to my CISCO router in order to assign IP to f0/0 interface. The IP I gave to the interface is 10.1.13/8.


7.) I also assigned IP address to fxp0 interface of my JunOS olive. IP address given to the interface was 10.1.1.2/8.


When I ping from my JunOS olive, i got success.

root@OLIVE_QEMU> ping 10.1.1.3 count 5
PING 10.1.1.3 (10.1.1.3): 56 data bytes
64 bytes from 10.1.1.3: icmp_seq=0 ttl=255 time=53.654 ms
64 bytes from 10.1.1.3: icmp_seq=1 ttl=255 time=8.110 ms
64 bytes from 10.1.1.3: icmp_seq=2 ttl=255 time=2.306 ms
64 bytes from 10.1.1.3: icmp_seq=3 ttl=255 time=3.205 ms
64 bytes from 10.1.1.3: icmp_seq=4 ttl=255 time=7.087 ms

--- 10.1.1.3 ping statistics ---
5 packets transmitted, 5 packets received, 0% packet loss
round-trip min/avg/max/stddev = 2.306/14.872/53.654/19.516 ms

Similar was the case from CISCO running inside GNS3.

CISCO#ping 10.1.1.2

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.1.1.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 4/15/40 ms

Monday, May 12, 2008

How to make Olive Alive

I read Himawan Nugroho blog at http://brokenpipes.blogspot.com/2008/01/olive-is-alive.html about Olive, he posted a detailed procedure for making Olive alive, but i got stuck in installing the Junos but after making some changes i have made the Olive alive.
So i thought to share my experience with people seeking the information about Olive.
The softwares except Junos i used for Olive are same as he used. I used jinstall-7.2R3.3-export-signed instead of jinstall-8.3R2.8-export-signed.tgz. Later i upgraded my olive to jinstall-8.3R2.8-export-signed.tgz.

I will follow the steps written by Himawan but for making all steps clear i am also quoting the steps written by him.

1. Download the latest version of Qemu for Windows.
2. Download OpenVPN to create TAP interface.
3. Download FreeBSD 4.4 mini ISO.
4. Get JunOS mine is 7.2R3.3.
5. Download modified version of Qemu, Jqemu. I have uploaded the Jqemu to a site as it is difficult to download the file from Chinese site. Download site is http://imran29.esmartdesign.com/jqemu-100full.rar
6. C:\qemu>qemu-img.exe create olive.img -f qcow2 3G Formating 'olive.img', fmt=qcow2, size=3145728 kB

7. Put the FreeBSD mini ISO in the same Qemu directory, and use this command to boot FreeBSD from the iso.


C:\qemu>qemu.exe -L . -m 256 -hda olive.img -cdrom 4.4-mini.iso -boot d -localtime

Follow the FreeBSD installation instruction wriiten on http://brokenpipes.blogspot.com/2008/01/olive-is-alive.html


8. Upload JunOS install package from Windows, as freeBSD has been isntalled on the system and now it is the time to start the freeBSD with valid network connection with your system. We have created Tap interface with open VPN, rename that tap interface to Tap1 and assign the IP 10.1.1.1/8, now its time to start freeBSD. I am starting my freeBSD with one fxp0 interfaces.


C:\qemu>jqemu.exe -L . -m 256 -hda Olive.img -localtime -net nic,vlan=1,macaddr=00:aa:00:00:01:01,model=i82559er -net tap,vlan=1,ifname=Tap1

Login to freeBSD with root account and change the IP of fxp0 to 10.1.1.2/8 by #ifconfig fxp0 up 10.1.1.2
Checck the N/W connectivity by ping command, ping 10.1.1.1

If you have got the reply then it means that u have got the working N/W interface with your PC.

You should have ftp server(Filezilla is a free FTP server for windows) running on your PC.

#cd /var/tmp
#ftp 10.1.1.1

Change type to binary and get the jinstall file.

rm /dev/wd0c

ln -s /dev/ad0c /dev/wd0c

mkdir /var/etc

touch /var/etc

touch /var/etc/master.passwd

touch /var/etc/inetd.conf

touch /var/etc/group

pkg_add /var/tmp/jinstall-7.2R3.3-export-signed.tgz

shutdown -r now

While it's shuttingdown, exit from Qemu by pressing Ctrl-Alt-2, then type: quit

10. Login to Olive for the first time!

So start Qemu again using Jqemu.exe and this time put the option to redirect the output to serial port emulated by local TCP port 1001. Now I am starting my Junos with two fxp0 interfaces.

c:\qemu>jqemu.exe -L . -m 256 -hda Olive.img -serial telnet::1001,server -localtime -net nic,vlan=1,macaddr=00:aa:00:00:01:01,model=i82559er -net nic,vlan=1,macaddr=00:aa:00:00:01:03,model=i82559er -vnc :1 -usbdevice tablet -net tap,vlan=1,ifname=Tap1

Qemu windows will pop up and it's waiting for TCP connection to port 1001

Open putty (a free telnet client for windows) and telnet to 127.0.0.1 with port 1001.

You can see the whole installation process.

Once your Olive gets up, login with root and at this time it will not ask for password. type command "cli" , now you are in Olive Junos prompt, now you need to configure IP to the fxp0 interface but before configuring IP you need to configure the root-authentication.


root@%cli
root>configure
[edit]
root#edit system root-authentication
root#set plain-text-password

It will now ask for the password after giving password, type commit

Now assign the IP to fxp0 interface by command

root#set interface fxp0 unit 0 family inet address 10.1.1.2/8

Again type commit.

Now start the shell again by command.

root>start shell

root@% cd /var/tmp/

Ftp to 10.1.1.1 and get jinstall-8.3R2.8-export-signed.tgz and then upgrade the JuNOS by.
pkg_add jinstall-8.3R2.8-export-signed.tgz
Reboot the system.
After restart you have 8.3R2.8.