Setting a Juniper Olive
Fedora 8 / Fedora 9 Qemu FreeBSD 4.10
Installing Fedora 8
After a clean install of Fedora 8 [http://www.howtoforge.com/installation-guide-fedora8-desktop] I used preupgrade to upgrade to Fedora 9.
Upgrade to Fedora 9
Preupgrade seems to be a little buggy but in the end I managed to upgrade. It seems its missing a slash. Check [http://linux.derkeiler.com/Mailing-Lists/Fedora/2008-05/msg01575.html] for details.
Install Qemu
yum install qemu-img qemu
Also qemu needs kmod-kqemu to be loaded in the kernel. This packages are needed:
[root@box Olive]# rpm -qa | grep kqemu
kmod-kqemu-2.6.25-14.fc9.i686-1.3.0-0.31.lvn9.i686
kqemu-1.3.0-0.6.pre11.lvn8.noarch
Loading kqemu into the kernel:
[root@box Olive]# modprobe -v kqemu
insmod /lib/modules/2.6.25-14.fc9.i686/extra/kqemu/kqemu.ko
Install FreeBSD 4.10
mkdir /root/Olive
cd /root/Olive
qemu-img create olive.img -f qcow2 4G //this will create a slice of 4gb
Download 4.10-RELEASE-i386-miniinst.iso from [http://mirror.tomato.it/ftp/pub/FreeBSD/releases/i386/ISO-IMAGES/4.10/4.10-RELEASE-i386-miniinst.iso] and then start qemu:
qemu -L . -m 256 -hda olive.img -cdrom 4.10-RELEASE-i386-miniinst.iso -boot d -localtime -net nic,macaddr=00:aa:00:00:01:01,model=i82559er -net user
Install Junos
For the rest of the installing process read:
http://www.internetworkpro.org/wiki/Using_QEMU_with_Olive_to_emulate_Juniper_Routers
or follow this commands :
qemu-img create olive.img -f qcow2 5G //this will create a slice of 4gb
qemu -m 256 -hda olive.img -cdrom 4.10-RELEASE-i386-miniinst.iso -boot d -localtime -net nic,macaddr=00:aa:00:00:01:01,model=i82559er -net user
qemu -m 384 -hda olive.img -boot c -localtime -net nic,macaddr=00:aa:00:00:01:01,model=i82559er -net user // boot FreeBSD
qemu -m 384 -hda olive.img -boot c -localtime -nographic -serial stdio –no-kqemu // boot Junos
If all went good you should see smth like this :
[root@box Junos]# cd /media/dosd/Junos/; qemu -m 384 -hda olive.img -boot c -localtime -nographic -serial stdio –no-kqemu
Console: serial port
BIOS drive C: is disk0
BIOS 639kB/392128kB available memoryFreeBSD/i386 bootstrap loader, Revision 0.8
(builder@ddraig.juniper.net, Fri Jan 18 07:26:04 UTC 2008)
Loading /boot/defaults/loader.conf
/boot/installer text=0x30d28f data=0x2c398+0x2eb46 syms=[0x4+0x429f0+0x4+0x48fee]
-
Hit [Enter] to boot immediately, or space bar for command prompt.
Booting [installer]…
Olive CPU
Copyright (c) 1996-2008, Juniper Networks, Inc.
All rights reserved.
Copyright (c) 1992-2004 The FreeBSD Project.
Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
The Regents of the University of California. All rights reserved.
JUNOS 8.4R3.3 #0: 2008-01-18 07:32:48 UTC
builder@ddraig.juniper.net:/volume/build/junos/8.4/release/8.4R3.3/obj-i386/sys/compile/MFS
Timecounter “i8254″ frequency 1193182 Hz
Timecounter “TSC” frequency 1188838102 Hz
CPU: Pentium II/Pentium II Xeon/Celeron (1188.84-MHz 686-class CPU)
Origin = “GenuineIntel” Id = 0×633 Stepping = 3
Features=0x781abfd
real memory = 402587648 (393152K bytes)
sio0: gdb debugging port
avail memory = 382554112 (373588K bytes)
Preloaded elf kernel “installer” at 0xc08b8000.
Preloaded md_image “/boot/mdimg” at 0xc08b80a0.
DEVFS: ready for devices
md0: Preloaded image 3940352 bytes at 0xc04f4b68
md1: Malloc disk
Using $PIR table, 6 entries at 0xc00fa3c0
npx0:
on motherboard
npx0: INT 16 interface
pcib0: on motherboard
pci0:
on pcib0
Correcting Natoma config for non-SMP
isab0: at device 1.0 on pci0
isa0: on isab0
atapci0: port 0xc000-0xc00f at device 1.1 on pci0
atapci0: Busmastering DMA not supported
ata0: at 0x1f0 irq 14 on atapci0
ata1: at 0×170 irq 15 on atapci0
smb0: irq 11 at device 1.3 on pci0
pci0: at 2.0
pci0: (vendor=0x10ec, dev=0×8139) at 3.0 irq 11
fdc0: at port 0x3f0-0x3f5,0x3f7 irq 6 drq 2 on isa0
atkbdc0: at port 0×60,0×64 on isa0
atkbd0: flags 0×1 irq 1 on atkbdc0
psm0:
irq 12 on atkbdc0
psm0: model IntelliMouse Explorer, device ID 4
vga0: at port 0x3c0-0x3df iomem 0xa0000-0xbffff on isa0
sc0: at flags 0×100 on isa0
sc0: VGA <16 virtual consoles, flags=0×100>
sio0 at port 0x3f8-0x3ff irq 4 flags 0×90 on isa0
sio0: type 16450, console
sio1: configured irq 3 not in bitmap of probed irqs 0
stray irq 7
DEVFS: ready to run
ad0: 5119MB [10402/16/63] at ata0-master BIOSPIO
ata1-master: CDROM device – NO DRIVER!
Mounting root from cd9660:/dev/md0c
Disabling watchdog
=================== Bootstrap installer starting ===================
Initialized the environment
Routing engine model is Olive
Discovered that flash disk = , hard disk = ad0
Disk to install is ad0
Using 191Mb for /tmp
Warning: Block size restricts cylinders per group to 95.
Setting ospackage=jboot-8.4R3.3.tgz, configpackage=configs-8.4R3.3.tgz
Setting packlist=jbundle-8.4R3.3-domestic.tgz
Packages and configurations copied to /tmp
Cleaning up ad0…
Running newfs on ad0s1a…
Warning: Block size and bytes per inode restrict cylinders per group to 89.
/dev/ad0s1a: 1048576 sectors in 256 cylinders of 1 tracks, 4096 sectors
512.0MB in 3 cyl groups (89 c/g, 178.00MB/g, 21632 i/g)
super-block backups (for fsck -b #) at:
32, 364576, 729120
Running newfs on ad0s1e…
Warning: Block size and bytes per inode restrict cylinders per group to 89.
/dev/ad0s1e: 1048576 sectors in 256 cylinders of 1 tracks, 4096 sectors
512.0MB in 3 cyl groups (89 c/g, 178.00MB/g, 21632 i/g)
super-block backups (for fsck -b #) at:
32, 364576, 729120
Installing disk label on ad0
Installing JUNOS on ad0…
Adding jbase…
Mounted jbase on /mnt/packages/mnt/jbase (/dev/vn0)
Adding jbundle-8.4R3.3-domestic.tgz…
Checking package integrity…
Verified SHA1 checksum of jbase-8.4R3.3.tgz
Verified SHA1 checksum of jboot-8.4R3.3.tgz
Verified SHA1 checksum of jcrypto-8.4R3.3.tgz
Verified SHA1 checksum of jdocs-8.4R3.3.tgz
Verified SHA1 checksum of jkernel-8.4R3.3.tgz
Verified SHA1 checksum of jpfe-8.4R3.3.tgz
Verified SHA1 checksum of jroute-8.4R3.3.tgz
Verified SHA1 checksum of pkgtools.tgz
Running requirements check first for jbundle-8.4R3.3-domestic…
Running pre-install for jbundle-8.4R3.3-domestic…
Installing jbundle-8.4R3.3-domestic in /var/tmp/pa1590.28/jbundle-8.4R3.3-domestic.x1590…
Running post-install for jbundle-8.4R3.3-domestic…
Verified SHA1 checksum of jbase-8.4R3.3.tgz
Verified SHA1 checksum of jboot-8.4R3.3.tgz
Verified SHA1 checksum of jcrypto-8.4R3.3.tgz
Verified SHA1 checksum of jdocs-8.4R3.3.tgz
Verified SHA1 checksum of jkernel-8.4R3.3.tgz
Verified SHA1 checksum of jpfe-8.4R3.3.tgz
Verified SHA1 checksum of jroute-8.4R3.3.tgz
Verified SHA1 checksum of pkgtools.tgz
Adding jkernel…
Adding jcrypto…
Adding jpfe…
WARNING: hw.product.model=’unknown’ using jpfe-M40
Adding jdocs…
Adding jroute…
Restoring backed up configurations…
Unmounted /mnt/packages/mnt/jbase
machdep.bootsuccess: 0 -> 0
->
Waiting (max 60 seconds) for system process `vnlru’ to stop…stopped
Waiting (max 60 seconds) for system process `bufdaemon’ to stop…stopped
Waiting (max 60 seconds) for system process `syncer’ to stop…stoppedsyncing disks…
done
Uptime: 13m44s
ata0: Spinning down devices. Please wait…
ata1: Spinning down devices. Please wait…
Rebooting…
Console: serial port
BIOS drive C: is disk0
BIOS 639kB/392128kB available memoryFreeBSD/i386 bootstrap loader, Revision 0.8
(builder@ddraig.juniper.net, Fri Jan 18 07:26:04 UTC 2008)
Loading /boot/defaults/loader.conf
/kernel text=0x7345af data=0x3f864+0x5991a syms=[0x4+0x77220+0x4+0x72951]Hit [Enter] to boot immediately, or space bar for command prompt.
Booting [kernel]…
Olive CPU
Copyright (c) 1996-2008, Juniper Networks, Inc.
All rights reserved.
Copyright (c) 1992-2004 The FreeBSD Project.
Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
The Regents of the University of California. All rights reserved.
JUNOS 8.4R3.3 #0: 2008-01-18 07:38:33 UTC
builder@ddraig.juniper.net:/volume/build/junos/8.4/release/8.4R3.3/obj-i386/sys/compile/JUNIPER
Timecounter “i8254″ frequency 1193182 Hz
Timecounter “TSC” frequency 1166617511 Hz
CPU: Pentium II/Pentium II Xeon/Celeron (1166.62-MHz 686-class CPU)
Origin = “GenuineIntel” Id = 0×633 Stepping = 3
Features=0x781abfd
real memory = 402587648 (393152K bytes)
sio0: gdb debugging port
avail memory = 381132800 (372200K bytes)
Preloaded elf kernel “kernel” at 0xc09ba000.
DEVFS: ready for devices
md0: Malloc disk
Using $PIR table, 6 entries at 0xc00fa3c0
npx0:
on motherboard
npx0: INT 16 interface
pcib0: on motherboard
pci0:
on pcib0
isab0: at device 1.0 on pci0
isa0: on isab0
atapci0: port 0xc000-0xc00f at device 1.1 on pci0
atapci0: Busmastering DMA not supported
Using tap driver
tunectl //create a new tap interface
ifconfig tap0 10.1.1.1 netmask 255.255.255.0 up
So tap0 will be the default gateway for the Olive. Back to Junos you can configure fxp0 interface:
set interfaces fxp0 unit 0 family inet address 10.1.1.2/24
and then add the default route:
set routing-options static route 0.0.0.0/0 next-hop 10.1.1.1
Also you have to set the hostname/domain-name/name servers:
set system host-name olive2
set system domain-name domain.org
set system name-server ip
Configuring Quagga
/etc/quagga/zebra.conf
!
! Zebra configuration saved from vty
! 2008/05/20 23:06:35
!
hostname box
password ooo
enable password 000
!
interface eth0
ipv6 nd suppress-ra
!
interface eth1
ipv6 nd suppress-ra
!
interface lo
!
interface ppp0
ipv6 nd suppress-ra
!
interface tap0
ipv6 nd suppress-ra
!
interface tun0
ipv6 nd suppress-ra
!
ip forwarding
!
!
line vty
!
/etc/quagga/bgpd.conf
! Zebra configuration saved from vty
! 2008/05/20 23:06:35
!
hostname box
password ooo
enable password 000
log file /var/log/quagga/bgpd.log
log stdout
!
router bgp 40404
bgp router-id 10.100.100.100
neighbor 10.100.100.1 remote-as 40404
neighbor 10.100.100.1 description Cisco Corp
neighbor 10.1.1.2 remote-as 40404
neighbor 10.1.1.2 description Juniper Olive2
neighbor 10.2.2.2 remote-as 40404
neighbor 10.2.2.2 description Juniper Olive1
!
line vty
!

Cisco
Bring up tap0 so you will have conectivity between Cisco and Linux.
ifconfig tap0 10.100.100.100 netmask 255.255.255.0 up
router ospf 132
log-adjacency-changes
redistribute connected
redistribute static
network 10.1.0.0 0.0.255.255 area 0
network 10.100.100.0 0.0.0.255 area 0
network 169.254.10.0 0.0.0.255 area 0
default-information originate
router bgp 40404
bgp log-neighbor-changes
redistribute connected
redistribute static
neighbor 10.100.100.100 remote-as 40404
In the end I managed to simulate both Cisco and Juniper Routers. So between Cisco, Linux, Juniper I used BGP (EGP) and for the IGP I used OSPF.
Tests
Some examples of tests:
Traceroute from a Cisco router to the Juniper part of the network:
871W#traceroute 10.2.2.2
Type escape sequence to abort.
Tracing the route to 10.2.2.21 10.1.11.1 16 msec 8 msec 20 msec (Cisco)
2 10.1.5.1 32 msec 48 msec 20 msec (Cisco)
3 10.100.100.100 36 msec 52 msec 24 msec (Linux)
4 10.2.2.2 40 msec 52 msec 24 msec (Junos)
871W#
From the Juniper router to Cisco:
root@olive% traceroute 10.1.11.2
traceroute to 10.1.11.2 (10.1.11.2), 30 hops max, 40 byte packets
1 10.2.2.1 (10.2.2.1) 2.106 ms 1.126 ms 2.122 ms
2 10.100.100.1 (10.100.100.1) 6.405 ms 5.192 ms 14.639 ms
3 10.1.5.2 (10.1.5.2) 22.178 ms 21.380 ms 11.288 ms
4 10.1.11.2 (10.1.11.2) 35.508 ms * 47.718 ms
Problems
1.When trying to run qemu I recieved these error:
Could not initialize SDL – exiting
Solution: Check if SDL is installed (yum install SDL SDL-devel). Don`t try to run qemu from console check -vnc param from qemu.
2. When trying to compile qemu from CVS on FC 9 you recieve a error because FC 9 has gcc 4.x and qemu is built with gcc 3.x.
[root@box qemu]# ./configure
WARNING: “gcc” looks like gcc 4.x
Looking for gcc 3.x
gcc 3.x not found!
QEMU is known to have problems when compiled with gcc 4.x
It is recommended that you use gcc 3.x to build QEMU
To use this compiler anyway, configure with –disable-gcc-check
Solution : I downloaded gcc-3.4.6.tar.gz from ftp.gnu.org and installed it in /opt. (./configure –prefix=/opt/gcc/). And then when I tried to install qemu I used the binary from /opt
./configure –prefix=/root/Test/qemu –target-list=i386-softmmu –enable-net-pcap –enable-net-lcap –enable-net-udp –enable-pemu-i82559 –cc=/opt/gcc/bin/gcc
That should fix this problem.
3. After a fresh install of FC9 a default configuration of firewall will drop some packets in FORWARD chain. If traceroute fails from Cisco to Juniper delete that rule. Try to use tcpdump on the tap interfaces and you will see whats wrong.
4. Problem :
“ERROR: discover_install_drive: Could not find a disk to do an install You are now in a debugging subshell (you may not see a prompt)…
Solution : Something went very wrong when trying to pkg_add jinstall.X.X. You may need to reinstall the system again.
Related posts:



Leave a Reply