در این بخش قصد داریم ارتباط روتر سودار با روتر Mikrotik با پروتکل های مسیریابی RIP,OSPF و BGP بررسی کنیم . فرض کنید سناریوی زیر را داریم که روتر n1 سودار و بقیه روتر ها Mikrotik هستند سودار با هر کدام از روترهای Mikrotik با یک پروتکل مسیریابی کار می کند :
همسایگی RIP بین سودار و Mikrotik
تنظیمات RIP در روتر سودار
router rip
network 200.1.2.0/24
redistribute connected
تنظیمات RIP در روتر Mikrotik
[admin@MikroTik] > /ip address/print
Columns: ADDRESS, NETWORK, INTERFACE
# ADDRESS NETWORK INTERFACE
0 200.1.2.2/24 200.1.2.0 ether1
1 2.1.1.1/24 2.1.1.0 ether2
[admin@MikroTik] > /routing/rip/interface/print
0 instance=1 address=200.1.2.2%ether1
1 instance=1 address=2.1.1.1%ether2
[admin@MikroTik] > /routing/rip/instance/print
Flags: X - disabled
0 name="1" redistribute=connected
[admin@MikroTik] > /routing/rip/export
# jun/17/2023 05:22:10 by RouterOS 7.1rc7
# software id =
#
/routing rip instance
add name=1 redistribute=connected
/routing rip interface-template
add instance=1
بررسی همسایگی در سودار و در میکروتیک
سودار :
n1# sh ip rip status
Routing Protocol is "rip"
Sending updates every 30 seconds with +/-50%, next due in 28 seconds
Timeout after 180 seconds, garbage collect after 120 seconds
Outgoing update filter list for all interface is not set
Incoming update filter list for all interface is not set
Default redistribution metric is 1
Redistributing: connected
Default version control: send version 2, receive any version
Interface Send Recv Key-chain
ge0 2 1 2
Routing for Networks:
200.1.2.0/24
Routing Information Sources:
Gateway BadPackets BadRoutes Distance Last Update
200.1.2.2 1 0 120 00:00:12
Distance: (default is 120)
n1#
n1# sh ip fib
Codes: K - kernel route, C - connected, S - static, R - RIP,
O - OSPF, I - IS-IS, B - BGP, E - EIGRP, N - NHRP,
T - Table, v - VNC, V - VNC-Direct, A - Babel, D - SHARP,
F - PBR, f - OpenFabric, W - WG,
> - selected route, * - FIB route, q - queued, r - rejected, b - backup
t - trapped, o - offload failure
C>* 1.1.1.0/24 is directly connected, ge2, 01:23:01
R>* 2.0.0.0/8 [120/2] via 200.1.2.2, ge0, weight 1, 00:10:04
C>* 200.1.2.0/24 is directly connected, ge0, 01:23:01
C>* 200.1.3.0/24 is directly connected, ge1, 01:23:01
C>* 200.1.7.0/24 is directly connected, ge3, 01:23:01
C>* 200.1.9.0/24 is directly connected, ge4, 01:23:01
C>* 222.1.1.1/32 is directly connected, loopback100, 01:23:07
n1#
Mikrotik:
[admin@MikroTik] > /routing/rip/neighbor/print
Flags: D - dynamic
0 D instance=1 address=200.1.2.1%ether1 routes=5 packets-total=34
packets-bad=0 entries-bad=0 last-update=6s
[admin@MikroTik] > /ip route/print
Flags: D - DYNAMIC; A - ACTIVE; c, r, y - COPY
Columns: DST-ADDRESS, GATEWAY, DISTANCE
DST-ADDRESS GATEWAY DISTANCE
DAr 1.1.1.0/24 200.1.2.1 120
DAc 2.1.1.0/24 ether2 0
DAc 200.1.2.0/24 ether1 0
DAr 200.1.3.0/24 200.1.2.1 120
DAr 200.1.7.0/24 200.1.2.1 120
[admin@MikroTik] >
همسایگی OSPF بین سودار و Mikrotik
تنظیمات OSPF در روتر سودار
router ospf
ospf router-id 222.1.1.1
redistribute connected
redistribute rip
network 200.1.3.0/24 area 0
!
تنظیمات OSPF در روتر Mikrotik
interface GigabitEthernet0/0
ip address 200.1.3.3 255.255.255.0
ip ospf 1 area 0
duplex full
speed 1000
media-type gbic
negotiation auto
!
!
interface GigabitEthernet1/0
ip address 3.1.1.1 255.255.255.0
ip ospf 1 area 0
negotiation auto
!
!
router ospf 1
router-id 222.3.3.3
log-adjacency-changes
passive-interface GigabitEthernet1/0
!
بررسی همسایگی در سودار و در میکروتیک
سودار :
n1# sh ip ospf neighbor
Neighbor ID Pri State Dead Time Address Interface
RXmtL RqstL DBsmL
200.1.3.3 128 Full/DR 38.398s 200.1.3.3 ge1:200.1.3.1
0 0 0
n1# sh ip fib
Codes: K - kernel route, C - connected, S - static, R - RIP,
O - OSPF, I - IS-IS, B - BGP, E - EIGRP, N - NHRP,
T - Table, v - VNC, V - VNC-Direct, A - Babel, D - SHARP,
F - PBR, f - OpenFabric, W - WG,
> - selected route, * - FIB route, q - queued, r - rejected, b - backup
t - trapped, o - offload failure
C>* 1.1.1.0/24 is directly connected, ge2, 00:25:58
R>* 2.1.1.0/24 [120/2] via 200.1.2.2, ge0, weight 1, 00:25:57
O>* 3.1.1.0/24 [110/101] via 200.1.3.3, ge1, weight 1, 00:25:42
C>* 200.1.2.0/24 is directly connected, ge0, 00:25:58
C>* 200.1.3.0/24 is directly connected, ge1, 00:25:58
C>* 200.1.7.0/24 is directly connected, ge3, 00:25:58
میکروتیک:
[admin@MikroTik] > /routing/ospf/instance/print
Flags: X - disabled, I - inactive
0 name="ospf-instance-1" version=2 vrf=main router-id=main
redistribute=connected
[admin@MikroTik] > /routing/ospf/interface/print
Flags: D - dynamic
0 D address=200.1.3.3%ether1 area=0.0.0.0 state=dr network-type=broadcast
bdr=200.1.3.1 cost=1 priority=128 retransmit-interval=5s
transmit-delay=1s hello-interval=10s dead-interval=40s
[admin@MikroTik] > /routing/ospf/neighbor/print
Flags: V - virtual; D - dynamic
0 D instance=ospf-instance-1 area=0.0.0.0 address=200.1.3.1 priority=1
router-id=222.1.1.1 dr=200.1.3.3 bdr=200.1.3.1 state="Full"
state-changes=6 adjacency=19m48s timeout=32s
[admin@MikroTik] >
[admin@MikroTik] > /ip route/print
Flags: D - DYNAMIC; A - ACTIVE; c, o, y - COPY
Columns: DST-ADDRESS, GATEWAY, DISTANCE
DST-ADDRESS GATEWAY DISTANCE
DAo 1.1.1.0/24 200.1.3.1%ether1 110
DAo 2.1.1.0/24 200.1.3.1%ether1 110
DAc 3.1.1.0/24 ether2 0
DAo 200.1.2.0/24 200.1.3.1%ether1 110
DAc 200.1.3.0/24 ether1 0
DAo 200.1.7.0/24 200.1.3.1%ether1 110
همسایگی BGP بین سودار و Mikrotik
تنظیمات BGP در روتر سودار
interface ge3
no shutdown
ip address 200.1.7.1/24
exit
!
router bgp 1717
no bgp ebgp-requires-policy
neighbor 200.1.7.7 remote-as 7171
!
address-family ipv4 unicast
redistribute connected
redistribute rip
redistribute ospf
exit-address-family
exit
تنظیمات BGP در روتر Mikrotik
[admin@MikroTik] > /ip address/print
Columns: ADDRESS, NETWORK, INTERFACE
# ADDRESS NETWORK INTERFACE
0 7.1.1.1/24 7.1.1.0 ether2
1 200.1.7.7/24 200.1.7.0 ether1
[admin@MikroTik] > /routing/bgp/export
# jun/17/2023 05:41:43 by RouterOS 7.1rc7
# software id =
#
/routing bgp connection
add address-families=ip as=7171 disabled=no local.role=ebgp name=bgp1 \
output.redistribute=connected remote.address=200.1.7.1 .as=1717 \
router-id=222.7.7.7 routing-table=main
[admin@MikroTik] >
بررسی همسایگی در سودار و در میکروتیک
سودار:
n1# sh ip bgp summary
IPv4 Unicast Summary (VRF default):
BGP router identifier 200.1.7.1, local AS number 1717 vrf-id 0
BGP table version 13
RIB entries 13, using 2392 bytes of memory
Peers 1, using 723 KiB of memory
Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down Sta
te/PfxRcd PfxSnt Desc
200.1.7.7 4 7171 44 49 0 0 0 00:37:01
2 7 N/A
Total number of neighbors 1
n1# sh ip fib
Codes: K - kernel route, C - connected, S - static, R - RIP,
O - OSPF, I - IS-IS, B - BGP, E - EIGRP, N - NHRP,
T - Table, v - VNC, V - VNC-Direct, A - Babel, D - SHARP,
F - PBR, f - OpenFabric, W - WG,
> - selected route, * - FIB route, q - queued, r - rejected, b - backup
t - trapped, o - offload failure
C>* 1.1.1.0/24 is directly connected, ge2, 00:37:07
R>* 2.1.1.0/24 [120/2] via 200.1.2.2, ge0, weight 1, 00:37:06
O>* 3.1.1.0/24 [110/101] via 200.1.3.3, ge1, weight 1, 00:36:51
B>* 7.1.1.0/24 [20/0] via 200.1.7.7, ge3, weight 1, 00:37:06
C>* 200.1.2.0/24 is directly connected, ge0, 00:37:07
C>* 200.1.3.0/24 is directly connected, ge1, 00:37:07
C>* 200.1.7.0/24 is directly connected, ge3, 00:37:07
n1#
میکروتیک:
[admin@MikroTik] > /routing/bgp/session/print
Flags: E - established
0 E remote.address=200.1.7.1 .as=1717 .id=200.1.7.1 .refused-cap-opt=no
.capabilities=mp,rr,em,gr,as4,ap,err,fqdn .messages=47 .bytes=1146
.gr-time=120 .eor=ip
local.address=200.1.7.7 .as=7171 .id=222.7.7.7
.capabilities=mp,rr,gr,as4 .messages=41 .bytes=812 .eor=""
output.procid=20
input.procid=20 ebgp
hold-time=3m keepalive-time=1m
[admin@MikroTik] > /ip route/print
Flags: D - DYNAMIC; A - ACTIVE; c, b, y - COPY
Columns: DST-ADDRESS, GATEWAY, DISTANCE
DST-ADDRESS GATEWAY DISTANCE
DAb 1.1.1.0/24 200.1.7.1 20
DAb 2.1.1.0/24 200.1.7.1 20
DAb 3.1.1.0/24 200.1.7.1 20
DAc 7.1.1.0/24 ether2 0
DAb 200.1.2.0/24 200.1.7.1 20
DAb 200.1.3.0/24 200.1.7.1 20
D b 200.1.7.0/24 200.1.7.1 20
DAc 200.1.7.0/24 ether1 0