• 产品与解决方案
  • 行业解决方案
  • 服务
  • 支持
  • 合作伙伴
  • 新华三人才研学中心
  • 关于我们

H3C交换机 典型配置举例-6W100

17-IP地址-IP性能典型配置举例

本章节下载 17-IP地址-IP性能典型配置举例  (152.99 KB)

docurl=/cn/Service/Document_Software/Document_Center/Switches/Catalog/S10500/S10500/Configure/Typical_Configuration_Example/H3C_Typical_Configuration_Example-6W100/201312/807744_30005_0.htm

17-IP地址-IP性能典型配置举例


1  IP地址典型配置举例

1.1  简介

本章介绍了配置主IP地址和从IP地址实现设备上一个接口连接不同的子网时,设备与网络中的主机进行通信的典型配置案例。

1.2  IP地址典型配置举例

1.2.1  适用产品和版本

表1 配置适用的产品与软件版本关系

产品

软件版本

S10500系列以太网交换机

Release 1120系列,Release 1130系列,Release 1200系列

S5800&S5820X系列以太网交换机

Release 1808

S5830系列以太网交换机

Release 1115,Release 1118

S5500-EI&S5500-SI系列以太网交换机

Release 2220

 

1.2.2  组网需求

图1所示,在两个网络中的主机上采用交换机配置的主IP地址和从IP地址作为网关,实现两个网段的主机都可以通过Switch与外部网络通信。

图1 IP地址配置组网图

 

1.2.3  配置步骤

1. Switch的配置

# 配置VLAN接口1的主IP地址和从IP地址。

<Switch> system-view

[Switch] interface vlan-interface 1

[Switch-Vlan-interface1] ip address 172.16.1.1 255.255.255.0

[Switch-Vlan-interface1] ip address 172.16.2.1 255.255.255.0 sub

[Switch-Vlan-interface1] return

2. 主机的配置

# 在172.16.1.0/24网段中的主机上配置网关为172.16.1.1;在172.16.2.0/24网段中的主机上配置网关为172.16.2.1。

1.2.4  验证配置

# 使用ping命令检测Switch与网络172.16.1.0/24内主机的连通性。

<Switch> ping 172.16.1.2

  PING 172.16.1.2: 56  data bytes, press CTRL_C to break

    Reply from 172.16.1.2: bytes=56 Sequence=1 ttl=255 time=25 ms

    Reply from 172.16.1.2: bytes=56 Sequence=2 ttl=255 time=27 ms

    Reply from 172.16.1.2: bytes=56 Sequence=3 ttl=255 time=26 ms

    Reply from 172.16.1.2: bytes=56 Sequence=4 ttl=255 time=26 ms

    Reply from 172.16.1.2: bytes=56 Sequence=5 ttl=255 time=26 ms

 

  --- 172.16.1.2 ping statistics ---

    5 packet(s) transmitted

    5 packet(s) received

    0.00% packet loss

round-trip min/avg/max = 25/26/27 ms

显示信息表示Switch与网络172.16.1.0/24内的主机可以互通。

# 使用ping命令检测Switch与网络172.16.2.0/24内主机的连通性。

<Switch> ping 172.16.2.2

  PING 172.16.2.2: 56  data bytes, press CTRL_C to break

    Reply from 172.16.2.2: bytes=56 Sequence=1 ttl=255 time=25 ms

    Reply from 172.16.2.2: bytes=56 Sequence=2 ttl=255 time=26 ms

    Reply from 172.16.2.2: bytes=56 Sequence=3 ttl=255 time=26 ms

    Reply from 172.16.2.2: bytes=56 Sequence=4 ttl=255 time=26 ms

    Reply from 172.16.2.2: bytes=56 Sequence=5 ttl=255 time=26 ms

 

  --- 172.16.2.2 ping statistics ---

    5 packet(s) transmitted

    5 packet(s) received

    0.00% packet loss

    round-trip min/avg/max = 25/25/26 ms

显示信息表示Switch与网络172.16.2.0/24内的主机可以互通。

