天天看点

H3C 交换机 OpenFlow 配置指南H3C 交换机 OpenFlow 配置指南

H3C 交换机 OpenFlow 配置指南

目录

  1. Console 连接交换机
  2. 配置 VLAN
  3. 创建实例并映射 VLAN
  4. 配置控制器1的IP地址并激活实例
  5. 验证配置

1. Console 连接交换机

笔记本连接需要一个 USB 转 RS232 串口线。

MacOS

连接后,MacOS 下可以从终端查看设备状态

bash $ ls /dev/cu.usbserial-*
/dev/cu.usbserial-A106Z8ML
           

然后可以用 screen 连接。

screen /dev/cu.usbserial-A106Z8ML
           

Windows

可以用 SecureCRT 或者串口精灵之类的程序通过串口连接。

连接以后,按几次 Enter,输出大概是

<H3C>%Jan  1 21:20:28:599 2011 H3C SHELL/5/SHELL_LOGIN: TTY logged in from aux0.

<H3C>
           

2. 配置 VLAN

创建VLAN 4092和4094

<H3C> system-view

[H3C] vlan 4092

[H3C-vlan4092] quit

[H3C] vlan 4094

[H3C-vlan4094] quit
           

创建VLAN接口1并配置IP地址

H3C 交换机 OpenFlow 配置指南H3C 交换机 OpenFlow 配置指南

上图是官方文档中的例子

[H3C] interface vlan-interface 1

[H3C-Vlan-interface1] undo shutdown

[H3C-Vlan-interface1] ip address 192.168.49.1 24

[H3C-Vlan-interface1] quit
           

设置完以后,将控制器所在PC的IP地址设置为 192.168.49.49,可以通过 ping 测试是否连通。

[H3C]ping 192.168.49.49
Ping 192.168.49.49 (192.168.49.49): 56 data bytes, press CTRL_C to break
56 bytes from 192.168.49.49: icmp_seq=0 ttl=64 time=1.897 ms
56 bytes from 192.168.49.49: icmp_seq=1 ttl=64 time=1.268 ms
56 bytes from 192.168.49.49: icmp_seq=2 ttl=64 time=1.627 ms
56 bytes from 192.168.49.49: icmp_seq=3 ttl=64 time=1.170 ms
56 bytes from 192.168.49.49: icmp_seq=4 ttl=64 time=1.855 ms

--- Ping statistics for 192.168.49.49 ---
5 packet(s) transmitted, 5 packet(s) received, 0.0% packet loss
round-trip min/avg/max/std-dev = 1.170/1.563/1.897/0.297 ms
[H3C]%Jan  1 21:47:00:208 2011 H3C PING/6/PING_STATISTICS: Ping statistics for 192.168.49.49: 5 packet(s) transmitted, 5 packet(s) received, 0.0% packet loss, round-trip min/avg/max/std-dev = 1.170/1.563/1.897/0.297 ms.
           

3. 创建 OpenFlow 实例并映射 VLAN

<H3C> system-view

[H3C] openflow instance 1

[H3C-of-inst-1] classification vlan 4092 mask 4093
           

配置端口

[H3C]interface Ten-GigabitEthernet 1/0/1

[H3C-Ten-GigabitEthernet1/0/1] port type trunk 

[H3C-Ten-GigabitEthernet1/0/1] port trunk permit vlan 4092

[H3C-Ten-GigabitEthernet1/0/1] quit
           

我们需要把希望 OpenFlow 管理的端口加入 vlan 4092 中。

其中 1/0/1 用于连接控制器,1/0/2 保留。

<H3C> system-view

[H3C] vlan 4092

[H3C-vlan4092] port Ten-GigabitEthernet 1/0/3 Ten-GigabitEthernet 1/0/4 ... Ten-GigabitEthernet 1/0/48

[H3C-vlan4092] quit
           

4. 配置控制器1的IP地址并激活实例

[H3C-of-inst-1] controller 1 address ip 192.168.49.49

[H3C-of-inst-1] active instance
           

5. 验证配置

<H3C-of-inst-1> display openflow instance 1

Instance 1 information:

Configuration information:
 Description   : --
 Active status : Active
 Inactive configuration:
  None
 Active configuration:
  Classification: VLAN, total VLANs(1)
   4092
  In-band management VLAN, total VLANs(0)
   Empty VLAN
  Connect mode: Multiple
  MAC address learning: Enabled
  TCP DSCP value: 64
  Flow table:
   Table ID(type): 0(Extensibility), count: 9
  Flow-entry max-limit: 65535
  Datapath ID: 0x000188df9eeaaaaa
  Default table-miss: Drop
  Forbidden port: None
  Qinq Network: Disabled
  TCP connection backup: Enabled
Port information:
 Ten-GigabitEthernet1/0/1
 Ten-GigabitEthernet1/0/3
 Ten-GigabitEthernet1/0/4
 ...
 Ten-GigabitEthernet1/0/47
 Ten-GigabitEthernet1/0/48
Active channel information:
 Controller 1 IP address: 192.168.49.49 port: 6633

           

然后就可以在 PC 上启动控制器,等待交换机连接。

参考文档

[1] OpenFlow配置实例(详解)

[2] OpenFlow配置指导

[3] 二层技术-以太网交换配置指导(各种 VLAN 配置)

[4] S12500上的OpenFlow配置

[5] H3C S6800系列以太网交换机配置