Konfiguracją poniżej ma troche inna adresację niż na schemacie.
Konfiguracją Router 3:
Kod: Zaznacz cały
router ospf
redistribute connected
passive-interface default
no passive-interface vlan4003
no passive-interface vlan4023
network 212.xx.xx.128/30 area 0.0.0.0
network 212.xx.xx.228/30 area 0.0.0.0
!
Konfiguracja Router BGP 1
Kod: Zaznacz cały
router ospf
passive-interface default
no passive-interface vlan4003
network 212.127.92.228/30 area 0.0.0.0
default-information originate always
!
router bgp xxxx
...
redistribute ospf route-map ospf-lokalne
...
Konfiguracja Router 4 i Router BGP 2 jest podobna (inne vlany). Router3 i Router4 czego nie napisałem wcześniej mają włączone redistribute connected. BGP dystrybuuje prefixy z ospfa, dodatkowo założona jest route-mapa (permit dla prefixów z określoną długością).
show ip ospf database na Routerze 3 (załączone tylko istotne wpisy):
Kod: Zaznacz cały
Router 3# show ip ospf database
...
AS External Link States
Link ID ADV Router Age Seq# CkSum Route
0.0.0.0 79.xx.xx.18 540 0x8000057f 0x961a E2 0.0.0.0/0 [0x0]
0.0.0.0 88.xx.xx.130 540 0x80000457 0x1f7b E2 0.0.0.0/0 [0x0]
...
RouterID narazie nie ustawiłem na konkretne lo, wartości sam pobrał z interfejsów.
79.xx.xx.18 -> Router BGP 1
88.xx.xx.130 -> Router BGP 2
Kod: Zaznacz cały
Router 3# show ip route
...
O>* 0.0.0.0/0 [110/1] via 212.xxx.xxx.230, vlan4003, 00:12:01
...
Cost jest taki sam na obu vlanach ale quagga skompilowana z możliwością zainstalowania tylko jednej trasy, jest tylko jeden wpis do 0.0.0.0/0.
Na Router BGP 1
Kod: Zaznacz cały
AS External Link States
Link ID ADV Router Age Seq# CkSum Route
0.0.0.0 79.xx.xx.18 948 0x8000057f 0x961a E2 0.0.0.0/0 [0x0]
0.0.0.0 88.xx.xx.130 950 0x80000457 0x1f7b E2 0.0.0.0/0 [0x0]
...
Z poziomu Router BGP 1 sprawdzenie gdzie jest host192.168.101.1
Kod: Zaznacz cały
Router BGP 1# show ip route 192.168.101.1
Routing entry for 0.0.0.0/0
Known via "ospf", distance 110, metric 1, best
Last update 00:18:01 ago
* 212.xx.xx.229, via vlan4003
tego hosta nie ma w sieci, Router BGP wysyła go to defaulta którego dostał od Router 3, Router 3 z kolei z powrotem do odeślę do Router BGP 1.
Distrubute list w quadze wygląda tak
Kod: Zaznacz cały
--- OSPF Command: distribute-list NAME out (kernel|connected|static|rip|ospf
--- OSPF Command: no distribute-list NAME out (kernel|connected|static|rip|ospf
Apply the access-list filter, NAME, to redistributed routes of the given type before allowing the routes to redistributed into OSPF (see OSPF redistribute).
czyli sterujemy tylko redystrybucjami out a nie jak w przypadku Cisco:
gdzie można odfiltrowywać na wejściu to co przychodzi. Jedynie co widzę to filtrowanie między area:
Kod: Zaznacz cały
Router 3(config-router)# area 0
authentication Enable authentication
default-cost Set the summary-default cost of a NSSA or stub area
export-list Set the filter for networks announced to other areas
filter-list Filter networks between OSPF areas
import-list Set the filter for networks from other areas announced to the specified one
nssa Configure OSPF area as nssa
range Summarize routes matching address/mask (border routers only)
shortcut Configure the area's shortcutting mode
stub Configure OSPF area as stub
virtual-link Configure a virtual link