對于一個局域網的外連,有很多種方式DDN專線就是其中的一種(具體外連方式請見網絡基礎部分).在下面的實例中介紹了藍色家園內部局域網接入當地ISP的配置.
藍色家園內部局域網:10.1.8.0/24
藍色家園路由器的Ethernet 0:10.1.8.1/24
Serial 0: 192.168.0.1/30
ISP路由器 Serial 0: 192.168.0.2/30
具體拓撲圖如下:
也許Cisco操作系統的玄虛性以及其在市場中的占有率,決定了人們對其技術的一種仰慕,甚至想把自己的技術奮斗目標與 Cisco 綁定.但是,技術總歸是技術,一切都是從頭開始的.
下面給出藍色家園路由器的基本配置
1.route>en 進入特權狀態
2.route#config t 通過端口進行配置
3.在配置狀態下
給出E0/S0的ip地址
#int e0/0
#ip add 10.1.8.1 255.255.255.0
#no shut
#int s0/0
#ip add 192.168.0.1 255.255.255.252
#en ppp (答應在專線上發送ppp包,假如不寫,對于兩端都是Cisco路由器是沒問題的,會默認為Cisco 自己的打包方式)
# no shut
4.給出藍色家園到ISP的路由,因為藍色家園只有一個出路,所以給出靜態路由
#ip route 0.0.0.0 0.0.0.0 192.168.0.2
或者
#ip route 0.0.0.0 0.0.0.0 serial 0
5.為了保證遠程治理的Telnet 必須給出登陸用戶
#line vty 0 4
#passWord bluegarden
6.Ctrl+Z退出特權配置狀態 wr將配置寫入路由器即可
當然以上只是一個基本配置,能夠保證數據通道的暢通.但是并沒有充分利用路由器的功能,例如:NAT、安全等等。
下面給出一個完整的配置 with NAT(為了明確例子,廣域網連接中的子網變成192.168.1.0/24)
hostname bluegarden
!
enable password bluegarden
!
no ip name-server
!
ip subnet-zero
no ip domain-lookup
ip routing
!
interface Ethernet 0
no shutdown
ip address 10.1.8.1 255.255.255.0
ip address 192.16.1.1 255.255.255.0
ip nat inside
!
interface Serial 0
no shutdown
ip address 192.168.1.2 255.255.255.0
ip nat outside
encapsulation hdlc
ip nat pool bluegarden 192.16.1.10 192.168.50 PRefix-length 24
ip nat inside source list 1 pool bluegarden
router rip
version 2
network 10.1.8.0 255.255.255.0
passive-interface Serial 0
access-list 1 permit 10.1.8.0 0.0.0.255
!
ip classless
!
ip route 0.0.0.0 0.0.0.0 Serial 0
no ip http server
snmp-server community public RO
no snmp-server location
no snmp-server contact
!
line console 0
password bluegarden
login
!
line vty 0 4
password bluegarden
login
!
end
>Ctrl Z
#wr
新聞熱點
疑難解答