1.2.5  配置文件

#

interface Vlan-interface1

 ip address 172.16.1.1 255.255.255.0

 ip address 172.16.2.1 255.255.255.0 sub

#

 


2  允许发送定向广播报文典型配置举例

2.1  简介

本章介绍了开启发送定向广播报文功能实现定向广播报文转发的典型配置案例。

2.2  允许发送定向广播报文配置举例

2.2.1  适用产品和版本

表2 配置适用的产品与软件版本关系

产品

软件版本

S10500系列以太网交换机

Release 1120系列,Release 1130系列,Release 1200系列

S5800&S5820X系列以太网交换机

Release 1808

S5830系列以太网交换机

Release 1115,Release 1118

S5500-EI&S5500-SI系列以太网交换机

Release 2220

 

2.2.2  组网需求

图2所示,Host通过网关Switch,将定向广播发往Server所在的网段,通过在交换机上配置允许发送定向广播报文,使得Server可以收到报文。

图2 允许发送定向广播报文配置组网图

 

2.2.3  配置步骤

1. 配置Switch的配置

# 创建VLAN2,并将端口GigabitEthernet1/0/1加入到VLAN2中。

<Switch> system-view

[Switch] Vlan 2

[Switch-vlan2] port GigabitEthernet 1/0/1 

[Switch-Vlan2] quit

# 创建VLAN3,并将端口GigabitEthernet1/0/2加入到VLAN3中。

[Switch] Vlan 3

[Switch-vlan3] port GigabitEthernet 1/0/2

[Switch–Vlan3] quit

# 配置VLAN接口3和VLAN接口2的IP地址。

[Switch] interface vlan-interface 3

[Switch-Vlan-interface3] ip address 1.1.1.2 24

[Switch-Vlan-interface3] quit

[Switch] interface vlan-interface 2

[Switch-Vlan-interface2] ip address 2.2.2.2 24

# 配置允许VLAN接口2转发定向广播报文。

[Switch-Vlan-interface2] ip forward-broadcast

2. 主机的配置

配置网关为Switch的VLAN接口3的IP地址。

2.2.4  验证配置

# 配置完成以后,在Host上ping Switch的VLAN接口2所在子网网段的广播地址(2.2.2.255)时,Server可以收到该报文。取消掉ip forward-broadcast的配置,Server不能收到该报文。

2.2.5  配置文件

#

vlan 2 to 3

#

interface Vlan-interface2

 ip address 2.2.2.2 255.255.255.0

 ip forward-broadcast

#

interface Vlan-interface3

 ip address 1.1.1.2 255.255.255.0

#

interface GigabitEthernet1/0/1

 port link-mode bridge

 port access vlan 2

#

interface GigabitEthernet1/0/2

 port link-mode bridge

 port access vlan 3

#


3  ICMP目的不可达报文发送功能典型配置举例

3.1  简介

本章介绍了开启ICMP目的不可达报文发送功能实现异常情况发生时通知相应设备,便于进行控制管理的典型配置案例。

3.2  ICMP目的不可达报文发送功能典型配置举例

3.2.1  适用产品和版本

表3 配置适用的产品与软件版本关系

产品

软件版本

S10500系列以太网交换机

Release 1120系列,Release 1130系列,Release 1200系列

S5800&S5820X系列以太网交换机

Release 1808

S5830系列以太网交换机

Release 1115,Release 1118

S5500-EI&S5500-SI系列以太网交换机

Release 2220

 

3.2.2  组网需求

图3所示,主机通过作为网关的SwitchA与SwitchB进行正常通信,如果在主机上错误地输入了一个其他网段的IP地址会导致无法访问SwitchB,且用户可能未发现该问题,通过在Switch A上配置开启ICMP目的不可达报文发送功能实现设备在异常情况发生时通知主机。

图3 ICMP目的不可达报文发送功能配置组网图

 

3.2.3  配置步骤

1. Switch A的配置

# 开启ICMP目的不可达报文发送功能。

