Introduction to dynamic routing on Linux with Quagga FVLUG – July 23, 2007 Wim Kerkhoff –  [email_address]
Overview <ul><li>Short introduction to dynamic routing </li></ul><ul><li>Introduce Quagga </li></ul><ul><li>Installing Qua...
Static Routing <ul><li>Simplist and most common method </li></ul><ul><li>Manually configured by humans </li></ul><ul><li>C...
Dynamic Routing Protocols <ul><li>Applications that automatically discover network destinations </li></ul><ul><li>First th...
Common routing protocols <ul><li>RIP  – old one, based on hop count. Timer system can result in slow convergence </li></ul...
Remember: Routing != Forwarding <ul><li>Routing directs forwarding </li></ul><ul><li>Routing is the process of selecting p...
What is Quagga? <ul><li>Open source routing software </li></ul><ul><li>Forked 4 years ago from Zebra to form a much better...
Quagga features <ul><li>RIPv1 and v2 (IPv4) </li></ul><ul><li>RIPng (IPv6) </li></ul><ul><li>OSPFv2 </li></ul><ul><li>OSPF...
Supported Platforms <ul><li>GNU/Linux 2.2.x and higher </li></ul><ul><li>FreeBSD 4.x and higher </li></ul><ul><li>NetBSD 1...
System Architecture
Install / configuration overview <ul><li>Install Debian </li></ul><ul><li>apt-get install quagga tcpdump iproute </li></ul...
Demo
Router 1 Configuration interface eth0 ip address 192.168.21.8/24 ! interface eth1 ip address 10.3.2.1/30 ! interface lo ip...
Router 2 Configuration interface eth0 ip address 10.3.2.2/30 ! interface lo ip address 10.3.3.2/32 ! router ospf ospf rout...
Routing table on Router 2 quagga2:~# vtysh Hello, this is Quagga (version 0.99.5). Copyright 1996-2005 Kunihiro Ishiguro, ...
OSPF neighbour details quagga2# show ip ospf neighbor detail Neighbor  10.3.3.1 , interface address  10.3.2.1 In the  area...
Production tips? <ul><li>Make sure you have backups of  /etc/quagga, /etc/network/interfaces, and iptables rules </li></ul...
Interior uses of OSPF and BGP <ul><li>Managing multiple ISP links (failover / load balancing) </li></ul><ul><li>Multisites...
Want to experiment? <ul><li>Setting up 30 machines to simulate a 30 router network is tough </li></ul><ul><li>Virtualize u...
Worthy competitor to $60k Cisco?  <ul><li>Yes! </li></ul><ul><li>2 x 1U servers with onboard dual GigE </li></ul><ul><li>S...
Documentation <ul><li>Documentation exists for quagga </li></ul><ul><li>Wiki.quagga.net has more useful examples </li></ul...
Questions/Discussion
Upcoming SlideShare
Loading in …5
×

Fvlug_Quagga.ppt

1,001 views

