2010年8月17日 星期二

網路工程師之CCNA實戰手冊

由於工作是網路工程師,但關於CCNA的知識是三年前學的了@@所以全忘了~最近k回,也做了些筆記,也給需要的人參考^^
這份手冊目的是快速了解Cisco設備操作所需的知識與操作方法,
在原理的部份還是要參考原廠的書目。下面把整個CCNA的知識以實務的角度拆解成三部份,第一部份是任何Cisco設備都共有的基本操作、第二部份是 Switch上所需的操作,如VLAN與Spanning-Tree,第三部份是Router的操作,如Routing、NAT、ACL、WAN封裝。

一、Cisco 設備基本操作

I. 登入:
(1) 密碼設定:
登入Cisco設備要記住,第一步就是把密碼變成你的密碼,這樣才能掌控這台設備的所有權!如下為如何更改Enable的密碼:


Router800>
Router800>en
Router800#conf t
Router800(config)#enable ?
last-resort Define enable action if no TACACS servers respond
password Assign the privileged level password
secret Assign the privileged level secret
use-tacacs Use TACACS to check enable passwords
Router800(config)#enable secret enablepass

實務上不會設置enable password,而是直接enable seceret。除了enable外,也常更改telnet的密碼,好方便未來管理


Router800(config)#line ?
<0-5> First Line number
console Primary terminal line
vty Virtual terminal
Router800(config)#line vty 0 4
Router800(config-line)#password vtypass
Router800(config-line)#login

如果希望不用密碼就直接登入,可以用 no login
最後,不希望任何人接上console就可以動你的設備的話,就要更改Console的密碼


Router800(config)#line console 0
Router800(config-line)#password consolepass

上面即是設定密碼為'consolepass'


Router800(config-line)#login
Router800(config-line)#logging synchronous

最後一個用Loggin synchronous可以讓介面不再不斷跑出訊息,比較不容易亂
(2) 登入資訊:
登入資訊會有兩個要改,一個是hostname,可以方便知道目前在哪一台?也能讓其它設備快速知道這台是什麼。另一個是登入資訊(banner),讓不小心連到設備的人,可以宣告一下主權(單純警示作用)。


Router800(config)#hostname Cisco800Router
Cisco800Router(config)#

再來再改一下登入資訊


Cisco800Router(config)#banner line
Enter TEXT message. End with the character 'l'.
The Login Action is prohibited !!
l

最後用小寫l結尾,這樣要login就會看到這個訊息
(3) 蓋掉密碼:
很容易發生一種狀況~那就是'密碼忘記'!!不管是剛設的或是別人設定的,都會發生!!每台的方式不一樣,到這個網站找到你的型號,一步步跟著設定即可:
http://www.cisco.com/en/US/products/sw/iosswrel/ps1831/products_tech_note09186a00801746e6.shtml

II. 了解資訊:
(1)show running-config
時常會有接觸一台未知設備的狀況,show run永遠是最快、最常用來了解一台設備的指令


Cisco800Router#sh run
Building configuration...
Current configuration : 907 bytes
!
version 12.2
no parser cache
no service single-slot-reload-enable
no service pad
service timestamps debug uptime
service timestamps log uptime
no service password-encryption
!
hostname Cisco800Router
!
logging rate-limit console 10 except errors
enable secret 5 $1$G9.P$qSkGqo8i.Z8no8/A584aO.
enable password enablepass
!
mmi polling-interval 60
no mmi auto-configure
no mmi pvc
mmi snmp-timeout 180
ip subnet-zero
!!
no ip dhcp-client network-discovery
!
!
!
interface Ethernet0
no ip address
shutdown
!
interface ATM0
no ip address
shutdown
no atm ilmi-keepalive
dsl operating-mode auto
!
ip classless
no ip http server
!
banner login ^CINE
The login action to this appliance is prohibit!!
^C
banner motd ^Cine
The Login Action is prohibited !!
L^C
!
line con 0
password consolepass
logging synchronous
login
stopbits 1
line vty 0 4
password vtypass
login
!
scheduler max-task-time 5000
end

