华为3层交换机修改vlan设置
interfaceVlanif360ipaddress192.168.36.254255.255.255.0dhcpselectinterfacedhcpserverex...
interface Vlanif360
ip address 192.168.36.254 255.255.255.0
dhcp select interface
dhcp server excluded-ip-address 192.168.36.201 192.168.36.253
dhcp server dns-list 218.85.157.99 58.22.96.66
#
interface Vlanif370
ip address 192.168.37.254 255.255.255.0
dhcp select interface
dhcp server excluded-ip-address 192.168.37.201 192.168.37.253
dhcp server dns-list 218.85.157.99 58.22.96.66
#
interface Vlanif810
ip address 192.168.81.254 255.255.255.0
dhcp select interface
dhcp server dns-list 218.85.157.99 58.22.96.66
#
interface Vlanif820
ip address 192.168.82.1 255.255.255.0
dhcp select interface
dhcp server dns-list 218.85.157.99 58.22.96.66
#
interface Vlanif900
ip address 172.16.0.1 255.255.255.0
。。。。。。。。。。
interface GigabitEthernet0/0/44
port hybrid pvid vlan 370
port hybrid untagged vlan 370
ntdp enable
ndp enable
bpdu enable
undo negotiation auto
speed 100
#
interface GigabitEthernet0/0/45
port link-type access
port default vlan 130
ntdp enable
ndp enable
bpdu enable
#
interface GigabitEthernet0/0/46
port link-type access
port default vlan 810
ntdp enable
ndp enable
bpdu enable
#
interface GigabitEthernet0/0/47
port link-type trunk
undo port trunk allow-pass vlan 1
port trunk allow-pass vlan 900
undo ntdp enable
undo ndp enable
#
interface GigabitEthernet0/0/48
port hybrid pvid vlan 880
port hybrid untagged vlan 880
ntdp enable
ndp enable
bpdu enable
undo negotiation auto
#
interface NULL0
#
ip route-static 0.0.0.0 0.0.0.0 172.16.0.254
原来使用47口vlan900做为对接
现在需要把48口做为trunk口 设置VLAN1与路由对接
请问怎么改设置,最好能写详细的步骤 展开
ip address 192.168.36.254 255.255.255.0
dhcp select interface
dhcp server excluded-ip-address 192.168.36.201 192.168.36.253
dhcp server dns-list 218.85.157.99 58.22.96.66
#
interface Vlanif370
ip address 192.168.37.254 255.255.255.0
dhcp select interface
dhcp server excluded-ip-address 192.168.37.201 192.168.37.253
dhcp server dns-list 218.85.157.99 58.22.96.66
#
interface Vlanif810
ip address 192.168.81.254 255.255.255.0
dhcp select interface
dhcp server dns-list 218.85.157.99 58.22.96.66
#
interface Vlanif820
ip address 192.168.82.1 255.255.255.0
dhcp select interface
dhcp server dns-list 218.85.157.99 58.22.96.66
#
interface Vlanif900
ip address 172.16.0.1 255.255.255.0
。。。。。。。。。。
interface GigabitEthernet0/0/44
port hybrid pvid vlan 370
port hybrid untagged vlan 370
ntdp enable
ndp enable
bpdu enable
undo negotiation auto
speed 100
#
interface GigabitEthernet0/0/45
port link-type access
port default vlan 130
ntdp enable
ndp enable
bpdu enable
#
interface GigabitEthernet0/0/46
port link-type access
port default vlan 810
ntdp enable
ndp enable
bpdu enable
#
interface GigabitEthernet0/0/47
port link-type trunk
undo port trunk allow-pass vlan 1
port trunk allow-pass vlan 900
undo ntdp enable
undo ndp enable
#
interface GigabitEthernet0/0/48
port hybrid pvid vlan 880
port hybrid untagged vlan 880
ntdp enable
ndp enable
bpdu enable
undo negotiation auto
#
interface NULL0
#
ip route-static 0.0.0.0 0.0.0.0 172.16.0.254
原来使用47口vlan900做为对接
现在需要把48口做为trunk口 设置VLAN1与路由对接
请问怎么改设置,最好能写详细的步骤 展开
2个回答
展开全部
1.交换机SW2的配置
先在交换机上加VLAN 10 20,再设置接口传输模式为access口
<Huawei>sy
[Huawei]vlan bat 10 20 #批量加vlan10和20
[Huawei]int e0/0/1
[Huawei-Ethernet0/0/1]portlink-type ac
[Huawei-Ethernet0/0/1]port link-typeaccess #接口类型为access
[Huawei-Ethernet0/0/1]port defaultvlan 10 #让接口属于vlan10
[Huawei-Ethernet0/0/1]inte0/0/2
[Huawei-Ethernet0/0/2]portlink-type ac
[Huawei-Ethernet0/0/2]portlink-type access
[Huawei-Ethernet0/0/2]portde
[Huawei-Ethernet0/0/2]portdefault vlan 20
[Huawei-Ethernet0/0/2]intg0/0/1
[Huawei-GigabitEthernet0/0/1]port link-type trunk #将g0/0/1设为trunk 中继口
[Huawei-GigabitEthernet0/0/1]port trunk allow-pass vlan 1 10 20
#此中继接口允许vlan1 10 20的数据过,也称透传
用display vlan
spacer.gif spacer.gif
l 给交换机SW2配IP地址和网关,便于远程管理
因为交换机的接口是二层接口不能陪IP,所以给交换机配IP只能为其VLAN虚拟口配IP
[Huawei]int vlan 1
[Huawei-Vlanif1]ip add192.168.1.254 24
[Huawei-Vlanif1]q
在华为模拟器上通过设默认路由的方式为其设置网关
[Huawei]ip route-s
[Huawei]ip route-static 0.0.0.0 0.0.0.0 192.168.1.1
[Huawei]
用display ip interface brief查看各接口配置
2.交换机SW3的配置
为交换机SW3配VLAN,接口传输模式为hybrid untagged模式,hybriduntagged模式不带标签相当于access模式,hybrid tagged模式带标签相当于trunk模式
<Huawei>sy
[Huawei]vlan bat 10 20
[Huawei]interface e0/0/3
[Huawei-Ethernet0/0/3]portlink-type hybrid #将接口类型设为hybrid混合接口,华为三层交换机接口默认就是hybrid,属于这条命令可以不用写
[Huawei-Ethernet0/0/3]port hybridpvid vlan 10
[Huawei-Ethernet0/0/3]porthy
[Huawei-Ethernet0/0/3]porthybrid un
[Huawei-Ethernet0/0/3]porthybrid untagged
[Huawei-Ethernet0/0/3]porthybrid untagged vlan 10 #允许vlan10 的数据过且不带标签
[Huawei-Ethernet0/0/3]inte0/0/4
[Huawei-Ethernet0/0/4]porthybrid pvid vlan 20
[Huawei-Ethernet0/0/4]porthybrid un
[Huawei-Ethernet0/0/4]porthybrid untagged vlan 20
[Huawei-Ethernet0/0/4]
[Huawei-Ethernet0/0/4]intg0/0/1
[Huawei-GigabitEthernet0/0/1]porthybrid pvid vlan 10
[Huawei-GigabitEthernet0/0/1]porthybrid pvid vlan 20
[Huawei-GigabitEthernet0/0/1]porthy
[Huawei-GigabitEthernet0/0/1]porthybrid t
[Huawei-GigabitEthernet0/0/1]porthybrid tagged vlan 10 20
#允许vlan10 20的数据通过且带标签
用display vlan查看vlan配置
给交换机vlan1配ip地址和网关,便于远程管理
[Huawei-GigabitEthernet0/0/1]intvlan 1
[Huawei-Vlanif1]ip add192.168.1.253 24
[Huawei-Vlanif1]q
[Huawei]ip route-s
[Huawei]ip route-static 0.0.0.0 0.0.0.0 192.168.1.1
[Huawei]
3.三层交换机SW1的配置
给交换机SW1配vlan
<Huawei>sy
[Huawei]vlan bat 10 20 100
[Huawei]interface g0/0/1
[Huawei-GigabitEthernet0/0/1]portlink-type trunk
[Huawei-GigabitEthernet0/0/1]porttrunk allow-pass vlan 1 10 20
[Huawei-GigabitEthernet0/0/1]intg0/0/2
[Huawei-GigabitEthernet0/0/2]port hybridpvid vlan 1
[Huawei-GigabitEthernet0/0/2]port hybridpvid vlan 10
[Huawei-GigabitEthernet0/0/2]port hybridpvid vlan 20
[Huawei-GigabitEthernet0/0/2]porthybrid un
[Huawei-GigabitEthernet0/0/2]port hybriduntagged vlan 1 10 20
[Huawei-GigabitEthernet0/0/2]intg0/0/3
[Huawei-GigabitEthernet0/0/3]portlink-type ac
[Huawei-GigabitEthernet0/0/3]portlink-type access
[Huawei-GigabitEthernet0/0/3]portde
[Huawei-GigabitEthernet0/0/3]portdefault vlan 100
给vlan110 20 100配ip地址
[Huawei-GigabitEthernet0/0/3]intvlan 1
[Huawei-Vlanif1]ipadd 192.168.1.1 24
[Huawei-Vlanif1]
[Huawei]intvlan 10
[Huawei-Vlanif10]
[Huawei-Vlanif10]ip add192.168.10.1 24
[Huawei-Vlanif10]
[Huawei-Vlanif10]int vlan20
[Huawei-Vlanif20]ip add192.168.20.1 24
[Huawei-Vlanif20]
[Huawei-Vlanif20]int vlan100
[Huawei-Vlanif100]ip add201.100.100.1 24
为交换机配默认路由
[Huawei]iproute-s
[Huawei]ip route-static 0.0.0.0 0.0.0.0 201.100.100.24.路由器R1 的配置
给路由器R1接口配ip地址和默认路由
<Huawei>sy
[Huawei]int g0/0/0
[Huawei-GigabitEthernet0/0/0]ipadd 201.100.100.2 24
[Huawei]ip route-s
[Huawei]ip route-static 0.0.0.0 0.0.0.0 201.100.100.1
用display ip int b查看接口配置,用displayip routing-t查看路由表
4).验证结果
因为C1和C3属于vlan10,C2和C4属于vlan20,如果没有做vlan间路由,不同vlan间的成员是无法通信的,现在用C1 ping C2、C4和R1就说明vlan间路由是做成功的
先在交换机上加VLAN 10 20,再设置接口传输模式为access口
<Huawei>sy
[Huawei]vlan bat 10 20 #批量加vlan10和20
[Huawei]int e0/0/1
[Huawei-Ethernet0/0/1]portlink-type ac
[Huawei-Ethernet0/0/1]port link-typeaccess #接口类型为access
[Huawei-Ethernet0/0/1]port defaultvlan 10 #让接口属于vlan10
[Huawei-Ethernet0/0/1]inte0/0/2
[Huawei-Ethernet0/0/2]portlink-type ac
[Huawei-Ethernet0/0/2]portlink-type access
[Huawei-Ethernet0/0/2]portde
[Huawei-Ethernet0/0/2]portdefault vlan 20
[Huawei-Ethernet0/0/2]intg0/0/1
[Huawei-GigabitEthernet0/0/1]port link-type trunk #将g0/0/1设为trunk 中继口
[Huawei-GigabitEthernet0/0/1]port trunk allow-pass vlan 1 10 20
#此中继接口允许vlan1 10 20的数据过,也称透传
用display vlan
spacer.gif spacer.gif
l 给交换机SW2配IP地址和网关,便于远程管理
因为交换机的接口是二层接口不能陪IP,所以给交换机配IP只能为其VLAN虚拟口配IP
[Huawei]int vlan 1
[Huawei-Vlanif1]ip add192.168.1.254 24
[Huawei-Vlanif1]q
在华为模拟器上通过设默认路由的方式为其设置网关
[Huawei]ip route-s
[Huawei]ip route-static 0.0.0.0 0.0.0.0 192.168.1.1
[Huawei]
用display ip interface brief查看各接口配置
2.交换机SW3的配置
为交换机SW3配VLAN,接口传输模式为hybrid untagged模式,hybriduntagged模式不带标签相当于access模式,hybrid tagged模式带标签相当于trunk模式
<Huawei>sy
[Huawei]vlan bat 10 20
[Huawei]interface e0/0/3
[Huawei-Ethernet0/0/3]portlink-type hybrid #将接口类型设为hybrid混合接口,华为三层交换机接口默认就是hybrid,属于这条命令可以不用写
[Huawei-Ethernet0/0/3]port hybridpvid vlan 10
[Huawei-Ethernet0/0/3]porthy
[Huawei-Ethernet0/0/3]porthybrid un
[Huawei-Ethernet0/0/3]porthybrid untagged
[Huawei-Ethernet0/0/3]porthybrid untagged vlan 10 #允许vlan10 的数据过且不带标签
[Huawei-Ethernet0/0/3]inte0/0/4
[Huawei-Ethernet0/0/4]porthybrid pvid vlan 20
[Huawei-Ethernet0/0/4]porthybrid un
[Huawei-Ethernet0/0/4]porthybrid untagged vlan 20
[Huawei-Ethernet0/0/4]
[Huawei-Ethernet0/0/4]intg0/0/1
[Huawei-GigabitEthernet0/0/1]porthybrid pvid vlan 10
[Huawei-GigabitEthernet0/0/1]porthybrid pvid vlan 20
[Huawei-GigabitEthernet0/0/1]porthy
[Huawei-GigabitEthernet0/0/1]porthybrid t
[Huawei-GigabitEthernet0/0/1]porthybrid tagged vlan 10 20
#允许vlan10 20的数据通过且带标签
用display vlan查看vlan配置
给交换机vlan1配ip地址和网关,便于远程管理
[Huawei-GigabitEthernet0/0/1]intvlan 1
[Huawei-Vlanif1]ip add192.168.1.253 24
[Huawei-Vlanif1]q
[Huawei]ip route-s
[Huawei]ip route-static 0.0.0.0 0.0.0.0 192.168.1.1
[Huawei]
3.三层交换机SW1的配置
给交换机SW1配vlan
<Huawei>sy
[Huawei]vlan bat 10 20 100
[Huawei]interface g0/0/1
[Huawei-GigabitEthernet0/0/1]portlink-type trunk
[Huawei-GigabitEthernet0/0/1]porttrunk allow-pass vlan 1 10 20
[Huawei-GigabitEthernet0/0/1]intg0/0/2
[Huawei-GigabitEthernet0/0/2]port hybridpvid vlan 1
[Huawei-GigabitEthernet0/0/2]port hybridpvid vlan 10
[Huawei-GigabitEthernet0/0/2]port hybridpvid vlan 20
[Huawei-GigabitEthernet0/0/2]porthybrid un
[Huawei-GigabitEthernet0/0/2]port hybriduntagged vlan 1 10 20
[Huawei-GigabitEthernet0/0/2]intg0/0/3
[Huawei-GigabitEthernet0/0/3]portlink-type ac
[Huawei-GigabitEthernet0/0/3]portlink-type access
[Huawei-GigabitEthernet0/0/3]portde
[Huawei-GigabitEthernet0/0/3]portdefault vlan 100
给vlan110 20 100配ip地址
[Huawei-GigabitEthernet0/0/3]intvlan 1
[Huawei-Vlanif1]ipadd 192.168.1.1 24
[Huawei-Vlanif1]
[Huawei]intvlan 10
[Huawei-Vlanif10]
[Huawei-Vlanif10]ip add192.168.10.1 24
[Huawei-Vlanif10]
[Huawei-Vlanif10]int vlan20
[Huawei-Vlanif20]ip add192.168.20.1 24
[Huawei-Vlanif20]
[Huawei-Vlanif20]int vlan100
[Huawei-Vlanif100]ip add201.100.100.1 24
为交换机配默认路由
[Huawei]iproute-s
[Huawei]ip route-static 0.0.0.0 0.0.0.0 201.100.100.24.路由器R1 的配置
给路由器R1接口配ip地址和默认路由
<Huawei>sy
[Huawei]int g0/0/0
[Huawei-GigabitEthernet0/0/0]ipadd 201.100.100.2 24
[Huawei]ip route-s
[Huawei]ip route-static 0.0.0.0 0.0.0.0 201.100.100.1
用display ip int b查看接口配置,用displayip routing-t查看路由表
4).验证结果
因为C1和C3属于vlan10,C2和C4属于vlan20,如果没有做vlan间路由,不同vlan间的成员是无法通信的,现在用C1 ping C2、C4和R1就说明vlan间路由是做成功的
展开全部
SYS
interface GigabitEthernet0/0/48
UDNO port hybrid untagged vlan 880
UNDO port hybrid pvid vlan 880
这3行有用UNDO 删除 有用 ndp DI 删除的
ntdp enable
ndp enable
bpdu enable
之后
port link-type trunk
VLAN1 是默认的不用管就有的
interface GigabitEthernet0/0/48
UDNO port hybrid untagged vlan 880
UNDO port hybrid pvid vlan 880
这3行有用UNDO 删除 有用 ndp DI 删除的
ntdp enable
ndp enable
bpdu enable
之后
port link-type trunk
VLAN1 是默认的不用管就有的
追问
您好!需要用172.16.0.1 255.255.255.0 这个网关做路由的回指 48口所在的VLAN1需要修改嘛
追答
需要 不然不通
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询