国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 學(xué)院 > 網(wǎng)絡(luò)通信 > 正文

結(jié)合實例講解廣域網(wǎng)路由基本技術(shù)

2019-11-05 00:40:41
字體:
供稿:網(wǎng)友

  我們假定讀者對ip協(xié)議有一定程度的了解(不了解IP協(xié)議永遠無法維護一個IP網(wǎng)絡(luò)),比如至少懂得IP地址的結(jié)構(gòu)、類別和子網(wǎng)、子網(wǎng)掩碼的概念,并且具有一定的計算機基礎(chǔ)知識。在配置路由器時,只要將計算機的串口通過路由器自帶的專用電纜接到Console口,使用諸如超級終端或者Netterm之類的軟件即可。
  
  網(wǎng)絡(luò)中的只有一塊網(wǎng)卡(一個IP地址)任何一臺主機只能直接訪問本子網(wǎng)內(nèi)的機器。而路由器相當(dāng)于一臺由多個網(wǎng)卡的主機,每一塊網(wǎng)卡可以直接與一個子網(wǎng)通信。根據(jù)上圖我們知道,兩個網(wǎng)絡(luò)相連主要是通過在其間建立一個廣域網(wǎng)互聯(lián)子網(wǎng)來進行。這個子網(wǎng)中只有兩臺機器,即兩邊的路由器,當(dāng)然它的子網(wǎng)掩碼就是255.255.255.252。只要路由器A、B的Seiral口在同一個子網(wǎng),由于它們的Ethernet口分別屬于A、B兩網(wǎng),我們就在A、B網(wǎng)之間建立了一條通道。網(wǎng)絡(luò)A中的主機只要將網(wǎng)關(guān)設(shè)為路由器A,其信息即可通過路由器A、B轉(zhuǎn)發(fā)到B網(wǎng)。
  
    我們在例子中使用的是應(yīng)用最廣泛的Cisco 2501路由器,這種路由器物理結(jié)構(gòu)簡單,網(wǎng)絡(luò)接口只有兩個Serial口和一個Ethernet口,卻支持完整的路由功能。采用的協(xié)議為TCP/IP,因為現(xiàn)在使用其他諸如IPX、Netbeui之類的協(xié)議已經(jīng)是非常的不合時宜。
  
  實例1:通過Cisco 2501連接A局域網(wǎng)與B局域網(wǎng)
  
  假設(shè)實驗條件如下:
  
  A網(wǎng):202.96.199.0——202.96.199.255
  B網(wǎng):202.97.76.0——202.97.76.31
  DNS Server:202.96.199.2(主),202.96.199.3(備)
  所屬域:xxx.com
  廣域網(wǎng)互聯(lián):需要一個包含4個IP地址(2個可用IP)的子網(wǎng),
  定為:202.98.0.0——202.98.0.3,其中202.98.0.1給A網(wǎng),202.98.0.2給B網(wǎng)
  互聯(lián)專線速率:128kbps
  
  
  具體網(wǎng)絡(luò)參數(shù)分配表如下:
  
  項目 A網(wǎng) B網(wǎng)
  網(wǎng)絡(luò)號 202.96.199.0 202.97.76.0
  子網(wǎng)掩碼 255.255.255.0 255.255.255.224
  所屬域 xxx.com yyy.com
  以太網(wǎng)地址 202.96.199.1 202.97.76.1
  互聯(lián)地址 202.98.0.1 202.98.0.2
  專線速率 128kbps 同左
  域名服務(wù)器 主:202.96.199.2
  備:202.96.199.3 同左
  
   首先進入路由器:將你的計算機串行口連接到路由器的Console口,使用Netterm或者超級終端之類的軟件登錄。
  
  
  Router>en:
  
  passwd:******(輸入超級口令)
  
  
  全局配置:(A、B網(wǎng)相同)
  
  
  Router#conf terminal(切換到配置狀態(tài))
  
  Router(config)#enable secret my-root-passWord(定義超級口令)
  
  Router(config)#ip host Router-A(定義路由器名,B網(wǎng)為Router-B)
  
  Router(config)#ip domain-name xxx.com(定義所屬域名稱,B網(wǎng)為yyy.com)
  
  Router(config)#nameserver 202.96.199.2(定義主域名服務(wù)器)
  
  Router(config)#nameserver 202.96.199.3(定義備域名服務(wù)器)
  
  Router(config)#ip classless
  
  Router(config)#line vty 0 4
  
  (定義5個telnet虛終端,即可以同時有5個人登錄本路由器)
  
  Router(config-line)#password my-telnet-password(定義telnet口令)
  
  Router(config-line)#exit
  
  Router(config)#exit
  
  
  地址和路由配置:
  
  /****** A網(wǎng)路由器 ******/
  
  Router-A#conf t(切換到配置狀態(tài))
  
  Router-A(config)#int e0(配置Ethernet 0口)
  
  Router-A(config-if)#description the LAN port link to my local network(端口說明)
  
  Router-A(config-if)#ip add 202.96.199.1 255.255.255.0
  
  (定義以太網(wǎng)IP地址,子網(wǎng)掩碼表示為C類網(wǎng)絡(luò))
  
  Router-A(config-if)#no shutdown(激活端口)
  
  Router-A(config-if)#exit
  
  Router-A(config)#int s0(配置Serial 0口)
  
  Router-A(config-if)#description the WAN port link to Router-B(端口說明)
  
  Router-A(config-if)#ip add 202.98.0.1 255.255.255.252(定義互聯(lián)廣域網(wǎng)IP地址)
  
  Router-A(config-if)#bandwidth 128(定義端口速率,單位:kbps)
  
  Router-A(config-if)#no shutdown(激活端口)
  
  Router-A(config-if)#exit
  
  Router-A(config)#ip route 202.97.76.0 255.255.255.224 202.98.0.2
  
  (定義靜態(tài)路由,通過網(wǎng)關(guān)到達對端局域網(wǎng)絡(luò),IP為對端廣域網(wǎng)IP地址)
  
  Router-A(config)#exit
  
  Router-A#wr m(保存配置)
  
  
  /****** B網(wǎng)路由器 ******/
  
  Router-B#conf t
  
  Router-B(config)#int e0
  
  Router-B(config-if)#description the LAN port link to my local network(端口說明)
  
  Router-B(config-if)#ip add 202.97.76.1 255.255.255.224
  
  (定義以太網(wǎng)IP地址,子網(wǎng)掩碼表示為擁有32個地址的子網(wǎng))
  
  Router-B(config-if)#no shutdown
  
  Router-B(config-if)#exit
  
  Router-B(config)#int s0
  
  Router-B(config-if)#description the WAN port link to Router-A(端口說明)
  
  Router-B(config-if)#ip add 202.98.0.2 255.255.255.252
  
  Router-B(config-if)#bandwidth 128
  
  Router-B(config-if)#no shutdown
  
  Router-B(config-if)#exit
  
  Router-B(config)#ip route 202.96.199.0 255.255.255.0 202.98.0.1
  
  (定義靜態(tài)路由,通過網(wǎng)關(guān)到達對端局域網(wǎng)絡(luò),IP為對端廣域網(wǎng)IP地址)
  
  Router-B(config)#exit
  
  Router-B#wr m(保存配置)
  配置完成.
    這里是A網(wǎng)、B網(wǎng)路由器配置清單。
  Router A:
  
  Router-A#sh run
  
  Building Configuration...
  Current configuration
  version 11.2
  service udp-small-servers
  service tcp-small-servers
  hostname Router-A
  enable secret test-a
  ip subnet-zero
  interface Ethernet0
  description the LAN port link to my local network
  ip address 202.96.199.1 255.255.255.0
  interface Serial0
  description the WAN port link to Router-B
  ip address 202.98.0.1 255.255.255.252
  bandwidth 128
  interface Serial1
  no ip address
  shutdown
  ip domain-name xxx.com
  ip name-server 202.96.199.2
  ip name-server 202.96.199.3
  ip classless
  ip route 202.97.76.0 255.255.255.224 202.98.0.2
  line con 0
  line aux 0
  line vty 0 4
  password telnet-a
  login
  end
  Router-A#
  Rouer B:
  Router-B#sh run
  
  Building Configuration...
  Current configuration
  version 11.2
  service udp-small-servers
  service tcp-small-servers
  hostname Router-B
  enable secret test-b
  ip subnet-zero
  interface Ethernet0
  description the LAN port link to my local network
  ip address 202.97.76.1 255.255.255.224
  interface Serial0
  description the WAN port link to Router-A
  ip address 202.98.0.2 255.255.255.252
  bandwidth 128
  interface Serial1
  no ip address
  shutdown
  ip domain-name yyy.com
  ip name-server 202.96.199.2
  ip name-server 202.96.199.3
  ip classless
  ip route 202.96.199.0 255.255.255.0 202.98.0.1
  line con 0
  line aux 0
  line vty 0 4
  password telnet-b
  login
  end
  Router-B#
  
  
  實例2:通過Cisco 2501將你的局域網(wǎng)接入Internet
  
  
  假設(shè)實驗條件如下:
  
  本網(wǎng)IP地址為:202.96.199.0——202.96.199.255
  DNS Server:202.96.202.96(主),202.96.96.202(備)
  ISP分配的廣域網(wǎng)互聯(lián)IP地址為202.98.0.2
  
  
  具體網(wǎng)絡(luò)參數(shù)分配表如下:
  
  項目 用戶網(wǎng)絡(luò) ISP網(wǎng)絡(luò)
  網(wǎng)絡(luò)號 202.96.199.0
  子網(wǎng)掩碼 255.255.255.0
  所屬域 xxx.com
  以太網(wǎng)地址 202.96.199.1
  互聯(lián)地址 202.98.0.2 202.98.0.1
  專線速率 128kbps 同左
  域名服務(wù)器 主:202.96.202.96
  備:202.96.96.202
  
  我們已經(jīng)有了上例的經(jīng)驗,則很輕易根據(jù)相同的原理配置這個路由器。
  
  
  首先進入路由器:
  
  Router>en:
  
  passwd:
  
  
  全局配置:
  
  Router#conf t
  
  Router(config)#ip host Router
  
  Router(config)#nameserver 202.96.202.96
  
  Router(config)#nameserver 202.96.96.202
  
  Router(config)#exit
  
  其他項目同“例一”。
  
  
  地址配置:
  
  Router#conf t
  
  Router(config)#int e0
  
  Router(config-if)#description the LAN port link to my local network(端口說明)
  
  Router(config-if)#ip add 202.96.199.1 255.255.255.0
  
  Router(config-if)#no shutdown(激活端口)
  
  Router(config-if)#exit
  
  Router(config)#int s0
  
  Router(config-if)#description the WAN port link to Internet(端口說明)
  
  Router(config-if)#ip add 202.98.0.2 255.255.255.252
  
  Router(config-if)#no shutdown(激活端口)
  
  Router(config-if)#exit
  
  
  路由配置:
  
  Router(config)#ip route 0.0.0.0 0.0.0.0 202.98.0.1
  
  (定義默認(rèn)靜態(tài)路由,所有的遠程訪問通過網(wǎng)關(guān),IP為對端廣域網(wǎng)IP地址)
  
  Router(config)#exit
  
  Router#wr m
  
  
    配置完成。
  
  
    這里是本網(wǎng)路由器配置清單。
  Router#sh run
  Building Configuration...
  Current configuration
  version 11.2
  service udp-small-servers
  service tcp-small-servers
  hostname Router
  enable secret test
  ip subnet-zero
  interface Ethernet0
  description the LAN port link to my local network
  ip address 202.96.199.1 255.255.255.0
  interface Serial0
  description the WAN port link to Internet
  ip address 202.98.0.2 255.255.255.252
  bandwidth 128
  interface Serial1
  no ip address
  shutdown
  ip domain-name xxx.com
  ip name-server 202.96.202.96
  ip name-server 202.96.96.202
  ip classless
  ip route 0.0.0.0 0.0.0.0 202.98.0.1
  line con 0
  line aux 0
  line vty 0 4
  password telnet
  login
  end
  Router#
  
  
  實例3:使用Cisco路由器對大型網(wǎng)絡(luò)(例如ISP網(wǎng)絡(luò))進行擴容
  
  
    當(dāng)然,設(shè)計治理大型網(wǎng)絡(luò)的路由非常復(fù)雜,一般都是由經(jīng)過高級培訓(xùn)的專業(yè)人士進行。而且,大型網(wǎng)絡(luò)一般都采用像Cisco 7507這樣的高檔路由器。在這里順便簡單講述,主要是讓大家開闊一下視野,了解一下其他的路由協(xié)議。
  
    這時,與例2唯一的不同就是路由配置,不能采用靜態(tài)路由協(xié)議而應(yīng)該相應(yīng)地采用非常優(yōu)秀的OSPF動態(tài)路由協(xié)議并結(jié)合RIP協(xié)議。
  
  假設(shè)具體網(wǎng)絡(luò)參數(shù)如下:
  
  項目 本地網(wǎng)絡(luò)
  網(wǎng)絡(luò)號 202.96.199.0
  子網(wǎng)掩碼 255.255.255.0
  OSPF編號 100
  OSPF域 202.96.192.0——202.96.207.255,16個C
  
  那么應(yīng)該這樣配置:
  
  Router(config)#router ospf 100(配置OSPF路由)
  
  Router(config-router)#summary-address 202.96.199.0 255.255.255.0
  
  Router(config-router)#redistribute connnected metric-type 1 subnets
  
  Router(config-router)#redistribute static(通過OSPF協(xié)議廣播靜態(tài)路由)
  
  Router(config-router)#network 202.96.192.0 0.0.15.255 area 0.0.0.0
  
  Router(config-router)#area 0.0.0.0 authentiication message-digest
  
  Router(config-router)#exit
  
  Router(config)#router rip(配置RIP路由)
  
  Router(config-router)#redistribute ospf 100 metric 1(通過RIP協(xié)議廣播OSPF路由)
  
  Router(config-router)#passive-interface Serial 0(不在Serial 0上使用)
  
  Router(config-router)#network 202.101.199.0(定義本網(wǎng)絡(luò))
  
  Router(config-router)#exit
  
  Router(config)exit
  
  
  同時,采用OSPF協(xié)議時應(yīng)該在廣域網(wǎng)端口上加入授權(quán)機制:
  
  Router(config)#int s0
  
  Router(config-if)#ip ospf message-digest-key keyword
  
  Router(config-if)#exit
  
  Router(config)#exit
  
  Router#wr m
  
  
  更大型的網(wǎng)絡(luò)會采用BGP邊緣路由協(xié)議,假設(shè)具體網(wǎng)絡(luò)參數(shù)如下:
  
  
  項目 本地網(wǎng)絡(luò) 遠程網(wǎng)絡(luò)
  AS(自治域) 20000 4000
  本地BGP網(wǎng)絡(luò) 202.96.192.0——202.96.207.255,16個C
  202.97.0.0——202.97.15.255,16個C
  202.98.128.0——202.98.159.255,32個C
   
  互聯(lián)地址 202.100.4.2 202.100.4.1
  
  則本地路由器配置方法為:
  
  Router(config)#router bgp 20000(定義本BGP治理的AS--自治域編號)
  
  Router(config-router)#no synchronization
  
  Router(config-router)#network 202.96.192.0 mask 255.255.240.0
  
  (定義本AS--自治域包含的網(wǎng)絡(luò))
  
  Router(config-router)#network 202.97.0.0 mask 255.255.240.0
  
  Router(config-router)#network 202.98.128.0 mask 255.255.224.0
  
  Router(config-router)#neighbor 202.100.4.1 remote-as 4000
  
  (定義到遠端AS--自治域的網(wǎng)關(guān)IP)
  
  Router(config-router)#exit
  
  Router(config)#exit
  
  Router#wr m
    配置完成。
  實用技術(shù)
  
  一、使用口令加密機制:
  Router(config)#service password-encryption(路由器密碼將以暗碼顯示)
  二、配置http server,以便從瀏覽器訪問路由器:
  Router(config)#ip http server
  三、訪問控制:
  Router(config)#access-list 101 permit ip 10.150.0.0 0.0.255.255 any
    (答應(yīng)10.150.0.0——10.150.255.255訪問)
  Router(config)#access-list 101 deny ip 10.151.0.0 0.0.255.255 any
    (禁止10.151.0.0——10.150.255.255訪問
  四、負載分擔(dān):
  要實現(xiàn)負載分擔(dān)必須使用動態(tài)路由協(xié)議,以O(shè)SPF為例,只要將兩條路由的代價(cost)設(shè)為相等,即可自動實現(xiàn)。
  默認(rèn)的OSPF代價為廣域網(wǎng)線路64,局域網(wǎng)線路30,設(shè)置路徑代價的命令為:
    Router(config-if)#ip ospf cost xx。
  五、常用命令:
  Router#help/?(獲得幫助)
  Router#sh run(顯示路由器當(dāng)前配置)
  Router#sh int Xn(接口名稱,例如Ethernet 0、Serial 1等,顯示接口狀態(tài))
  Router#sh ip route(顯示當(dāng)前路由)
  Router#wr m(儲存配置,以便下次重啟時使用)
  Router#reload(重啟路由器)
  Router#ping ip-address(測試與其他主機的連接)
  Router#telnet host(登錄其它主機)


發(fā)表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發(fā)表
主站蜘蛛池模板: 棋牌| 安西县| 黄龙县| 肥东县| 玉田县| 呼伦贝尔市| 舟山市| 图木舒克市| 陈巴尔虎旗| 昌平区| 巩留县| 当阳市| 新平| 常熟市| 南雄市| 普洱| 股票| 临漳县| 三河市| 买车| 水富县| 巴南区| 呼伦贝尔市| 霞浦县| 宜兴市| 文水县| 广安市| 宁德市| 灵武市| 塔城市| 扎兰屯市| 吴堡县| 新郑市| 吕梁市| 红安县| 中山市| 通江县| 隆回县| 特克斯县| 华坪县| 宜兴市|