如上,就可以看到剛才設定的資訊了^^ 通常還會再搭配pipline | 來做過濾查尋,
比如要只看某介面,可以用


Cisco800Router#sh run | begin interface

或是只想看某個關鍵字的資訊,可用include


Cisco800Router#sh run | include 192.168.1.1

(2)其它常用資訊查尋指令


Show version

顯示硬體、軟體資訊


Show interface

查看每個介面的資訊


Show ip interface brief

快速看每個介面IP資訊


Show protocols

快速查看Layer1與Layer2之間的狀態


Show cdp nei

查看直接連接設備的資訊


Show ip route

快速了解路徑表
大致了解完這台設備的狀況後,就可以開始設定啦!


III. 網路設定:
(1) IP設定
IP的變更是任何設備必定的,方法很簡單,進到某一個介面裡之後,再敲ip address就可以設定了:


Cisco800Router(config)#interface ethernet 0
Cisco800Router(config-if)#ip address 192.168.1.1 255.255.255.0
Cisco800Router(config-if)#no shutdown

這裡還有一個指令 no shutdown,就是shutdown的反過來,也就是打開介面的意過,Cisco預設上port是關閉的,設定後需要啟動port才能使用。
習慣再用show ip interface brief看一下介面資訊:


Cisco800Router#show ip interface brief
Interface IP-Address OK? Method Status Protocol
ATM0 unassigned YES NVRAM administratively down down
Ethernet0 192.168.1.1 YES NVRAM up down

通常會注意兩個地方Status,與Protocol,Status可以用來檢驗自已有沒有下'no showdown'來把介面打開,而protocol則是用來看實體的連線狀況有沒有連線上。再來,IP設定好之後,會再為這個介面加上描述,方便未來查修與維護


Cisco800Router(config)#interface eth0
Cisco800Router(config-if)#description LAN Port to CoreSW

上面的'LAN Port to CoreSW'即為說明,重點是方便辨別而已。
(2) 閘道設定
IP設定好之後,會再設定gateway,好可以從其它網段連過來管理


Cisco800Router(config)#ip default-gateway 192.168.1.99 255.255.255.0

雖然在外部router上設定內部IP為default gateway是很奇怪的~這裡只是Demo指令,了解指令怎麼下就ok了
(3) SSH設定
通常客戶會要求把telnet給關掉,開啟SSH。當然!我們也必需這麼建議客戶才對, 設定之前一定要有主機名稱與網域名稱:


RouterA(config)#ip domain-name test.com

再來就是產生ssh的鑰匙


RouterA(config)#crypto key generate rsa general-keys modulus 1024
The name for the keys will be: RouterA.test.com
% The key modulus size is 1024 bits
% Generating 1024 bit RSA keys, keys will be non-exportable...[OK]
*Mar 1 02:47:56.055: %SSH-5-ENABLED: SSH 1.99 has been enabled
產生好之後再進到vty介面裡面設定驗證方式,下面是用router本身來驗證:
RouterA(config)#line vty 0 181
RouterA(config)#login local

再指定只用ssh驗證,不用telnet:
RouterA(config-line)#transport input ssh

最後面的transport input ssh後面可以再加上telnet,如果沒有加的話就不能telnet進來了。
設好後,這時候登入你會發覺沒有帳號密碼可用@@再補一下:
RouterA(config)#username oya password 1234

都ok後就用ssh登入看看,也可以在router上透過show ip ssh 與show ssh來檢示狀態。
(如果是linux的OS,很容易遇到Host key verification failed,這是只要把家目錄下的.ssh清掉,再登一次就ok啦!)

(4) 開啟Web管理介面
如果要方便管理與VPN的設置,可以開啟Web管理介面,方法很簡單,指令如下:


Cisco800Router(config)#ip http server

