华为交换之间静态路由配置实例

转自:http://www.2cto.com/os/201412/359385.html

拓扑图

 

wKioL1SFr6ryPTyFAAF6NSyu1lI761.jpg

 

左边交换机配置:

?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
<Huawei>dis cu
#
sysname Huawei
#
vlan batch 10 100
#
cluster enable
ntdp enable
ndp enable
#
drop illegal-mac alarm
#
diffserv domain default
#
drop-profile default
#
aaa
  authentication-scheme default
  authorization-scheme default
  accounting-scheme default
  domain default
  domain default_admin
  local-user admin password simple admin
  local-user admin service-type http
#
interface Vlanif1
#
interface Vlanif10
  ip address 172.16 . 10.254 255.255 . 255.0
#
interface Vlanif100
  ip address 172.16 . 100.1 255.255 . 255.0
#
interface MEth0/ 0 / 1
#
interface Eth-Trunk1
  port link-type trunk
  port trunk allow-pass vlan 2 to 4094
#
interface GigabitEthernet0/ 0 / 1
  port link-type access
  port default vlan 10
#
interface GigabitEthernet0/ 0 / 2
#
.........................
#
interface GigabitEthernet0/ 0 / 21
  eth-trunk 1
#
interface GigabitEthernet0/ 0 / 22
  shutdown
  eth-trunk 1
#
interface GigabitEthernet0/ 0 / 23
  eth-trunk 1
#
interface GigabitEthernet0/ 0 / 24
  eth-trunk 1
#
interface NULL0
#
ip route- static 172.16 . 20.0 255.255 . 255.0 172.16 . 100.254
#
user- interface con 0
user- interface vty 0 4
#
return
<Huawei>
 

右边交换机配置:

?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
<Huawei>dis cu
#
sysname Huawei
#
vlan batch 20 100
#
cluster enable
ntdp enable
ndp enable
#
drop illegal-mac alarm
#
diffserv domain default
#
drop-profile default
#
aaa
  authentication-scheme default
  authorization-scheme default
  accounting-scheme default
  domain default
  domain default_admin
  local-user admin password simple admin
  local-user admin service-type http
#
interface Vlanif1
#
interface Vlanif20
  ip address 172.16 . 20.254 255.255 . 255.0
#
interface Vlanif100
  ip address 172.16 . 100.254 255.255 . 255.0
#
interface MEth0/ 0 / 1
#
interface Eth-Trunk1
  port link-type trunk
  port trunk allow-pass vlan 2 to 4094
#
interface GigabitEthernet0/ 0 / 1
  port link-type access
  port default vlan 20
#
interface GigabitEthernet0/ 0 / 2
#
.......................
#
interface GigabitEthernet0/ 0 / 21
  eth-trunk 1
#
interface GigabitEthernet0/ 0 / 22
  eth-trunk 1
#
interface GigabitEthernet0/ 0 / 23
  eth-trunk 1
#
interface GigabitEthernet0/ 0 / 24
  eth-trunk 1
#
interface NULL0
#
ip route- static 172.16 . 10.0 255.255 . 255.0 172.16 . 100.1
#
user- interface con 0
user- interface vty 0 4
#
return
<Huawei>
 

左边交换机配置步骤(右边交换机配置类似)

1、批量创建vlan

[Huawei]vlan batch 10 100

2、配置vlanif 地址

[Huawei]interface Vlanif 100

[Huawei-Vlanif100]ip address 172.16.100.1 24

[Huawei-Vlanif100]q

[Huawei]interface Vlanif 10

[Huawei-Vlanif10]ip address 172.16.10.254 24

3、配置GE0/0/1端口属性并加入vlan 10

[Huawei-GigabitEthernet0/0/1]port link-type access

[Huawei-GigabitEthernet0/0/1]port default vlan 10

4、配置eth-trunk (增加带宽、实现链路备份)及属性

[Huawei]interface Eth-Trunk 1

[Huawei-Eth-Trunk1]trunkport GigabitEthernet 0/0/21 to 0/0/24

# 端口加入eth-trunk 1 中

[Huawei-Eth-Trunk1]mode manual load-balance

# 手工负载模式

[Huawei-Eth-Trunk1]port link-type trunk

[Huawei-Eth-Trunk1]port trunk allow-pass vlan all

#配置eth-trunk 端口为trunk模式并允许所有vlan通过

5、静态路由配置

[Huawei]ip route-static 172.16.20.0 24 172.16.100.254

# 配置到达 172.16.20.0 这段网络的下一跳地址为172.16.100.254


  • 0
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值