前言:努力的人最後都不會太差!!關注部落格或者加Q:1445696451一起努力!!
首先某公司的網落拓撲(模拟)如下:

内網邊界采用華為3206系列路由器,核心層采用s5700系列三層交換,接入層使用s3700交換裝置;在分公司有一台路由器。
子產品1:telnet配置(如果配置在接入層裝置,如要給該接入層裝置指定網關,實作不同網段可以遠端telnet)
system view :進入系統視圖
telnet server enable :開啟telnet
interface vlanif 1 :進入vlanif 1
ip address 192.168.1.1 24 :配置位址
user-interface vty 0 4 :進入vty0 4模式
authentication-mode aaa :認證模式設定為aaa
aaa :進入aaa模式
local-user zhangsan password cipher pwd123 :建立使用者zhangsan
local-user zhangsan privilege level 15 :設定連接配接權限
local-user zhangsan service-type telnet :設定連接配接方式為telnet
ip route-static 0.0.0.0 0 192.168.1.254 :配置一條預設路由指向網關
子產品2:ssh配置
system view
stelnet server enable :開啟stelnet(也就是ssh)
interface vlanif 1
ip address 192.168.1.1 24
user-interafce vty 0 4
authentication-mode aaa
protocol inbound ssh :配置連接配接協定
aaa
local-user zhangsan password cipher pwd123
local-user zhangsan privilege level 15
local-user zhangsan service-type ssh :配置連接配接方式為ssh
ssh user zhangsan authentication-type password :zhangsan使用password認證
ssh user zhangsan service-type stelnet :zhangsan使用stelnet連接配接
ip route-static 0.0.0.0 0 192.168.1.254
子產品3:配置dhcp自動配置設定位址
1)接口dhcp配置(接口dhcp存在一個局限性,會将接口ip當做dhcp用戶端的網關;但是它的配置十分友善)
dhcp enable :開啟dhcp服務
int vlanif 1
dhcp select interface :dhcp查詢方式為接口
2)全局dhcp配置
dhcp enable
dhcp select global :dhcp查詢方式為全局
ip pool vlan1 :定義位址池
network 192.168.1.0 mask 24 :網段
gateway-list 192.168.1.254 :網關位址
dns-list 1.1.1.1 :dns解析伺服器位址
excluded-ip-address 192.168.1.2 :保留位址
lease day 1 hour 1 :釋放時間
子產品4:vlan配置
vlan batch 2 to 10 :建立vlan
interface g0/0/1 :進入接口
port link-type access :配置接口為Access模式
port default vlan 2 :配置設定vlan2給該接口
interface g0/0/2
port link-type trunk :配置接口為中繼模式
port trunk allow-pass vlan 2 3 5 :該接口允許vlan2、3、5通信
子產品5:eth-trunk配置(相當于cisco的channel-group)
interface eth-trunk 1 :進入第一個eth-trunk
trunkport g0/0/1 :将g0/0/1接口分給eth-trunk1
eth-trunk 1 :與上面操作一樣
子產品6:靜态路由配置
ip route-static 192.168.1.0 24 192.168.2.1 :先是目标網段、而後掩碼、下一跳ip位址
子產品7:ACL配置
1)基本acl(可限制源ip,從2000~2999)
acl 2000 :建立acl2000
rule 5 deny source 192.168.1.0 0.0.0.255 :第5條拒絕192.168.1.0/24
rule 10 permit source 192.168.0.0 0.0.255.255 :第10條允許192.168.0.0/16
interface g0/0/1
traffic-filter inbound acl 2000 :設定接口為acl2000的入接口
2)進階acl(可限制源ip、目标ip、源端口、目标端口,從3000~3999)
acl 3000 :建立acl3000
rule 5 deny tcp source 192.168.1.0 0.0.0.255 destination 172.16.0.0 0.0.255.255 destination port eq 21
:第5條拒絕從192.168.1.0/24 到172.16.0.0/16的TCP21端口 的流量。
rule 10 permit tcp source 192.168.1.0 0.0.0.255 destination 172.16.0.0 0.0.255.255
:第10條允許192.168.1.0/24
到172.16.0.0的TCP流量;兩者 結合起來就是允許除了TCP21 端口的其他TCP流量。
子產品8:NAT配置
1)内網上網NAT
acl 2000
rule 100 permit 192.168.0.0 0.0.255.255
interface g0/0/1 :進入路由器外網口
nat outbound 2000 :配置為acl2000的内網出口
2)釋出内網伺服器的NAT
nat static global 202.1.1.1 inside 192.168.1.253
:配置轉換202.1.1.1到192.1
68.1.253
nat server protocol tcp global 202.1.1.1 www inside 192.168.1.253 8080
:通路外網202.1.1.1的www可
映射到内網的192.168.1.253的 TCP8080端口。
子產品9:mstp二層負載分擔
stp mode mstp :配置stp的模式為mstp
stp region-configuration :進入mstp域視圖
region-name test :配置mstp域的名稱
revision-level 1 :配置修訂級别
instance 1 vlan 10
instance 2 vlan 20 :配置mstp執行個體,并配置設定vlan
active region-configuration :激活配置
stp instance 1 priority 4096
stp instance 2 priority 8192 :執行個體的優先級
子產品10:vrrp三層負載分擔
master裝置:
interface vlanif 10 :進入vlanif10
vrrp vrid 10 virtual-ip 192.168.1.254 :配置虛拟ip位址
vrrp vrid 10 priority 150 :優先級
vrrp vrid 10 track interface g0/0/1 reduced 100 :端口追蹤
backup裝置:
interface vlanif 10
ip address 192.168.1.2 24
vrrp vrid 10 virtual-ip 192.168.1.254 :配置虛拟ip(其餘不用配置, vrrp中也有占先權,預設開啟, 不用管)
子產品11:rip距離矢量路由
rip :rip模式
version 2 :使用2版本
network 192.168.1.0 :宣告192.168.1.0/24網段
rip metricin 2 :配置接口路徑成本(跳數)
undo rip output :關閉發送rip通告
undo rip input :關閉接收rip通告
slient-interface g0/0/1 :靜默接口
rip split-horizon :水準分割
rip poison-reverse :毒性逆轉
display rip :檢視rip配置
default-route originate :分發預設路由
子產品12:ospf鍊路狀态路由
ospf 1 router-id 1.1.1.1 :配置ospf的router-id
area 0 :配置為area0區域
network 192.168.1.0 0.0.0.255 :宣告網段
display ospf peer :查詢ospf鄰居狀态
子產品13、GRE ×××
interface tunnel 1 :編輯1号隧道
tunnel-protocol gre :隧道使用GRE協定
ip address 192.168.1.1 30 :隧道位址
source 202.0.0.1 :隧道源(本地外網接口)位址
destination 101.0.0.1 :隧道對端(外網接口)位址
ip route-static 192.168.20.0 255.255.255.0 tunnel 0/0/1 :隧道路由(目标公司的網段)
ospf 1 router-id 1.1.1.1
area 0
network 192.168.10.0 0.0.0.255
network 192.168.1.0 0.0.0.255 :配置ospf(要讓總部和分支機構網絡連成一個整體,就需要互通路由。如果配置動态路由,就需要在宣告路由的時候将隧道位址也一起宣告)
子產品14、IPsec ×××
ike proposal 2
encryption-algorithm 3des-cbc
authentication-algorithm MD5
authentication-method pre-share
dh group5
sa duration 10000 :定義第一階段的安全政策
ipsec proposal 5
esp authentication-algorithm sha1
esp encryption-algorithm aes-128 :定義第二階段的安全政策
ike peer to-fenzhi v1 :定義對等集資訊(to-fenzhi為名稱)
pre-shared-key simple 123456 :設定協商密鑰,兩端需一緻
remote-address 202.1.1.1 :對端的外網接口位址
acl 3000
rule permit ip source 10.0.0.0 0.255.255.255 destination 20.0.0.0 0.255.255.255 :設定acl3000定義感興趣的數 據流(也就是需要通過隧道的 資料流)
ipsec policy abc 10 isakmp :定義使用IKE協商IPsec
security acl 3000 :調用acl3000
ike-peer to-fenzhi :調用對等體集
proposal 5 :調用第二階段
interface g0/0/0
ipsec policy abc :在接口調用IPsec政策
acl 3001
rule 100 deny ip source 10.0.0.1 0.255.255.255 destination 20.0.0.1 0.255.255.255
rule 200 permit ip source 10.0.0.0 0.255.255.255 destination any
:配置一條上網3001(拒絕轉 換需要通過隧道的資料流,允許 其他所有)
nat outbound 3001 :将外網接口設定為nat轉換的 接口
子產品15(重點子產品):display指令的使用。(display相當于cisco的show指令,我粗略的數了一下,華為3260路由器的系統視圖下“display?”,大概有254個對象,可見這個指令多麼重要。但是我們隻需掌握一些常用的即可。簡單舉例出我日常的總結)
display this :常用指令,檢視目前視圖、模 式下的配置
display current-configuration :檢視目前配置
display saving-configuration :檢視以儲存配置
display aaa :檢視aaa認證配置
display acl number :acl規則
display dhcp :dhcp配置
display eth-trunk number :eth-trunk口下配置
display firewall group :防火牆相關
display interface g|e// :接口下配置
display ipsec :檢視ipsec相關
display lldp neighbor brief :檢視lldp鄰接
display mac-address :mac位址
display ospf 1 * :ospf相關
display vrrp :vrrp資訊
display vlan brief :檢視vlan資訊
display ip routing-table :檢視路由表