如何实现两台华为交换机vlan间互通相同VLAN互通

扫一扫体验手机阅读
配置多台三层交换VLAN间相互通信
第一步 SW100基础配置
SW100&enable
SW100#conf t
Enter configuration commands, one per line. End with CNTL/Z.
SW100(config)#no ip do lo
SW100(config)#line con 0
SW100(config-line)#no exec-t
SW100(config-line)#logg syn
SW100(config-line)#exit
SW100(config)#username admin privilege 15 password admin
SW100(config)#line vty 0 15
SW100(config-line)#login local
SW100(config-line)#int f0/24
//配置把二层接口更改为三层接口
SW100(config-if)#no switchport
SW100(config-if)#ip add 12.0.0.1 255.255.255.0
00:02:57: %LINK-3-UPDOWN: Interface FastEthernet0/24, changed state to up
00:02:58: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/24, changed state to up
SW100(config-if)#no sh
第二步 SW200 基础配置
Switch&enable
Switch#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#host SW200
SW200(config)#no ip do lo
SW200(config)#line con 0
SW200(config-line)#no exec-t
SW200(config-line)#logg syn
SW200(config-line)#exit
SW200(config)#username admin privilege 15 password admin
SW200(config)#line vty 0 15
SW200(config-line)#login local
SW200(config-line)#int f0/24
//把二层端口改变成三层接口
SW200(config-if)#no switchport
SW200(config-if)#ip add 12.0.0.2 255.2
00:03:40: %LINK-3-UPDOWN: Interface FastEthernet0/24, changed state to up
00:03:41: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/24, changed state to up
SW200(config-if)#ip add 12.0.0.2 255.255.255.0
SW200(config-if)#no sh
SW200(config-if)#exit
第三步 完整SW1上VLAN配置
//创建VLAN 100
SW100(config)#vlan 100
//给VLAN命名为100
SW100(config-vlan)#name 100
//进入f0/13接口模式下,把f0/13接口划分到VLAN100
SW100(config-vlan)#int f0/13
SW100(config-if)#switchport mode access
SW100(config-if)#switchport access vlan 100
SW100(config-if)#exit
SW100(config)#int f0/13
//因为此接口连接的终端设备,故可以关闭生成树的选举,开启快速端口特性
SW100(config-if)#spanning-tree portfast
%Warning: portfast should only be enabled on ports connected to a single
host. Connecting hubs, concentrators, switches, bridges, etc... to this
interface when portfast is enabled, can cause temporary bridging loops.
Use with CAUTION
%Portfast has been configured on FastEthernet0/15 but will only
have effect when the interface is in a non-trunking mode.
SW100(config-if)#exit
00:05:40: %SYS-5-CONFIG_I: Configured from console by console
//查看VLAN信息
SW100#show vlan brief
VLAN Name Status Ports
---- -------------------------------- --------- -------------------------------
1 default active Fa0/1, Fa0/2, Fa0/3, Fa0/4
Fa0/5, Fa0/6, Fa0/7, Fa0/8
Fa0/9, Fa0/10, Fa0/11, Fa0/12
Fa0/14, Fa0/15, Fa0/16, Fa0/17
Fa0/18, Fa0/23, Gi0/1, Gi0/2
100 100 active Fa0/13
1002 fddi-default act/unsup
1003 token-ring-default act/unsup
1004 fddinet-default act/unsup
1005 trnet-default act/unsup
第四步 完成SW200上VLAN配置
SW200(config)#vlan 200
SW200(config-vlan)#name 200
SW200(config-vlan)#int f0/15
SW200(config-if)#switchport mode access
SW200(config-if)#switchport access vlan 200
SW200(config-if)#exit
SW200(config)#int f0/15
SW200(config-if)#spanning-tree portfast
%Warning: portfast should only be enabled on ports connected to a single
host. Connecting hubs, concentrators, switches, bridges, etc... to this
interface when portfast is enabled, can cause temporary bridging loops.
Use with CAUTION
%Portfast has been configured on FastEthernet0/15 but will only
have effect when the interface is in a non-trunking mode.
SW100#show vlan brief
VLAN Name Status Ports
---- -------------------------------- --------- -------------------------------
1 default active Fa0/1, Fa0/2, Fa0/3, Fa0/4
Fa0/5, Fa0/6, Fa0/7, Fa0/8
Fa0/9, Fa0/10, Fa0/11, Fa0/12
Fa0/14, Fa0/15, Fa0/16, Fa0/17
Fa0/18, Fa0/23, Gi0/1, Gi0/2
200 200 active Fa0/15
1002 fddi-default act/unsup
1003 token-ring-default act/unsup
1004 fddinet-default act/unsup
1005 trnet-default act/unsup
第五步 在SW100上创建SVI(交换虚拟接口),并给SW100所连接PC配置IP地址为192.168.0.100,网关192.168.0.1(PC配置IP地址,网关,实验手册内容略过)
SW100#conf t
Enter configuration commands, one per line. End with CNTL/Z.
//进入VLAN 100
SW100(config)#int vlan 100
//配置VLAN100,IP地址,这里的IP地址,就是F0/13接口下PC所指的网关地址
SW100(config-if)#ip add 192.168.0.1 255.255.255.0
SW100(config-if)#no sh
SW100(config-if)#end
00:06:09: %LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan100, changed state to up
//从SW100上测试可以ping通本VLAN下PC
SW100#ping 192.168.0.100
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.0.100, timeout is 2 seconds:
第六步 在SW200上创建SVI(交换机虚拟接口),并给SW200所连接PC配置IP地址为172.16.0.100,网关172.16.0.1(PC配置IP地址,实验手册内容略过)
SW200(config-if)#exit
SW200(config)#int vlan 200
SW200(config-if)#ip add 172.16.0.1 255.255.255.0
00:04:41: %LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan200, changed state to up
SW200(config-if)#no sh
SW200(config-if)#end
00:04:52: %SYS-5-CONFIG_I: Configured from console by console
SW200#ping 172.16.0.200
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.0.200, timeout is 2 seconds:
第七步 在SW100 上开启路由功能,并运行动态路由协议
SW100#conf t
Enter configuration commands, one per line. End with CNTL/Z.
//开启三层交换路由功能,默认是关闭的
SW100(config)#ip routing
SW100(config)#router ospf 100
SW100(config-router)#net 12.0.0.1 0.0.0.255 a 0
SW100(config-router)#net 192.168.0.1 0.0.0.255 a 0
SW100(config-router)#end
00:08:11: %SYS-5-CONFIG_I: Configured from console by console
第八步 在SW200 上开启路由功能,并运行动态路由协议
SW200#conf t
Enter configuration commands, one per line. End with CNTL/Z.
//注意:如果没有开启路由功能,直接运行路由协议,将提示如下的错误信息
SW200(config)#router ospf 200
IP routing not enabled
SW200(config)#ip routing
SW200(config)#router ospf 200
SW200(config-router)#net 12.0.0.2 0.0.0.255 a 0
SW200(config-router)#net 172.16.0.2 0.0.0.255 a 0
SW200(config-router)#end
00:05:27: %OSPF-5-ADJCHG: Process 200, Nbr 192.168.0.1 on FastEthernet0/24 from LOADING to FULL, Loading Done
//查看路由表,观察通过OSPF学习到路由条目
SW200#show ip ro
00:05:33: %SYS-5-CONFIG_I: Configured from console by console
SW200#show ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route
Gateway of last resort is not set
172.16.0.0/24 is subnetted, 1 subnets
C 172.16.0.0 is directly connected, Vlan200
O 192.168.0.0/24 [110/2] via 12.0.0.1, 00:00:02, FastEthernet0/24
12.0.0.0/24 is subnetted, 1 subnets
C 12.0.0.0 is directly connected, FastEthernet0/24
//测试IP连通性
SW200#ping 12.0.0.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 12.0.0.1, timeout is 2 seconds:
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/4 ms
SW200#ping 192.168.0.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.0.1, timeout is 2 seconds:
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/4 ms
SW200#ping 192.168.0.100
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.0.100, timeout is 2 seconds:
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/4 ms
第九步 在PC2 用ping命令测试到PC1,测试vlan200是否可以和VLAN 100 PING通,测试结果全网ping 通,实验现象成功(因为PC2是windows 7 简体中文版本,故ping结果是中文方式显示的)
测试步骤:开始-运行-cmd
C:\&ping 172.16.0.1
正在 Ping 172.16.0.1 具有 32 字节的数据:
来自 172.16.0.1 的回复: 字节=32 时间=1ms TTL=255
来自 172.16.0.1 的回复: 字节=32 时间=1ms TTL=255
来自 172.16.0.1 的回复: 字节=32 时间=1ms TTL=255
来自 172.16.0.1 的回复: 字节=32 时间=1ms TTL=255
172.16.0.1 的 Ping 统计信息:
数据包: 已发送 = 4,已接收 = 4,丢失 = 0 (0% 丢失),
往返行程的估计时间(以毫秒为单位):
最短 = 1ms,最长 = 1ms,平均 = 1ms
C:\&ping 12.0.0.2
正在 Ping 12.0.0.2 具有 32 字节的数据:
来自 12.0.0.2 的回复: 字节=32 时间=2ms TTL=255
来自 12.0.0.2 的回复: 字节=32 时间=2ms TTL=255
来自 12.0.0.2 的回复: 字节=32 时间=2ms TTL=255
来自 12.0.0.2 的回复: 字节=32 时间=2ms TTL=255
12.0.0.2 的 Ping 统计信息:
数据包: 已发送 = 4,已接收 = 4,丢失 = 0 (0% 丢失),
往返行程的估计时间(以毫秒为单位):
最短 = 2ms,最长 = 2ms,平均 = 2ms
C:\&ping 12.0.0.1
正在 Ping 12.0.0.1 具有 32 字节的数据:
来自 12.0.0.1 的回复: 字节=32 时间=1ms TTL=254
来自 12.0.0.1 的回复: 字节=32 时间=1ms TTL=254
来自 12.0.0.1 的回复: 字节=32 时间=1ms TTL=254
来自 12.0.0.1 的回复: 字节=32 时间=1ms TTL=254
12.0.0.1 的 Ping 统计信息:
数据包: 已发送 = 4,已接收 = 4,丢失 = 0 (0% 丢失),
往返行程的估计时间(以毫秒为单位):
最短 = 1ms,最长 = 1ms,平均 = 1ms
C:\&ping 192.168.0.1
正在 Ping 192.168.0.1 具有 32 字节的数据:
来自 192.168.0.1 的回复: 字节=32 时间=1ms TTL=254
来自 192.168.0.1 的回复: 字节=32 时间=1ms TTL=254
来自 192.168.0.1 的回复: 字节=32 时间=1ms TTL=254
来自 192.168.0.1 的回复: 字节=32 时间=1ms TTL=254
192.168.0.1 的 Ping 统计信息:
数据包: 已发送 = 4,已接收 = 4,丢失 = 0 (0% 丢失),
往返行程的估计时间(以毫秒为单位):
最短 = 1ms,最长 = 1ms,平均 = 1ms
C:\&ping 192.168.0.200
正在 Ping 192.168.0.200 具有 32 字节的数据:
C:\&ping 192.168.0.100
正在 Ping 192.168.0.100 具有 32 字节的数据:
来自 192.168.0.100 的回复: 字节=32 时间=1ms TTL=62
来自 192.168.0.100 的回复: 字节=32 时间=1ms TTL=62
来自 192.168.0.100 的回复: 字节=32 时间=1ms TTL=62
来自 192.168.0.100 的回复: 字节=32 时间=1ms TTL=62
192.168.0.100 的 Ping 统计信息:
数据包: 已发送 = 4,已接收 =4,丢失 = 0 (0% 丢失),
往返行程的估计时间(以毫秒为单位):
最短 = 1ms,最长 = 1ms,平均 = 1ms
<span type="1" blog_id="215389" userid='
63篇文章,151W+人气,0粉丝
容器私有云平台实践之路
¥51.00129人订阅
高并发架构之路
¥51.00166人订阅
前百度高级工程师的架构高可用实战
¥51.00245人订阅
掌握VMware超融合技术
¥51.0080人订阅
<span type="1" blog_id="215389" userid='两个交换机不同vlan互通问题
最新回复: 08:44:53
求助帖:&(未解决)
如图,两个交换机使用trunk相连,一个vlan2 ,
一个有vlan2和vlan3 都有不同的网关地址,如何实现tx1的vlan2与bj1的vlan3的用户互通。(现在用的这种模式是通的但我用模拟器试过了没弄通,不知道什么原因,求高手指点)tx1#interface Vlanif1#interface Vlanif2 ip address 2.2.2.2 255.255.255.0#interface Vlanif3#interface MEth0/0/1#interface Ethernet0/0/1 port link-type trunk port trunk allow-pass vlan 3#interface Ethernet0/0/2 port link-type access port default vlan 2#bj1#interface Vlanif1#interface Vlanif2 ip address 4.4.4.4 255.255.255.0#interface Vlanif3 ip address 3.3.3.3 255.255.255.0#interface MEth0/0/1#interface Ethernet0/0/1 port link-type trunk port trunk allow-pass vlan 2 to 3#interface Ethernet0/0/2 port link-type access port default vlan 3
附件: 您需要
才可以下载或查看,没有帐号?
我认为现实中有路由所以可以互通,而在模拟器里你的架构与现实不完全相符吧
应该是允许所有VLAN 通过
PC3-2.1访问P4-3.1 通过掩码运算看是是否同网段,发现不同,则走3层找网关vlanif 2,然后网关查路由,看见没有3.0路由,当然不通了。
你现实肯定还开了别的路由协议。
应该是允许所有VLAN 通过
两个交换机的vlan有冲突。
两个交换机都有vlan2的网关,tx1和bj1又都透传了vlan2,应该是要冲突了,搞不懂这样配置是为了什么?如果只是为了实现tx1下的vlan2和bj1的vlan3用户互通,可以让vlan2和vlan3各自终结在tx1和bj1交换机上,tx1和bj1中间做三层接口直连,然后做在tx1和bj1分别做路由和回程路由。不知道我理解的对不对。
你这样肯定有问题啊,都是vlan 2 却是两个不同IP 的网关,你这样透传VLAN 没有意义啊, 不能这样子的架构的
我也认为这样的配置有问题,我模拟了好几遍都不通,但现实中就是这么配的而且还是通的,不是我配的,配的那个人跳槽了,让我百思不得其解,感谢大家的热心帮助,不纠结了,下一步换成三层接口算了。
我也认为这样的配置有问题,我模拟了好几遍都不通,但现实中就是这么配的而且还是通的,不是我配的,配的那 ...
之所以能通,我个人倾向于一楼说的,你的实际网络可能比这个复杂些,可能有其它可达的路由或者链路导致了他们可以互通。
开arp代理能不能实现?
* 是否包含第三方商业秘密:
第三方商业秘密
第三方商业秘密是指第三方不为公众所知悉、具有商业价值并经权利人采取保密措施的技术信息和经营信息,包括但不限于:产品的价格信息、路标规划、商务授权、核心算法和源代码等。如有疑问,请联系:e.(各社区公共邮箱)。
如果附件按钮无法使用,请将Adobe Flash Player 更新到最新版本!
`@trans`drinking_poetry`~trans`
`@trans`drinking_poetry_des`~trans`
`@trans`universal_genius`~trans`
`@trans`universal_genius_des`~trans`2台3层交换机怎样互通
var sogou_ad_id=731549;
var sogou_ad_height=160;
var sogou_ad_width=690;两个交换机上属于不同网络,现通过静态路由配置,实现两网互通。
二、网络示意图
三、配置流程:
1、对两个交换机进行vlan划分,分别加入vlan100
2、分别将两交换机的1~4接口划分到vlan100
3、分别给两交换机的4个vlan接口分配ip地址
4、在两个交换机上配置静态路由
5、用网线将两交换机vlan100中随意两个接口连接起来
四、配置步骤:(华为s5700交换机)
1、创建 vlan 100
[Quidway] vlan 100
[Quidway-Vlanif100] quit 2、将交换机1~4口分配到vlan100[Quidway] interface GigabitEthernet 0/0/1
//进入0/0/1接口
[Quidway-GigabitEthernet0/0/1]port link-type access
//将0/0/1接口改为access模式
[Quidway-GigabitEthernet0/0/1]port access vlan 100
//将0/0/1接口划分到vlan100
//相同操作其他3个端口3、为2个valn 分配ip地址
[Quidway] interface vlan 100
//进入vlan 100接口
[Quidway-Vlanif100] ip address 192.168.1.1 255.255.255.224 //为vlan 100分配IP地址
[Quidway-Vlanif100] quit
//退出vlan 100接口
[Quidway] interface vlan 1
[Quidway-Vlanif1] ip address 10.130.55.85 255.255.255.224 //为vlan 100分配IP地址 4、设置静态路由[Quidway]undo autoconfig en
//关闭autoconfig
[Quidway]ip route-static 10.1.1.160 255.255.255.224 192.168.1.2
//配置交换机到10.1.1.160 255.255.255.224网络的訪问交给192.168.1.2
1、创建 vlan 100(同内网交换机)
2、将交换机1~4口分配到vlan100(同内网交换机)
3、为2个valn 分配ip地址[Quidway] interface vlan 100
//进入vlan 100接口
[Quidway-Vlanif100] ip address 192.168.1.2 255.255.255.224 //为vlan 100分配IP地址
[Quidway-Vlanif100] quit
//退出vlan 100接口
[Quidway] interface vlan 1
[Quidway-Vlanif1] ip address 10.1.1.161 255.255.255.224 //为vlan 100分配IP地址4、设置静态路由
[Quidway]undo autoconfig en
//关闭autoconfig
[Quidway]ip route-static 10.130.55.64 255.255.255.224 192.168.1.1 //配置交换机到10.130.55.64 255.255.255.224网络的訪问交给192.168.1.1
最后。用网线将两交换机vlan100中随意两个接口连接起来,測试网络情况。
附:华为交换机配置命令&
阅读(...) 评论()当要使一个vlan跨越两台交换机时,需要哪个特性支持-土地公问答
当要使一个vlan跨越两台交换机时,需要哪个特性支持
当要使一个vlan跨越两台交换机时,需要哪个特性支持
答:在路由/交换领域,VLAN的中继端口叫做trunk。trunk技术用在交换机之间互连,使不同VLAN通过共享链路与其它交换机中的相同VLAN通信。交换机之间互连的端口就称为trunk端口。trunk是基于OSI第二层数据链路层(DataLinkLayer)的技术。两台交换机上...
使不同VLAN通过共享链路与其它交换机中的相同VLAN通信。交换机之间互连的端口就称为trunk端口。trunk是基于OSI第二层数据链路层(DataLinkLayer)的技术。两台交换机上分别创建了多个VLAN(VLAN是基于Layer 2的),VLAN的中继端口叫做trunk。trunk技术用在交换机之间互连,需要将交换机A上属于VLAN10的一个端口与交换机B上属于VLAN10的一个端口互连;如果这两台交换机其它相同VLAN间需要通信,那么交换机之间需要更多的互连线,端口利用率就太低了。 交换机通过trunk功能,事情就简单了在路由/交换领域,只需要两台交换机之间有一条互连线,将互连线的两个端口设置为trunk模式,这样就可以使交换机上不同VLAN共享这条线路,在两台交换机上相同的VLAN(比如VLAN10)要通信?url=2SVEJ6CG8LP7MBbeb7-uTPbzcEocmO6qMDKFlKokrop24X6deKxQOp_q_CLhHlw1qOMmANHk_12cCA2X_f6Vt_" target="_blank">http://baike.baidu.com/link。详见:
其它类似问题
其它人正在问的问题}

我要回帖

更多关于 两个交换机vlan互通 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信