再打開流覽器從之前設置的IP登入,預設的帳號是admin,密碼是之前設定enable的密碼。
老實說,這個介面通常是方便工程師做設定,後續客戶比較希望不要在router或switch上開啟http server,那就把它關閉吧^^


Cisco800Router(config)#no ip http server


IV. 儲存、備份、還原:
(1) 儲存設定資訊
該設的設了,該看的也看了,這時記得把設定的資料儲到 NVRAM裡面,簡單的說就像打Word打到一半,要記得存檔一樣,指令很簡單:


Cisco800Router#copy run start
Destination filename [startup-config]?
Building configuration...
[OK]

其實全名是copy running-config startup-config 可以用簡稱,如果沒有自已取名稱,
直接Enter就會以startup-config命名。
(2) Backup & Restore
不論備份、還原,通常只會在這四個地方跑,flash(放IOS的地方)、running-config(放在RAM)、start-config(放在 nvram)、tftp(通常是工程師的電腦), 再搭配一個萬用指令'copy'就可以完成各式的備份與環原啦。但是…在做一切動作之前,一定要先確認兩件事,主機有沒有連通?(Ping一下就知道), 空間夠不夠? (如show flash看flash會不會爆掉) 再來就開始備份一個flash到tftp看看Sad其它只是start-config,running-config的替換而已)


Cisco800Router#copy flash:
Cisco800Router#copy flash:c820-sy6-mz.122-2.XH2.bin tf
Cisco800Router#copy flash:c820-sy6-mz.122-2.XH2.bin tftp://192.168.1.2
Address or name of remote host [192.168.1.2]?
Destination filename [c820-sy6-mz.122-2.XH2.bin]? c820-sy6-mz.122-2.XH2.bin
TFTP: error code 1 received - File not found

%Error opening tftp://192.168.1.2/c820-sy6-mz.122-2.XH2.bin (Undefined error)

嗯!如果你的tftp上面沒有檔案,就會出現這個問題,所以也先加一個一樣檔名的檔案,再試一次:


Cisco800Router#copy flash:c820-sy6-mz.122-2.XH2.bin tftp://192.168.1.2
Address or name of remote host [192.168.1.2]?
Destination filename [c820-sy6-mz.122-2.XH2.bin]?
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
3974852 bytes copied in 25.404 secs (158994 bytes/sec)

在cisco看到一堆驚嘆號就是好事!沒錯,我們成功了^^
另外補充一個較常用來將running-config儲到start-config的指令:


Cisco800Router#wri mem
Building configuration...
[OK]

這個指令很直觀,write memory就是直接寫入記憶體。

二、關於Switch
(1) Spanning Tree
spanning tree的目的在避免迴圈與廣擴風暴,會發生這樣的問題在於到同一個目的地可以透過兩台Switch的路徑到達,當然,這個設定很好,當其中一條路出現問 題時,有另外一條備援,但是IPv4的Broadcast會使用迴圈的廣擴災難產生@@,所以只要設定spaning tree之後,switch之間就會自動溝通,建立較快的路徑連線,關閉較慢的路線,避免迴圈問題,真好用。可以先用show spanning-tree了解目前現有的spanning-tree下:

引言回覆:
SW2950-1#sh spanning-tree
No spanning tree instance exists.

啥咪也沒有~嗯!那我們就來設一個吧!!

引言回覆:
SW2950-1(config)#spanning-tree mode mst
SW2950-1(config)#exit
SW2950-1#show spanning-tree
MST00
Spanning tree enabled protocol mstp
Root ID Priority 32768
Address 000e.6aea.a800
Cost 300019
Port 2 (FastEthernet0/2)
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Bridge ID Priority 32768 (priority 32768 sys-id-ext 0)
Address 0015.f9ee.cf40
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Interface Role Sts Cost Prio.Nbr Type
---------------- ---- --- --------- -------- --------------------------------
Fa0/2 Root FWD 200000 128.2 P2p Bound(RSTP)
Gi0/1 Desg BLK 20000 128.25 P2p

