两台交换机不同网络段的主机通过两台交换机进行互访

两台交换机不同网络段的主机通过两台交换机进行互访?Topo 如下

实现192.168.10.10 与192.168.11.10 、192.168.13.10 互通

 

两台交换机不同网络段的主机通过两台交换机进行互访_第1张图片

 ###在SW3 上配置

### SW3 上配置

vlan batch 10 13 100
#
interface Vlanif10
 ip address 192.168.10.1 255.255.255.0
#
interface Vlanif13
 ip address 192.168.13.1 255.255.255.0
#
interface Vlanif100
 ip address 192.168.100.1 255.255.255.0
#
interface GigabitEthernet0/0/2
 port link-type trunk
 undo port trunk allow-pass vlan 1
 port trunk allow-pass vlan 100
#
interface GigabitEthernet0/0/3
 port link-type access
 port default vlan 10
#
interface GigabitEthernet0/0/4
 port link-type access
 port default vlan 13

 ###SW5 配置

vlan batch 11 12 100
#
interface Vlanif11
 ip address 192.168.11.1 255.255.255.0
#
interface Vlanif12
 ip address 192.168.12.1 255.255.255.0
#
interface Vlanif100
 ip address 192.168.100.2 255.255.255.0
#

interface GigabitEthernet0/0/2
 port link-type trunk
 undo port trunk allow-pass vlan 1
 port trunk allow-pass vlan 100
#
interface GigabitEthernet0/0/3
 port link-type access
 port default vlan 12
#
interface GigabitEthernet0/0/4
 port link-type access
 port default vlan 11

## 配置静态路由

添加静态路由的目的是 找到出口,把访问所有192.168.11.0 所有的网络都指向下一跳出口192.168.100.2,同理在对端也写回来的静态路由。

##SW3

##SW3 执行
ip route-static 192.168.11.0 255.255.255.0 192.168.100.2
ip route-static 192.168.12.0 255.255.255.0 192.168.100.2

##SW5

## SW5 上执行
ip route-static 192.168.10.0 255.255.255.0 192.168.100.1
ip route-static 192.168.13.0 255.255.255.0 192.168.100.1
## 测试
PC>ping 192.168.10.10 -t
Ping 192.168.10.10: 32 data bytes, Press Ctrl_C to break
Request timeout!
From 192.168.10.10: bytes=32 seq=2 ttl=126 time=63 ms
From 192.168.10.10: bytes=32 seq=3 ttl=126 time=78 ms

PC>ping 192.168.11.10 -t

Ping 192.168.11.10: 32 data bytes, Press Ctrl_C to break
Request timeout!
From 192.168.11.10: bytes=32 seq=2 ttl=127 time=31 ms
From 192.168.11.10: bytes=32 seq=3 ttl=127 time=32 ms

PC>ping 192.168.12.10 -t

Ping 192.168.12.10: 32 data bytes, Press Ctrl_C to break
From 192.168.12.10: bytes=32 seq=1 ttl=128 time<1 ms
From 192.168.12.10: bytes=32 seq=2 ttl=128 time<1 ms

PC>ping 192.168.13.10 -t

Ping 192.168.13.10: 32 data bytes, Press Ctrl_C to break
From 192.168.13.10: bytes=32 seq=1 ttl=126 time=79 ms
From 192.168.13.10: bytes=32 seq=2 ttl=126 time=63 ms

 

你可能感兴趣的:(华为设备,Switch)