<SwitchA> system-view

[SwitchA] ip unreachables enable

# 创建VLAN3,并将端口GigabitEthernet1/0/1加入到VLAN3中。

[SwitchA] Vlan 3

[SwitchA-vlan3] port GigabitEthernet 1/0/1 

[SwitchA-Vlan3] quit

# 创建VLAN2,并将端口GigabitEthernet1/0/2加入到VLAN2中。

[SwitchA] Vlan 2

[SwitchA-vlan2] port GigabitEthernet 1/0/2

[SwitchA–Vlan2] quit

# 配置VLAN接口3和VLAN接口2的IP地址。

[SwitchA] interface vlan-interface 3

[SwitchA-Vlan-interface3] ip address 10.1.1.2 24

[SwitchA-Vlan-interface3] quit

[SwitchA] interface vlan-interface 2

[SwitchA-Vlan-interface2] ip address 20.2.2.2 24

2. Switch B的配置

# 创建VLAN2,并将端口GigabitEthernet1/0/3加入到VLAN2中。

<SwitchB> system-view

[SwitchB] Vlan 2

[SwitchB-vlan2] port GigabitEthernet 1/0/3 

[SwitchB-Vlan2] quit

# 配置VLAN接口2的IP地址。

[SwitchB] interface vlan-interface 2

[SwitchB-Vlan-interface2] ip address 20.2.2.1 24

# 为保证Host和Switch B的正常通信,在Switch B上配置到达Host的静态路由。

[SwitchB] ip route-static 10.1.1.0 24 20.2.2.2

3. 主机的配置

在主机上配置网关为Switch A的VLAN接口3的IP地址。

3.2.4  验证配置

# 在host上ping 20.2.2.1,能够正常通信。

C:\ping 20.2.2.1

 

Pinging 20.2.2.1 with 32 bytes of data:

 

Reply from 20.2.2.1: bytes=32 time=6ms TTL=254

Reply from 20.2.2.1: bytes=32 time=1ms TTL=254

Reply from 20.2.2.1: bytes=32 time=1ms TTL=254

Reply from 20.2.2.1: bytes=32 time=1ms TTL=254

 

Ping statistics for 20.2.2.1:

    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),

Approximate round trip times in milli-seconds:

Minimum = 1ms, Maximum = 6ms, Average = 2ms

# 在host上ping 30.2.2.1,该错误地址无法ping通,并有返回的ICMP差错报文。

C:\ping 30.2.2.1

 

Pinging 30.2.2.1 with 32 bytes of data:

 

Reply from 10.1.1.2: Destination net unreachable.

Reply from 10.1.1.2: Destination net unreachable.

Reply from 10.1.1.2: Destination net unreachable.

Reply from 10.1.1.2: Destination net unreachable.

 

Ping statistics for 30.2.2.1:

    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),

Approximate round trip times in milli-seconds:

    Minimum = 0ms, Maximum = 0ms, Average = 0ms

3.2.5  配置文件

·     Switch A

#

 ip unreachables enable

#

vlan 2 to 3

#

interface Vlan-interface2

 ip address 20.2.2.2 255.255.255.0

#

interface Vlan-interface3

 ip address 10.1.1.2 255.255.255.0

#

interface GigabitEthernet1/0/1

 port link-mode bridge

 port access vlan 3

#

interface GigabitEthernet1/0/2

 port link-mode bridge

 port access vlan 2

#

 ip route-static 10.1.1.0 255.255.255.0 20.2.2.2

#

·     Switch B

#

vlan 2

#

interface Vlan-interface2

 ip address 20.2.2.1 255.255.255.0

#

interface GigabitEthernet1/0/3

 port link-mode bridge

 port access vlan 2

#

 ip route-static 10.1.1.0 255.255.255.0 20.2.2.2

 

不同款型规格的资料略有差异, 详细信息请向具体销售和400咨询。H3C保留在没有任何通知或提示的情况下对资料内容进行修改的权利!

新华三官网
联系我们