admin 发表于 2022-2-21 13:51:31

H3C交换机openflow配置 测试

H3C 交换机 OpenFlow 配置指南
目录
Console 连接交换机
配置 VLAN
创建实例并映射 VLAN
配置控制器1的IP地址并激活实例
验证配置
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>%Jan1 21:20:28:599 2011 H3C SHELL/5/SHELL_LOGIN: TTY logged in from aux0.
<H3C>
Press ENTER to get started.
<H3C>%Feb 21 14:09:42:051 2022 H3C SHELL/5/SHELL_LOGIN: Console logged in from con0.

2. 配置 VLAN
创建VLAN 4092和4094
<H3C>system-view
System View: return to User View with Ctrl+Z
vlan 4092
quit
vlan 4094
quit

<H3C>system-view
System View: return to User View with Ctrl+Z.
vlan 4092
quit
vlan 4093
quit
no
no vla
no vlan 4093
vlan
vlan 4094
quit


display vlan
Total VLANs: 3
The VLANs include:
1(default), 4092, 4094


创建VLAN接口1并配置IP地址
上图是官方文档中的例子
interface Vlan-interface 1

undo shutdown
ip
ip address 192.168.7.1 24
quit



interface Vlan-interface 1




undo shutdown

ip address 192.168.7.1 24
quit


设置完以后,将控制器所在PC的IP地址设置为 192.168.49.49,可以通过 ping 测试是否连通。
ping 192.168.7.49
Ping 192.168.49.49 (192.168.7.49): 56 data bytes, press CTRL_C to break
56 bytes from 192.168.7.49: icmp_seq=0 ttl=64 time=1.897 ms
56 bytes from 192.168.7.49: icmp_seq=1 ttl=64 time=1.268 ms
56 bytes from 192.168.7.49: icmp_seq=2 ttl=64 time=1.627 ms
56 bytes from 192.168.7.49: icmp_seq=4 ttl=64 time=1.855 ms
--- Ping statistics for 192.168.7.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

%Jan1 21:47:00:208 2011 H3C PING/6/PING_STATISTICS: Ping statistics for 192.168.7.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
openflow instance 1
classification vlan 4092 mask 4093



<H3C>system-view
System View: return to User View with Ctrl+Z.

openflow instance 1

classification vlan 4093 mas
classification vlan 4093 mask 4094
classification vlan 4093 mask 4093

配置端口

interface Ten-GigabitEthernet 1/0/1
port type trunk
port trunk permit vlan 4092
quit


我们需要把希望 OpenFlow 管理的端口加入 vlan 4092 中。
其中 1/0/1 用于连接控制器,1/0/2 保留。
<H3C> system-view
vlan 4092
port Ten-GigabitEthernet 1/0/3 Ten-GigabitEthernet 1/0/4 ... Ten-GigabitEthernet 1/0/48
quit

4. 配置控制器1的IP地址并激活实例
controller 1 address ip 192.168.7.49
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.7.49 port: 6633

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


display openflow instance 1
Instance 1 information:
Configuration information:
Description   : --
Active status : Inactive
Inactive configuration:
Classification: VLAN, total VLANs(2)
   4092, 4094
In-band management VLAN, total VLANs(0)
   Empty VLAN
Connect mode: Multiple
MAC address learning: Enabled
TCP DSCP value: 10
Flow table:
   Table ID(type): 0(Extensibility)
Flow-entry max-limit: 65535
Datapath ID: 0x0001a699068a0100
Default table-miss: Drop
Forbidden port: None
Qinq Network: Disabled
TCP connection backup: Enabled
Active configuration:
None


页: [1]
查看完整版本: H3C交换机openflow配置 测试