很自動地幫我們建好spanning-tree了,真是方便呀!接下來從這台Switch的Gi0/1對接的另一顆Switch上我們也開啟spanning-tree之後,看一下變化:


SW2950-1#sh spanning-tree
MST00
Spanning tree enabled protocol mstp
Root ID Priority 32768
Address 0009.b730.0c00
Cost 0
Port 25 (GigabitEthernet0/1)
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Bridge ID Priority 32768 (priority 32768 sys-id-ext 0)
Address 0015.f9ee.cf40
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Interface Role Sts Cost Prio.Nbr Type
---------------- ---- --- --------- -------- --------------------------------
Fa0/2 Desg FWD 200000 128.2 P2p Bound(RSTP)
Gi0/1 Root FWD 20000 128.25 P2p
Connection closed by foreign host.

看到了嗎?原本Gi0/1為block port,現在變為 Forward了。

(2) VLAN
Virtual LAN顧名思意就是虛擬的、邏輯的,讓我們可以在同一台Switch上分割不同的brocast domain,讓坐在同一個辦公室卻不同部門的人流量是不會互通的^^
設定方式要先為開啟一個VLAN,然後再進到某個介面將VLAN分配給它:
開啟VLAN(下面開啟了VLAN2與VLAN3,且取了名稱)


SW2950-1(config)#vlan 2
SW2950-1(config-vlan)#name Sales
SW2950-1(config-vlan)#exit
SW2950-1(config)#vlan 3
SW2950-1(config-vlan)#name Engineer

再來進到介面裡將VLAN分配給它吧!


SW2950-1(config)#interface fa 0/5
SW2950-1(config-if)#switchport mode access
SW2950-1(config-if)#switchport access vlan 2

上面同時還指定了port為Access port,最後再利用show vlan確認一下,VLAN就這麼簡單而已!!接下來再加上VTP才好玩~

(3) VTP
VTP全名為VLAN Trunking Protocol,這是Switch對Switch或是Switch對Router之間的溝通協定,這是很棒的協定,如果沒有它的話我們只能在單一台 Switch上設定VLAN,而不能與其它設備的VLAN互通。(VTP是用VLAN1進行溝通的)
運作VTP的設備有三種模式: Server Mode,Transparent Mode,Client Mode。通常設定選擇一台為Server Mode,其它台為Client Mode即可; 而在舊環境加入新的設備,可以在新設備上設定Transparent Mode來學習。
首先在2950-2上設定為VTP Client:


SW2950-2(config)#vtp mode client
Setting device to VTP CLIENT mode.
SW2950-2(config)#vtp domain ringline
Changing VTP domain name from NULL to ringline

除了設定模式,也要指令Domain,相同Domain的VTP才會溝通喔!再來再到2950-1設定VTP Server:


SW2950-1(config)#vtp mode server
Setting device to VTP SERVER mode
SW2950-1(config)#vtp domain ringline
Changing VTP domain name from CISCO to ringline

接下來還要設定一個東西,叫Trunk Port,到指定的介面開啟Trunk,這樣就可以讓VTP溝通了Sad兩邊都要設喔)


SW2950-2(config)#interface gi 0/1
SW2950-2(config-if)#switchport mode trunk

這時可以用show vtp status 來看設定狀況,也可以在2950-2用show vlan看看有沒有與server同步了,再接下來可以試試從vtp server增加、刪除vlan看看vtp client有沒有同步。

三、關於Router
(1)Routing
1. 靜態路由
這是最基本的Routing,只要告訴Router,看到哪些網段時,就往哪裡丟,如:


RT2600(config)#ip route 10.0.0.0 255.0.0.0 192.168.1.1

上面說的就是任何到10.0.0.0/8網段的封包,都往192.168.1.1送。
靜態路由還有一個常用的就是Default Gateway,有幾種設定方式:


