vlan组间通信举例(vlanif实现)

1,组间通信:

2,设置:

(1)设置R2

设置eth0/0/1和ge0/0/0

<router2>system-view 
Enter system view, return user view with Ctrl+Z.
[router2]interface eth	
[router2]interface Ethernet0/0/1
[router2-Ethernet0/0/1]	
[router2-Ethernet0/0/1]display this 
#
interface Ethernet0/0/1
 portswitch
 port link-type access
 port default vlan 10
#
return
[router2-Ethernet0/0/1]q
[router2]interface G	
[router2]interface GigabitEthernet0/0/0
[router2-GigabitEthernet0/0/0]display this
#
interface GigabitEthernet0/0/0
 portswitch
 port link-type access
 port default vlan 20
#
return
[router2-GigabitEthernet0/0/0]

设置eth0/0/0

[router2]interface Ethernet0/0/0
[router2-Ethernet0/0/0]display this
#
interface Ethernet0/0/0
 portswitch
 port link-type trunk
 port trunk allow-pass vlan 10 20
#
return
[router2-Ethernet0/0/0]

(2)设置R3

设置eth0/0/1和ge0/0/0

<router3>system-view 
Enter system view, return user view with Ctrl+Z.
[router3]interface Ethe	
[router3]interface Ethernet0/0/1
[router3-Ethernet0/0/1]display this
#
interface Ethernet0/0/1
 portswitch
 port link-type access
 port default vlan 30
#
return
[router3-Ethernet0/0/1]q	
[router3]interface G	
[router3]interface GigabitEthernet0/0/0
[router3-GigabitEthernet0/0/0]display t	
[router3-GigabitEthernet0/0/0]display this
#
interface GigabitEthernet0/0/0
 portswitch
 port link-type access
 port default vlan 40
#
return
[router3-GigabitEthernet0/0/0]

设置eth0/0/0,允许vlan发送

[router3]interface Ethernet0/0/0
[router3-Ethernet0/0/0]
[router3-Ethernet0/0/0]display this
#
interface Ethernet0/0/0
 portswitch
 port link-type trunk
 port trunk allow-pass vlan 30 40
#
return
[router3-Ethernet0/0/0]

(3)设置R1

设置eth0/0/0和设置eth0/0/1

[router1]interface Ethernet0/0/0
[router1-Ethernet0/0/0]display this
#
interface Ethernet0/0/0
 portswitch
 port link-type trunk
 port trunk allow-pass vlan 10 20
#
return
[router1-Ethernet0/0/0]q
[router1]interface Ethernet0/0/1
[router1-Ethernet0/0/1]display this
#
interface Ethernet0/0/1
 portswitch
 port link-type trunk
 port trunk allow-pass vlan 30 40
#
return

(4)配置ip:当二层设备需要与三层设备通信时,由于二层设备上都是二层口无法配置IP地址,所以可以创建基于VLAN的逻辑接口,即VLANIF接口。VLANIF接口是三层接口,可以配置IP地址,通过IP地址,该设备即能与三层其他设备互相通信。

interface Vlanif 10
[PE-Vlanif10]ip address 10.110.5.3 24
[PE-Vlanif10]quit
[PE] interface Vlanif 20
[PE-Vlanif20]ip address 10.110.6.3 24
[PE-Vlanif20]quit
[PE] interface Vlanif 30
[PE-Vlanif30]ip address 10.110.4.3 24
[PE-Vlanif30]quit
[PE] interface Vlanif 40
[PE-Vlanif40]ip address 10.110.3.3 24

 

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

陌上花开缓缓归以

你的鼓励将是我创作的最大动力,

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值