EIGRP在企業內網的應用

R一、R二、R3模擬企業內網跑EIGRP路由協議,R3是企業網關,實現全網互通,內網經過NAT轉換訪問Internet,測試目標爲4.4.4.4/24
R1
en
conf t
line con 0
no exec-t
exit
host R1
int f0/0
no sh
ip add 192.168.12.1 255.255.255.0
exit
router eigrp 100
no au
net 192.168.12.0 0.0.0.255
end
===================R2===========================
en
conf t
line con 0
no exec-t
exit
host R2
int f0/0
no sh
ip add 192.168.12.2 255.255.255.0
int f1/0
no sh
ip add 192.168.23.2 255.255.255.0
exit
router eigrp 100
no au
net 192.168.12.0 0.0.0.255
net 192.168.23.0 0.0.0.255
end
================R3================================
en
conf t
line con 0
no exec-t
exit
host R3
int f0/0
no sh
ip add 192.168.23.3 255.255.255.0
int f1/0
no sh
ip add 34.34.34.3 255.255.255.0
int lo 0
ip add 3.3.3.3 255.0.0.0 
exit
router eigrp 100
no au
net 192.168.23.0 0.0.0.255
net 3.3.3.3 0.0.0.0
end
R3(config)#ip default-network 3.0.0.0
R3(config)#ip route 0.0.0.0 0.0.0.0 34.34.34.4
NAT配置
R3(config)#access-list 1 permit 192.168.0.0 0.0.255.255
R3(config)#ip nat inside source list 1 interface FastEthernet1/0 overload      
R3(config)#interface FastEthernet0/0
R3(config-if)#ip nat inside
R3(config)#interface FastEthernet1/0
R3(config-if)#ip nat outside
===================R4===========================
en
conf t
line con 0
no exec-t
exit
host R4
int f0/0
no sh
ip add 34.34.34.4 255.255.255.0
int lo0
no sh
ip add 4.4.4.4 255.255.255.0
實驗調試
R1#sh ip route     
Gateway of last resort is 192.168.12.2 to network 3.0.0.0
C    192.168.12.0/24 is directly connected, FastEthernet0/0
D*   3.0.0.0/8 [90/158720] via 192.168.12.2, 00:00:12, FastEthernet0/0
D    192.168.23.0/24 [90/30720] via 192.168.12.2, 00:07:52, FastEthernet0/0
 
R2#sh ip route
Gateway of last resort is 192.168.23.3 to network 3.0.0.0
C    192.168.12.0/24 is directly connected, FastEthernet0/0
D*   3.0.0.0/8 [90/156160] via 192.168.23.3, 00:01:13, FastEthernet1/0
C    192.168.23.0/24 is directly connected, FastEthernet1/0
 
實驗比較
在上篇文章中,RIPv 2在企業中應用,向內網注入默認路由時,R3的外接口進程未宣告進RIP協議中,而EIGRP中,必須將接口宣告進EIGRP進程中。不然沒法產生EIGRP的默認路由
請看下例:
R1#sh ip route     
C    192.168.12.0/24 is directly connected, FastEthernet0/0
D    192.168.23.0/24 [90/30720] via 192.168.12.2, 00:04:29, FastEthernet0/0
R1#ping 4.4.4.4
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 4.4.4.4,
timeout is 2 seconds:
.....
Success rate is 0 percent (0/5)
當將lo 0宣告進EIGRP進程後
R1#sh ip route     
Gateway of last resort is 192.168.12.2 to network 3.0.0.0
C    192.168.12.0/24 is directly connected, FastEthernet0/0
D*   3.0.0.0/8 [90/158720] via 192.168.12.2, 00:00:12, FastEthernet0/0
D    192.168.23.0/24 [90/30720] via 192.168.12.2, 00:07:52, FastEthernet0/0
R1#ping 4.4.4.4
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 4.4.4.4, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 108/197/288 ms
R1#tra        
R1#traceroute 4.4.4.4
Type escape sequence to abort.
Tracing the route to 4.4.4.4
  1 192.168.12.2 120 msec 76 msec 156 msec
  2 192.168.23.3 172 msec 120 msec 172 msec
  3 34.34.34.4 220 msec 208 msec *
 
NAT調試
R3#debug ip nat
IP NAT debugging is on
*Mar  1 00:18:18.635: %SYS-5-CONFIG_I: Configured from console by console
*Mar  1 00:18:19.939: NAT: s=192.168.23.2->34.34.34.3, d=4.4.4.4 [242]
*Mar  1 00:18:22.887: NAT*: s=192.168.23.2->34.34.34.3, d=4.4.4.4 [245]
*Mar  1 00:18:23.011: NAT: s=34.34.34.4, d=34.34.34.3->192.168.23.2 [0]
*Mar  1 00:18:39.455: NAT*: s=192.168.12.1->34.34.34.3, d=4.4.4.4 [30]
*Mar  1 00:18:39.599: NAT*: s=4.4.4.4, d=34.34.34.3->192.168.12.1 [30]
*Mar  1 00:18:39.675: NAT*: s=192.168.12.1->34.34.34.3, d=4.4.4.4 [31]
*Mar  1 00:18:39.755: NAT*: s=4.4.4.4, d=34.34.34.3->192.168.12.1 [31]
*Mar  1 00:18:39.911: NAT*: s=192.168.12.1->34.34.34.3, d=4.4.4.4 [32]
*Mar  1 00:18:40.003: NAT*: s=4.4.4.4, d=34.34.34.3->192.168.12.1 [32]
*Mar  1 00:18:40.115: NAT*: s=192.168.12.1->34.34.34.3, d=4.4.4.4 [33]
*Mar  1 00:18:40.175: NAT*: s=4.4.4.4, d=34.34.34.3->192.168.12.1 [33]
*Mar  1 00:18:40.271: NAT*: s=192.168.12.1->34.34.34.3, d=4.4.4.4 [34]
*Mar  1 00:18:40.299: NAT*: s=4.4.4.4, d=34.34.34.3->192.168.12.1 [34]
*Mar  1 00:19:07.327: NAT*: s=192.168.23.2->34.34.34.3, d=4.4.4.4 [277]
*Mar  1 00:19:07.439: NAT: s=34.34.34.4, d=34.34.34.3->192.168.23.2 [6]
*Mar  1 00:19:16.523: NAT*: s=192.168.23.2->34.34.34.3, d=4.4.4.4 [285]
實驗注意事項:
  • ip default-network 必須有類
  • 外網接口必須有類
  • 外接口必須宣告進EIGRP進程中
通常電信或網通營運商分給公司的ip地址是可變的無類ip,解決接口有類的方法是在路由器上啓用一個環回口配製成有類IP並宣告到EIGRP進程中。
相關文章
相關標籤/搜索