RT2600(config)#ip route 0.0.0.0 0.0.0.0 192.168.1.1
RT2600(config)#ip route 0.0.0.0 0.0.0.0 s 0/0
RT2600(config)#ip default-network 1972.168.1.1

上面三個指令其實是一樣的,挑喜歡的打就好。
2. 動態路由 – RIP
RIP全名為Routing Information Protocol, 這應該是最普遍的動態路由協定了,每30秒會傳送一次routing 資訊,最多可以到15個Hop。
在設定上也很簡單,只是靜態路由設定的是跨過router之後的網段,而動態路由設定的是直接介面相連的網段,因為Router會互相交換資訊,所以router本身只需要知道他自身連接的網段就夠了,下面設定了兩個網段192.168.1.0與10.1.1.0!


RT2600-2(config)#router rip
RT2600-2(config-router)#network 192.168.1.0
RT2600-2(config-router)#network 10.1.1.0

只設定一顆,利用show ip route會發覺仍然沒有Routing資訊,需要兩邊都設定才有:


RT2600-1(config)#router rip
RT2600-1(config-router)#network 172.16.6.0
RT2600-1(config-router)#network 10.1.1.0

完成後利用show ip route來看路由資訊


RT2600-1#show ip route
Gateway of last resort is not set
172.16.0.0/24 is subnetted, 1 subnets
C 172.16.6.0 is directly connected, FastEthernet0/1
10.0.0.0/24 is subnetted, 1 subnets
C 10.1.1.0 is directly connected, FastEthernet0/0
R 192.168.1.0/24 [120/1] via 10.1.1.2, 00:00:01, FastEthernet0/0

最下面的R就是我們透過RIP所溝通到的路由資訊,也就是RIP設定完成^^
3. 動態路由 – IGRP
IGRP全名為Interior Gateway Routing Protocol,這是Cisco獨有的動態路由協定,所以只要有非Cisco的router就沒法溝通啦。目前新的IOS都不支援這個協定了,改用比IGRP更強的EIGRP來做。
4. 動態路由 – EIGRP


EIGRP全名為Enhanced Interior Gateway Routing Protocol,就是用來加強IGRP的協定,也一樣,是只有Cisco才有的,所以一定要環境全部是Cisco設置才能支援。
在設定上其實跟RIP差不多,只是多了一個自治系統的概念(Automous System,AS),AS的編號可以從1~65535,相同編號的自治系統才能進行溝通。
RT2600-1(config)#router eigrp 123
RT2600-1(config-router)#network 172.16.6.0
RT2600-1(config-router)#network 10.1.1.0

再透過show ip route看一下


Gateway of last resort is not set
172.16.0.0/16 is variably subnetted, 2 subnets, 2 masks
C 172.16.6.0/24 is directly connected, FastEthernet0/1
D 172.16.0.0/16 is a summary, 00:05:49, Null0
10.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C 10.1.1.0/24 is directly connected, FastEthernet0/0
D 10.0.0.0/8 is a summary, 00:05:49, Null0
D 192.168.1.0/24 [90/30720] via 10.1.1.2, 00:01:00, FastEthernet0/0

看到路徑表中的D代表的就是EIGRP的路由成功啦!其中也發覺EIGRP會自已把我們的網段Auto Summary,所以要設定不連續的網段就再透過no auto-summary指令關掉這個功能。
5. 動態路由 – OSPF
OSPF全名為Open Shortest Path First,從名字就可以看出這個路由的兩大特性'Open'與'shortest path',Open代表的是它是開放的,任何廠牌都可以使用,所以也比EIGRP來的普及;另一個Shortest Path就是他選徑的特色,利用Dijkstra演算法選出最短的路徑,然後放入路徑表。
在設定上,OSPF應該是最複雜的了!!因為有很多要考慮的選項,不過在CCNA只需了解基本的設定就夠了


RT2600-1(config)#router ospf 111
RT2600-1(config-router)#network 172.16.6.0 0.0.0.255 area 0
RT2600-1(config-router)#network 10.1.1.0 0.0.0.255 area 0

