Linux Routers and Community Networks
Total Page:16
File Type:pdf, Size:1020Kb
Summer Course at Mekelle Institute of Technology. July, 2015. Linux Routers and Community Networks Llorenç Cerdà-Alabern http://personals.ac.upc.edu/llorenc [email protected] Universitat Politènica de Catalunya, Barcelona, Spain Revision: 0e36644 (2015-07-09) Llorenç Cerdà-Alabern Linux Routers and Community Networks 1 / 191 Summer Course at Mekelle Institute of Technology. Linux Routers and Community Networks Lab 2: RIP and OSPF Description IOS fundamentals Parts Quagga set up I Introduction Basic commands II Lab 1: Basic Network Configuration RIP review III Lab 2: RIP and OSPF RIP configuration IV Lab 3: Firewall configuration RIP Lab setup V Lab 4: Community Networks OSPF review VI Lab 5: Network Management OSPF configuration OSPF Lab setup Llorenç Cerdà-Alabern Linux Routers and Community Networks 64 / 191 Summer Course at Mekelle Institute of Technology. Linux Routers and Community Networks Lab 2: RIP and OSPF Part III Description IOS fundamentals Lab 2: RIP and OSPF Quagga set up Basic commands Outline RIP review RIP Description RIP configuration configuration RIP Lab setup IOS fundamentals RIP Lab setup OSPF review Quagga set up OSPF OSPF review configuration OSPF Lab Basic commands OSPF configuration setup RIP review OSPF Lab setup Llorenç Cerdà-Alabern Linux Routers and Community Networks 65 / 191 Lab 2: RIP and OSPF Description Lab 2: RIP and OSPF Description IOS fundamentals Objectives Quagga set up • Quagga is an open source routing software package that Basic commands provides routing protocols support such as RIP,OSPF,IS-IS and RIP review BGP. RIP • Quagga is a brach of the original project called zebra. configuration RIP Lab setup • Quagga provides a Cisco IOS-like interface. OSPF review • In this lab we will review RIP and OSPF using Quagga. OSPF configuration OSPF Lab setup Llorenç Cerdà-Alabern Linux Routers and Community Networks 66 / 191 Summer Course at Mekelle Institute of Technology. Linux Routers and Community Networks Lab 2: RIP and OSPF Part III Description IOS fundamentals Lab 2: RIP and OSPF Quagga set up Basic commands Outline RIP review RIP Description RIP configuration configuration RIP Lab setup IOS fundamentals RIP Lab setup OSPF review Quagga set up OSPF OSPF review configuration OSPF Lab Basic commands OSPF configuration setup RIP review OSPF Lab setup Llorenç Cerdà-Alabern Linux Routers and Community Networks 67 / 191 Lab 2: RIP and OSPF IOS fundamentals Lab 2: RIP and OSPF Configuration modes Description IOS fundamentals Quagga set up • Two modes: Basic • exec: allows inspecting the router, e.g. show commands. commands • configuration: allows editing the router configuration. RIP review RIP • In confguration modes you edit the running-config. configuration • To delete commands from running config: preceded by no. RIP Lab setup • The prompt indicates the mode, e.g. >, #, #(config-if), etc. OSPF review • Case insensitive. OSPF • ? for help. configuration • TAB for command completion. OSPF Lab setup • Allows abbreviated commands as long there is no ambiguity. E.g. sh for show, or conf term for configure terminal. • Quagga specific: accept address/mask notation, e.g. 10.0.0.1/24. Llorenç Cerdà-Alabern Linux Routers and Community Networks 68 / 191 Summer Course at Mekelle Institute of Technology. Linux Routers and Community Networks Lab 2: RIP and OSPF Part III Description IOS fundamentals Lab 2: RIP and OSPF Quagga set up Basic commands Outline RIP review RIP Description RIP configuration configuration RIP Lab setup IOS fundamentals RIP Lab setup OSPF review Quagga set up OSPF OSPF review configuration OSPF Lab Basic commands OSPF configuration setup RIP review OSPF Lab setup Llorenç Cerdà-Alabern Linux Routers and Community Networks 69 / 191 Lab 2: RIP and OSPF Quagga set up Lab 2: RIP and OSPF Quagga daemons • zebra: general configuration. Description • ripd: RIP daemon. IOS fundamentals • ospfd: OSPF daemon Quagga set up • Use telnet to connect to the deamons: Basic commands root@OpenWrt:~#/etc/init.d/quagga start quagga.init: Starting zebra ... done. RIP review quagga.init: Starting ripd ... done. quagga.init: Starting ospfd ... done. RIP root@OpenWrt:~# telnet localhost zebra configuration Entering character mode Escape character is ’^]’. RIP Lab setup Hello, this is Quagga (version 0.99.22.3). Copyright 1996-2005 Kunihiro Ishiguro, et al. OSPF review User Access Verification OSPF Password: zebra configuration OpenWrt> OpenWrt> enable OSPF Lab OpenWrt#? setup clear Reset functions configure Configuration from vty interface ... Llorenç Cerdà-Alabern Linux Routers and Community Networks 70 / 191 Summer Course at Mekelle Institute of Technology. Linux Routers and Community Networks Lab 2: RIP and OSPF Part III Description IOS fundamentals Lab 2: RIP and OSPF Quagga set up Basic commands Outline RIP review RIP Description RIP configuration configuration RIP Lab setup IOS fundamentals RIP Lab setup OSPF review Quagga set up OSPF OSPF review configuration OSPF Lab Basic commands OSPF configuration setup RIP review OSPF Lab setup Llorenç Cerdà-Alabern Linux Routers and Community Networks 71 / 191 Lab 2: RIP and OSPF Basic commands Lab 2: RIP and OSPF Interfaces Description • Show Interfaces: OpenWrt# show interface IOS Interface br-lan is up, line protocol detection is disabled fundamentals index 5 metric 1 mtu 1500 Quagga set up flags: <UP,BROADCAST,RUNNING,MULTICAST> HWaddr: 10:fe:ed:af:63:5e Basic inet 192.168.5.1/24 broadcast 192.168.5.255 commands inet6 fd20:1d78:f920::1/60 inet6 fe80::12fe:edff:feaf:635e/64 RIP review Interface dummy0 is down index 11 metric 1 mtu 1500 RIP flags: <BROADCAST,NOARP> configuration HWaddr: 06:31:12:18:c8:5c RIP Lab setup • Assign IP address: OSPF review OpenWrt# conf term OSPF OpenWrt(config)# int dummy0 configuration OpenWrt(config-if)# ip add 10.0.0.1/24 OSPF Lab setup • Remove IP address: OpenWrt(config-if)# no ip add 10.0.0.1/24 Llorenç Cerdà-Alabern Linux Routers and Community Networks 72 / 191 Lab 2: RIP and OSPF Basic commands Lab 2: RIP and OSPF Description Routing table IOS fundamentals • Show routing table: Quagga set up OpenWrt# show ip route Codes: K - kernel route, C - connected, S - static, R - RIP, Basic O - OSPF, I - IS-IS, B - BGP, H - HSLS, o - OLSR, commands b - BATMAN, A - Babel, > - selected route, * - FIB route RIP review K>* 0.0.0.0/0 via 192.168.1.1, eth0.2 C>* 10.0.0.0/24 is directly connected, dummy0 RIP C>* 127.0.0.0/8 is directly connected, lo configuration C>* 192.168.1.0/24 is directly connected, eth0.2 C> 192.168.5.0/24 is directly connected, br-lan RIP Lab setup * OSPF review • Add route to network 10.0.0.1/24 via gateway 192.168.1.1: OSPF OpenWrt# conf term configuration OpenWrt(config-if)# ip route 10.0.0.1/24 192.168.1.1 OSPF Lab setup Llorenç Cerdà-Alabern Linux Routers and Community Networks 73 / 191 Lab 2: RIP and OSPF Basic commands Lab 2: RIP and OSPF Show current configuration Description OpenWrt# show running-config Current configuration: IOS ! fundamentals password zebra ! Quagga set up interface br-lan ipv6 nd suppress-ra Basic ! commands interface dummy0 RIP review ipv6 nd suppress-ra ! RIP interface eth0 configuration ipv6 nd suppress-ra ! RIP Lab setup interface eth0.1 ipv6 nd suppress-ra OSPF review ! interface eth0.2 OSPF ipv6 nd suppress-ra configuration ! interface lo OSPF Lab ! setup interface wlan0 ipv6 nd suppress-ra ! access-list vty permit 127.0.0.0/8 access-list vty deny any ! Llorenç Cerdà-Alabern Linux Routers and Community Networks 74 / 191 ip forwarding ipv6 forwarding ! ! line vty access-class vty ! end Lab 2: RIP and OSPF Basic commands Lab 2: RIP and OSPF Description Miscelanea IOS fundamentals • Avoid expiration of telnet session: Quagga set up OpenWrt# conf term OpenWrt(config)# line vty Basic OpenWrt(config-line)# exec-timeout0 commands RIP review • Save current configuration: RIP OpenWrt# write configuration Configuration saved to /etc/quagga/zebra.conf RIP Lab setup • Change hostname (and prompt): OSPF review OpenWrt# conf term OpenWrt(config)# hostname R1 OSPF R1(config)# configuration OSPF Lab setup Llorenç Cerdà-Alabern Linux Routers and Community Networks 75 / 191 Summer Course at Mekelle Institute of Technology. Linux Routers and Community Networks Lab 2: RIP and OSPF Part III Description IOS fundamentals Lab 2: RIP and OSPF Quagga set up Basic commands Outline RIP review RIP Description RIP configuration configuration RIP Lab setup IOS fundamentals RIP Lab setup OSPF review Quagga set up OSPF OSPF review configuration OSPF Lab Basic commands OSPF configuration setup RIP review OSPF Lab setup Llorenç Cerdà-Alabern Linux Routers and Community Networks 76 / 191 Lab 2: RIP and OSPF RIP review Lab 2: RIP and OSPF Routing Information Protocol (RIP) One of the oldest and more simple routing protocols. In summary, it Description works as follows: IOS fundamentals • The metric is the number of jumps until the destination: 1 if Quagga set up the destination is a network directly connected, 2 if it has to go Basic commands through a router, etc. RIP review • The routers send periodically (each 30 seconds) a broadcast RIP RIP message in each interface with the known destinations and configuration metrics. Sent with UDP, source and destination port: 520. RIP Lab setup • If we stop receiving RIP messages from a neighbour (180 OSPF review OSPF seconds), we assume that it is down. configuration • The metric’s value of infinity is16. OSPF Lab setup • RIP version 2: The netmask is added to the destinations sent in the messages. The messages are sent to the multicast address: 224.0.0.9 (all RIPv2 routers). Llorenç Cerdà-Alabern Linux Routers and