Published on

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
1,001
On SlideShare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
19
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Fvlug_Quagga.ppt

  1. 1. Introduction to dynamic routing on Linux with Quagga FVLUG – July 23, 2007 Wim Kerkhoff – [email_address]
  2. 2. Overview <ul><li>Short introduction to dynamic routing </li></ul><ul><li>Introduce Quagga </li></ul><ul><li>Installing Quagga on Debian </li></ul><ul><li>Example Quagga configurations </li></ul><ul><li>Demo </li></ul><ul><li>Using Quagga in production </li></ul>
  3. 3. Static Routing <ul><li>Simplist and most common method </li></ul><ul><li>Manually configured by humans </li></ul><ul><li>Can’t handle network changes such as outages </li></ul><ul><li>Doesn’t scale with many network devices </li></ul><ul><li>Requires least amount of expertise </li></ul><ul><li>Generally used on hosts (PCs, printers, etc) and simple NAT routers </li></ul>
  4. 4. Dynamic Routing Protocols <ul><li>Applications that automatically discover network destinations </li></ul><ul><li>First they learn what network routes are directly connected </li></ul><ul><li>Then chat with neighbouring routers to learn what they know </li></ul><ul><li>The entire network learns about changes within minutes or even seconds </li></ul><ul><li>Generally used on Internet backbone routers and in organizations with many routers </li></ul>
  5. 5. Common routing protocols <ul><li>RIP – old one, based on hop count. Timer system can result in slow convergence </li></ul><ul><li>OSPF – also uses multicast. Calculates shortest path using costs assigned to each link. Easy to setup but less knobs then BGP. Used inside organization </li></ul><ul><li>BGP – uses TCP session. Can do filtering, route-maps, mangling, etc. Normally used for communicating with other organizations and based on policy </li></ul>
  6. 6. Remember: Routing != Forwarding <ul><li>Routing directs forwarding </li></ul><ul><li>Routing is the process of selecting paths in a network </li></ul><ul><li>Forwarding is the relaying of packets through one network segment to another by nodes </li></ul><ul><li>So a network device can perform routing, forwarding, or both </li></ul><ul><li>So you’ll have a broken router if /proc/sys/net/ipv4/ip_forward is set to 0 even with a beautiful quagga config </li></ul>
  7. 7. What is Quagga? <ul><li>Open source routing software </li></ul><ul><li>Forked 4 years ago from Zebra to form a much better and healthier de-centralized community </li></ul><ul><li>Similar syntax and look to Cisco IOS </li></ul><ul><li>No control over OS, unlike IOS </li></ul>
  8. 8. Quagga features <ul><li>RIPv1 and v2 (IPv4) </li></ul><ul><li>RIPng (IPv6) </li></ul><ul><li>OSPFv2 </li></ul><ul><li>OSPFv3 </li></ul><ul><li>BGPv4 with multiprotocol extension </li></ul><ul><li>VTY shell – Cisco like </li></ul><ul><li>SNMP </li></ul><ul><li>IPv6 </li></ul>
  9. 9. Supported Platforms <ul><li>GNU/Linux 2.2.x and higher </li></ul><ul><li>FreeBSD 4.x and higher </li></ul><ul><li>NetBSD 1.6 and higher </li></ul><ul><li>OpenBSD 2.5 and higher </li></ul>
  10. 10. System Architecture
  11. 11. Install / configuration overview <ul><li>Install Debian </li></ul><ul><li>apt-get install quagga tcpdump iproute </li></ul><ul><li>Add set VTYSH_PAGER=cat to ~/.bashrc </li></ul><ul><li>Update /etc/quagga/daemons (zebra,ospfd,bgpd) </li></ul><ul><li>echo username root nopassword > vtysh.conf </li></ul><ul><li>touch zebra.conf ospfd.conf bgpd.conf </li></ul><ul><li>/etc/init.d/quagga start </li></ul><ul><li>Vtysh to start configuring </li></ul><ul><li>Don’t forget to copy run start like on IOS </li></ul><ul><li>Reboot and ensure convergence </li></ul>
  12. 12. Demo
  13. 13. Router 1 Configuration interface eth0 ip address 192.168.21.8/24 ! interface eth1 ip address 10.3.2.1/30 ! interface lo ip address 10.3.3.1/32 ! router ospf ospf router-id 10.3.3.1 redistribute connected network 10.3.2.0/30 area 0.0.0.0 default-information originate always ! ip route 0.0.0.0/0 192.168.21.254 ! ip forwarding
  14. 14. Router 2 Configuration interface eth0 ip address 10.3.2.2/30 ! interface lo ip address 10.3.3.2/32 ! router ospf ospf router-id 10.3.3.2 redistribute connected network 10.3.2.0/30 area 0.0.0.0 ! ip forwarding
  15. 15. Routing table on Router 2 quagga2:~# vtysh Hello, this is Quagga (version 0.99.5). Copyright 1996-2005 Kunihiro Ishiguro, et al. quagga2# show ip route Codes: K - kernel route, C - connected , S - static, R - RIP, O - OSPF , I - ISIS, B - BGP, > - selected route, * - FIB route O>* 0.0.0.0/0 [110/1] via 10.3.2.1, eth0, 1d20h22m O 10.3.2.0/30 [110/10] is directly connected, eth0, 1d20h33m C>* 10.3.2.0/30 is directly connected, eth0 O>* 10.3.3.1/32 [110/20] via 10.3.2.1, eth0, 1d20h22m C>* 10.3.3.2/32 is directly connected, lo C>* 127.0.0.0/8 is directly connected, lo O>* 192.168.21.0/24 [110/20] via 10.3.2.1, eth0, 1d20h22m
  16. 16. OSPF neighbour details quagga2# show ip ospf neighbor detail Neighbor 10.3.3.1 , interface address 10.3.2.1 In the area 0.0.0.0 via interface eth0 Neighbor priority is 1, State is Full , 11 state changes Most recent state change statistics: Progressive change 1d20h25m ago Regressive change 1d20h25m ago, due to 1-WayReceived DR is 10.3.2.2, BDR is 10.3.2.1 Options 2 *|-|-|-|-|-|E|* Dead timer due in 38.944s Database Summary List 0 Link State Request List 0 Link State Retransmission List 0 Thread Inactivity Timer on Thread Database Description Retransmision off Thread Link State Request Retransmission on Thread Link State Update Retransmission on
  17. 17. Production tips? <ul><li>Make sure you have backups of /etc/quagga, /etc/network/interfaces, and iptables rules </li></ul><ul><li>Keep templates </li></ul><ul><li>Monitor the router as if it was a server: disk space, memory, load, etc </li></ul><ul><li>Have redundant routers so that you can perform OS updates safely with 0 downtime </li></ul><ul><li>Be consistent – stick to your templates </li></ul><ul><li>Run lean & mean – K.I.S.S. </li></ul><ul><li>Be secure </li></ul><ul><li>But make sure you can somehow access the box even if routing is broken </li></ul><ul><li>Stick to a single protocol if possible </li></ul>
  18. 18. Interior uses of OSPF and BGP <ul><li>Managing multiple ISP links (failover / load balancing) </li></ul><ul><li>Multisites using VPNs and/or private links </li></ul><ul><li>Failover between servers </li></ul>
  19. 19. Want to experiment? <ul><li>Setting up 30 machines to simulate a 30 router network is tough </li></ul><ul><li>Virtualize using Xen, VMWare, OpenVZ etc </li></ul><ul><li>Linksys WRT54G with DD-WRT/OpenWRT </li></ul>
  20. 20. Worthy competitor to $60k Cisco? <ul><li>Yes! </li></ul><ul><li>2 x 1U servers with onboard dual GigE </li></ul><ul><li>Servers can be under $1500 each and perform just fine for 99% of situations </li></ul><ul><li>Need more ports? VLAN trunking to managed Layer2 switch </li></ul><ul><li>Commodity memory and processors are dirt cheap and as fast as expensive ASICs </li></ul><ul><li>Each full BGP table needs approx 128 MB physical RAM </li></ul>
  21. 21. Documentation <ul><li>Documentation exists for quagga </li></ul><ul><li>Wiki.quagga.net has more useful examples </li></ul><ul><li>But it’s geared towards quagga itself and not dynamic routing </li></ul><ul><li>Understanding routing protocols is critical </li></ul><ul><li>Having experience with configuring RIP/OSPF/BGP on Cisco via CLI helps a lot </li></ul><ul><li>CLI has built-in usage info using the ? mark like in Cisco IOS </li></ul><ul><li>Zebra/Quagga mailing list archives </li></ul><ul><li>Any Cisco OSPF/BGP syntax guides and examples </li></ul><ul><li>Google  </li></ul>
  22. 22. Questions/Discussion

×