上面ospf之後的號碼是識別碼,與EIGRP的AS(可設定1~65535)不同,這個號碼只對本機有效,OSPF使用的是Area的概念,即在 network設定的最後面數字,(可以設定1~42億),但一定要有Area 0才能溝通,下面利用show ip route來檢示 :

RT2600-1#sh ip route
Gateway of last resort is not set
172.16.0.0/24 is subnetted, 1 subnets
C 172.16.6.0 is directly connected, FastEthernet0/1
10.0.0.0/24 is subnetted, 1 subnets
C 10.1.1.0 is directly connected, FastEthernet0/0
O 192.168.1.0/24 [110/2] via 10.1.1.2, 00:00:27, FastEthernet0/0

以o為開頭的即為OSPF的路由,在IP後面代表的為[AD/Cost]

(2) ACL
ACL全名為Access Control List, 即為一份存取清單,定義能夠存取或是禁止存取的網路流量,基本上分為兩種,標準式(Standard Access List)與延伸式存取清單(Extended Access List),標準式很單純的只做來源IP的檢查,而延伸式可做L3與L4的進階辨識。
在設定上會先設立Access-List,然後再到介面把Access-List套上去,標準式ACL方法如下:


RT2600-1(config)#access-list 99 permit 1.1.1.1 0.0.0.255
RT2600-1(config)#interface fa 0/1
RT2600-1(config-if)#ip access-group 99 in

上面的Access-List後面的數字用來辨示ACL種類,1~ 99還有1300~1999為標準式,而延伸式為100~199與2000~2699。而在介面所下的指令是access-group不是access- list,原因是你可以下很多的access-list,在介面叫需用access-group一次把它們全部召喚過來^^而接在其後的in或out則是 告訴介面是在流量進來時過濾或出去時過濾。下面是延伸ACL的設定方式:


RT2600-1(config)#access-list 100 permit tcp any any eq www
RT2600-1(config)#interface fa 0/0
RT2600-1(config-if)#ip access-group 100 out

編號100即為延伸式ACL,permit或deny某一段來源到某一段目標。最後再利用show access-list來顯示狀態


RT2600-1(config-if)#do show access-list
Standard IP access list 99
10 permit 1.1.1.0, wildcard bits 0.0.0.255
Extended IP access list 100
10 permit tcp any any eq www

就這麼簡單而已^^

(3) NAT
NAT全名為Network Address Translate, 即是位址轉換。轉換方式有三種,一對一(Stastic)、多對多(Dynamic Ip轉換)、多對多(OverloadingPort轉換)。
我們先來看一對一,常用在內部有一台主機使用內部IP要提供給外部服務時使用,如下:
Router(config)#ip nat inside source static 10.1.1.2 172.16.6.187
內部IP為10.1.1.2,只接mapping給172.16.6.187,設好之後要再到介面告訴介面,
它是內部還是外部:

Router(config)#inter fa0/0
Router(config-if)#ip nat inside
Router(config-if)#exit
Router(config)#inter fa 0/1
Router(config-if)#ip nat outsid

再透過show ip nat translations來確認:


Router#sh ip nat translations
Pro Inside global Inside local Outside local Outside global
--- 172.16.6.187 10.1.1.2 --- ---

再來來看多對多用IP轉換(Dynamic),比如我們有一個C的電腦10.1.1.1/24,要用兩個外部IP(172.16.6.130,172.16.6.131)上網,設法如下:


R2600(config)#ip nat pool WAN 172.16.6.130 172.16.6.131 netmask 255.255.255.0

先把外部IP設到NAT的Pool


R2600(config)#access-list 1 permit 10.1.1.0 0.0.0.255

再把內部IP放到ACL 裡面


R2600(config)#ip nat inside source list 1 pool WAN

再來把外部與內部IP綁在同一條NAT規則,最後再到各介面指定是inside或是outside


