20201209 cisco VRF & OSPF
課堂資料
Virtual Routing and Forwarding
課堂練習
VRF










OSPF





Part 01.













Part 02.






Part 03.




Last updated






































Last updated
int e0/0ip add 192.168.1.1 255.255.255.0no shutexitint e0/0ip add 192.168.2.1 255.255.255.0no shutexitint e0/0ip add 192.168.3.1 255.255.255.0no shutexitint e0/0ip add 192.168.4.1 255.255.255.0no shutexitip vrf Blueexitip vrf Redexitint e0/0ip vrf forwarding Blueip add 192.168.1.2 255.255.255.0no shutint e0/1ip vrf forwarding Redip add 192.168.2.2 255.255.255.0no shutint e0/2ip vrf forwarding Blueip add 192.168.3.2 255.255.255.0no shutint e0/3ip vrf forwarding Redip add 192.168.4.2 255.255.255.0no shutdo sh ip ro connecteddo sh ip ro vrf Bluedo sh ip ro vrf Reddo ping vrf Blue 192.168.1.1exitip route vrf Blue 1.1.1.1 255.255.255.255 192.168.1.1do ping vrf Blue 1.1.1.1ip route vrf Red 2.2.2.2 255.255.255.255 192.168.2.1do ping vrf Red 2.2.2.2ip route vrf Blue 3.3.3.3 255.255.255.255 192.168.3.1do ping vrf Blue 3.3.3.3ip route vrf Red 4.4.4.4 255.255.255.255 192.168.4.1do ping vrf Red 4.4.4.4do sh ip ro vrf Upperrouter ospf 1network 192.168.1.0 0.0.0.255 area 0network 1.1.1.1 0.0.0.0 area 0router ospf 1network 192.168.2.0 0.0.0.255 area 0network 2.2.2.2 0.0.0.0 area 0router ospf 1network 192.168.3.0 0.0.0.255 area 0network 3.3.3.3 0.0.0.0 area 0router ospf 1network 192.168.4.0 0.0.0.255 area 0network 4.4.4.4 0.0.0.0 area 0router ospf 1 vrf Bluenetwork 192.168.1.0 0.0.0.255 area 0network 192.168.3.0 0.0.0.255 area 0router ospf 2 vrf Rednetwork 192.168.2.0 0.0.0.255 area 0network 192.168.4.0 0.0.0.255 area 0do sh ip ro vrf Blue ospfdo sh ip ro vrf Red ospfint e0/0ip add 12.1.1.1 255.255.255.0no shutint lo1ip add 192.168.1.1 255.255.255.0no shutint lo2ip add 192.168.2.1 255.255.255.0no shutexitip route 0.0.0.0 0.0.0.0 12.1.1.2do ping 12.1.1.2do ping 23.1.1.3do ping 23.1.1.3 source 192.168.1.1do ping 23.1.1.3 source 192.168.2.1ping 3.3.3.3 source 192.168.1.1int e0/0ip add 12.1.1.2 255.255.255.0no shutint e0/1ip add 23.1.1.2 255.255.255.0no shutexitip route 192.168.1.0 255.255.255.0 12.1.1.1ip route 192.168.2.0 255.255.255.0 12.1.1.1ip route 0.0.0.0 0.0.0.0 23.1.1.3do ping 23.1.1.3do ping 3.3.3.3do ping 8.8.8.8access-list 1 permit 192.168.1.0 0.0.0.255access-list 2 permit 192.168.2.0 0.0.0.255ip nat pool DNAT 23.1.1.100 23.1.1.200 netmask 255.255.255.0int e0/0ip nat insideint e0/1ip nat outsideexitip nat inside source list 1 pool DNATip nat inside source list 2 pool DNATexitsh ip nat translationssh ip nat statisticsconf tno ip nat inside source list 1 pool DNATno ip nat inside source list 2 pool DNATip nat pool PAT 23.1.1.2 23.1.1.2 netmask 255.255.255.0ip nat inside source list 1 pool DNAT overloadip nat inside source list 2 pool DNAT overloadexitdebug ip natint e0/0ip add 23.1.1.3 255.255.255.0no shutint lo1ip add 3.3.3.3 255.255.255.255no shutint lo2ip add 8.8.8.8 255.255.255.255no shutexitdo sh ip roconf tline vty 0 4password ciscologintransport input telnetifconfig eth0 192.168.3.2/24ip addr add 192.168.3.2/24 brd + dev eth0ip route add default via 192.168.3.1ping 192.168.3.1ping 12.1.1.1ping 12.1.1.2ping 23.1.1.2ip route add default 192.168.3.2/24 brd + dev eth0wiresharktelnet 23.1.1.3conf tint e0/1ip add 192.168.3.1 255.255.255.0no shutconf tip route 192.168.3.0 255.255.255.0 12.1.1.1access-list 3 permit 192.168.3.0 0.0.0.255ip nat inside source list 3 pool DNAT overloadint e0/0ip add 12.1.1.1 255.255.255.0no shutexitip route 0.0.0.0 0.0.0.0 12.1.1.2line vty 0 4password ciscologintransport input telnetint e0/0ip add 12.1.1.2 255.255.255.0no shutint e0/1ip add 23.1.1.2 255.255.255.0no shutexitip route 0.0.0.0 0.0.0.0 23.1.1.3telnet 12.1.1.1exitint e0/0ip nat insideint e0/1ip nat outsideexitip nat inside source static 12.1.1.1 23.1.1.10do sh ip nat translationsint e0/0ip add 23.1.1.3 255.255.255.0no shutexitdo ping 23.1.1.2telnet 23.1.1.10