Liufei]display version ≈确 糟红;顯示版本信息
[Liufei]display current-configuration ×道Α缭召;顯示當(dāng)前配置
[Liufei]display interfaces ∧巫选市咽;顯示接口信息
[Liufei]display ip route 烁焙;顯示路由信息
[Liufei]sysname?lf123 『叫稀;更改主機(jī)名
[Liufei]super passwrod 123456 〗居膳殷;設(shè)置口令
[Liufei]interface serial0 九火;進(jìn)入接口
[Liufei-serial0]ip address ∽浴;配置端口IP地址
[Liufei-serial0]undo shutdown 〔砑ぁ勒极;激活端口
[Liufei]link-protocol hdlc 虑鼎;綁定hdlc協(xié)議
[Liufei]user-interface vty 0 4
[Liufei-ui-vty0-4]authentication-mode password
[Liufei-ui-vty0-4]set authentication-mode password simple 222
[Liufei-ui-vty0-4]user privilege level 3
[Liufei-ui-vty0-4]quit
[Liufei]debugging hdlc all serial0 ∪枘洹键痛;顯示所有信息
[Liufei]debugging hdlc event serial0 匾七;調(diào)試事件信息
[Liufei]debugging hdlc packet serial0 ⌒醵獭;顯示包的信息
靜態(tài)路由:
[Liufei]ip route-static {interface number|nexthop}[value][reject|blackhole]
例如:
[Liufei]ip route-static 129.1.0.0 16 10.0.0.2
[Liufei]ip route-static 129.1.0.0 255.255.0.0 10.0.0.2
[Liufei]ip route-static 129.1.0.0 16 Serial 2
[Liufei]ip route-static 0.0.0.0 0.0.0.0 10.0.0.2
動(dòng)態(tài)路由:
[Liufei]rip 昨忆;設(shè)置動(dòng)態(tài)路由
[Liufei]rip work 丁频;設(shè)置工作允許
[Liufei]rip input ;設(shè)置入口允許
[Liufei]rip output 邑贴;設(shè)置出口允許
[Liufei-rip]network 1.0.0.0 席里;設(shè)置交換路由網(wǎng)絡(luò)
[Liufei-rip]network all ;設(shè)置與所有網(wǎng)絡(luò)交換
[Liufei-rip]peer ip-address 痢缎;
[Liufei-rip]summary 胁勺;路由聚合
[Liufei]rip version 1 世澜;設(shè)置工作在版本1
[Liufei]rip version 2 multicast 独旷;設(shè)版本2,多播方式
[Liufei-Ethernet0]rip split-horizon 寥裂;水平分隔
[Liufei]router id A.B.C.D 嵌洼;配置路由器的ID
[Liufei]ospf enable ;啟動(dòng)OSPF協(xié)議
[Liufei-ospf]import-route direct 封恰;引入直聯(lián)路由
[Liufei-Serial0]ospf enable area 麻养;配置OSPF區(qū)域
標(biāo)準(zhǔn)訪問列表命令格式如下:
acl [match-order config|auto] ;默認(rèn)前者順序匹配诺舔。
rule [normal|special]{permit|deny} [source source-addr source-wildcard|any]
例:
[Liufei]acl 10
[Liufei-acl-10]rule normal permit source 10.0.0.0 0.0.0.255
[Liufei-acl-10]rule normal deny source any
擴(kuò)展訪問控制列表配置命令
配置TCP/UDP協(xié)議的擴(kuò)展訪問列表:
rule {normal|special}{permit|deny}{tcp|udp}source {|any}destination |any}
[operate]
配置ICMP協(xié)議的擴(kuò)展訪問列表:
rule {normal|special}{permit|deny}icmp source {|any]destination {|any]
[icmp-code] [logging]
擴(kuò)展訪問控制列表操作符的含義
equal portnumber 鳖昌;等于
greater-than portnumber ;大于
less-than portnumber 低飒;小于
not-equal portnumber 许昨;不等
range portnumber1 portnumber2 ;區(qū)間
擴(kuò)展訪問控制列表舉例
[Liufei]acl 101
[Liufei-acl-101]rule deny souce any destination any
[Liufei-acl-101]rule permit icmp source any destination any icmp-type echo
[Liufei-acl-101]rule permit icmp source any destination any icmp-type echo-reply
[Liufei]acl 102
[Liufei-acl-102]rule permit ip source 10.0.0.1 0.0.0.0 destination 202.0.0.1 0.0.0.0
[Liufei-acl-102]rule deny ip source any destination any
[Liufei]acl 103
[Liufei-acl-103]rule permit tcp source any destination 10.0.0.1 0.0.0.0 destination-port equal ftp
[Liufei-acl-103]rule permit tcp source any destination 10.0.0.2 0.0.0.0 destination-port equal www
[Liufei]firewall enable
[Liufei]firewall default permit|deny
[Liufei]int e0
[Liufei-Ethernet0]firewall packet-filter 101 inbound|outbound
地址轉(zhuǎn)換配置舉例
[Liufei]firewall enable
[Liufei]firewall default permit
[Liufei]acl 101 ;內(nèi)部指定主機(jī)可以進(jìn)入e0
[Liufei-acl-101]rule deny ip source any destination any
[Liufei-acl-101]rule permit ip source 129.38.1.1 0 destination any
[Liufei-acl-101]rule permit ip source 129.38.1.2 0 destination any
[Liufei-acl-101]rule permit ip source 129.38.1.3 0 destination any
[Liufei-acl-101]rule permit ip source 129.38.1.4 0 destination any
[Liufei-acl-101]quit
[Liufei]int e0
[Liufei-Ethernet0]firewall packet-filter 101 inbound
[Liufei]acl 102 ;外部特定主機(jī)和大于1024端口的數(shù)據(jù)包允許進(jìn)入S0
[Liufei-acl-102]rule deny ip source any destination any
[Liufei-acl-102]rule permit tcp source 202.39.2.3 0 destination 202.38.160.1 0
[Liufei-acl-102]rule permit tcp source any destination 202.38.160.1 0 destination-port great-than
1024
[Liufei-acl-102]quit
[Liufei]int s0
[Liufei-Serial0]firewall packet-filter 102 inbound 褥赊;設(shè)202.38.160.1是路由器出口IP糕档。
[Liufei-Serial0]nat outbound 101 interface ;是Easy ip,將acl 101允許的IP從本接口出時(shí)變換源地址拌喉。
內(nèi)部服務(wù)器地址轉(zhuǎn)換配置命令(靜態(tài)nat):
nat server global [port] inside port [protocol] ;global_port不寫時(shí)使用inside_port
[Liufei-Serial0]nat server global 202.38.160.1 inside 129.38.1.1 ftp tcp
[Liufei-Serial0]nat server global 202.38.160.1 inside 129.38.1.2 telnet tcp
[Liufei-Serial0]nat server global 202.38.160.1 inside 129.38.1.3 www tcp
設(shè)有公網(wǎng)IP:202.38.160.101~202.38.160.103 可以使用速那。 ;對(duì)外訪問(原例題)
[Liufei]nat address-group 202.38.160.101 202.38.160.103 pool1 ;建立地址池
[Liufei]acl 1
[Liufei-acl-1]rule permit source 10.110.10.0 0.0.0.255 ;指定允許的內(nèi)部網(wǎng)絡(luò)
[Liufei-acl-1]rule deny source any
[Liufei-acl-1]int serial 0
[Liufei-Serial0]nat outbound 1 address-group pool1 ;在s0口從地址池取出IP對(duì)外訪問
[Liufei-Serial0]nat server global 202.38.160.101 inside 10.110.10.1 ftp tcp
[Liufei-Serial0]nat server global 202.38.160.102 inside 10.110.10.2 www tcp
[Liufei-Serial0]nat server global 202.38.160.102 8080 inside 10.110.10.3 www tcp
[Liufei-Serial0]nat server global 202.38.160.103 inside 10.110.10.4 smtp udp
PPP設(shè)置:
[Liufei-s0]link-protocol ppp ;默認(rèn)的協(xié)議
PPP驗(yàn)證:
主驗(yàn)方:pap|chap
[Liufei]local-user q2 password {simple|cipher} hello ;路由器1
[Liufei]interface serial 0
[Liufei-serial0]ppp authentication-mode {pap|chap}
[Liufei-serial0]ppp chap user q1 ;pap時(shí),沒有此句
pap被驗(yàn)方:
[Liufei]interface serial 0 ;路由器2
[Liufei-serial0]ppp pap local-user q2 password {simple|cipher} hello
chap被驗(yàn)方:
[Liufei]interface serial 0 ;路由器2
[Liufei-serial0]ppp chap user q2 ;自己路由器名
[Liufei-serial0]local-user q1 password {simple|cipher} hello ;對(duì)方路由器名
幀中繼frame-relay (二分冊(cè)6-61)
[q1]fr switching
[q1]int s1
[q1-Serial1]ip address 192.168.34.51 255.255.255.0
[q1-Serial1]link-protocol fr ;封裝幀中繼協(xié)議
[q1-Serial1]fr interface-type dce
[q1-Serial1]fr dlci 100
[q1-Serial1]fr inarp
[q1-Serial1]fr map ip 192.168.34.52 dlci 100
[q2]int s1
[q2-Serial1]ip address 192.168.34.52 255.255.255.0
[q2-Serial1]link-protocol fr
[q2-Serial1]fr interface-type dte
[q2-Serial1]fr dlci 100
[q2-Serial1]fr inarp
[q2-Serial1]fr map ip 192.168.34.51 dlci 100
幀中繼監(jiān)測(cè)
[q1]display fr lmi-info[]interface type number]
[q1]display fr map
[q1]display fr pvc-info[serial interface-number][dlci dlci-number]
[q1]display fr dlci-switch
[q1]display fr interface
[q1]reset fr inarp-info
[q1]debugging fr all[interface type number]
[q1]debugging fr arp[interface type number]
[q1]debugging fr event[interface type number]
[q1]debugging fr lmi[interface type number]
啟動(dòng)ftp服務(wù):
[Liufei]local-user ftp password {simple|cipher} aaa service-type ftp
[Liufei]ftp server enable