R2600(config)#int fa 0/0
R2600(config-if)#ip nat inside
R2600(config-if)#int fa 0/1
R2600(config-if)#ip nat outside

雖然這樣設也可行,但是有兩百多台電腦搶兩個ip實在是很難過,再來看用Port轉換的方式,設法幾乎一樣:


R2600(config)#ip nat inside source list 1 pool WAN overload

看出差異了嗎?只是在最後面加上overload而已,也可以不指定pool,直接設介面就好:


R2600(config)#ip nat inside source list 1 interface fa 0/1 overload


(4) WAN的封裝
1. PPP
全名為Point-to-Point Protocol,這算是在實務上最常見的封裝方式,原因是這種封裝方式是透過Link Control Protocol提供認證、壓縮、多鏈路等功能,而且不像HDLC每一家都不一樣,PPP是可以通用在各廠牌的Router上運作的。
設置的流程,先進入串列介面、指定封裝方式、設置其它可進行驗證的Router名稱與密碼、在介面裡指定驗證方式:


Router(config)#int s 0
Router(config-if)#encapsulation ppp

自已的電腦也要設置hostname好跟其它台溝通


Router(config)#hostname RouterA

再設置能與自已溝通的Router名稱與密碼給它


RouterA(config)#username RouterB password 123456
RouterA(config)#int dialer 0

最後指定用chap或是ppp的認證方式,第一個為主要,第二個為備援,也可設置一個就好


RouterA(config-if)#ppp authentication chap pap

2. PPPoE
PPPoE的全名為Point-to-Point over Ethernet也就是把上面介紹運作於串列介面的PPP協定封裝到Ethernet上跑。
目前大部的份的家庭與小公司會使用DSL來與WAN連線,DSL為Digital Subscriber Line(數位用戶線路),是透過電話線的雙絞線連接電信業者的local loop,所以是很常見的router設定。電信業的小鳥龜進來的線通常是RJ45,所以會連線在router的ethernet port,而非串列Port。
在設定上分實體與邏輯介面的設定,先設定實體介面:


RouterA(config)#interface fa 0/0
RouterA(config-if)#pppoe enable group global
RouterA(config-if)#pppoe-client dial-pool-number 1

簡單的說,實體就是把pppoe打開,再指定邏輯播接的group; 下面是邏輯介面的設定:


RouterA(config)#interface dialer 0
RouterA(config-if)#ip address negotiated
RouterA(config-if)#dialer pool 1
RouterA(config-if)#dialer-group 1
RouterA(config-if)#ppp authentication chap callin
RouterA(config-if)#ppp chap hostname RouterB
RouterA(config-if)#ppp chap password 0 123456

老實說CCNA的書沒寫的很清楚,我的環境也沒有ADSL可以試,所以這份份還需要驗證。
3. FrameRelay
訊框中繼是個很好的概念,但在實務上卻不常見,我也不知道為什麼~可能被好用的ppp給取代了,也可能價格因素。設定方法如下:


RouterA(config)# inte s 0/0
RouterA(config-if)#encapsulation frame-relay
RouterA(config-if)#ip address 10.1.1.1 255.255.255.0
RouterA(config-if)#frame-relay lmi-type ansi
RouterA(config-if)#frame-relay interface-dlci 99

上面的LMI-Type是用來設定Local Management Interface,IOS在11.2版以後會自已抓。而DLCI(Data Link Connection Identifier)的設定是方便ruter與frame relay switch之間邏輯電路的識別,通常ISP會提供。

最後,建議可以練習Peter大的CCNA Lab來加強實戰能力:
http://www.vlab.com.tw/vlabforums/viewtopic.php?t=12027

4 則留言:

匿名 提到...

好教程!如果部分有一詳細的例子就very good!
希望有使更好的分享!

Jimmy 提到...

拜訪拜訪

匿名 提到...

讓我又學習到了

Unknown 提到...

Thanks!! ><