二层交换机配置无法上网的问题

132 天前
 yiluqingshen
1 、这是交换机 VLAN 配置信息:

[H3C]dis vlan
Total VLANs: 25
The VLANs include:
1(default), 101-124

2 、配置信息:

[H3C]dis int br
Brief information on interfaces in route mode:
Link: ADM - administratively down; Stby - standby
Protocol: (s) - spoofing
Interface Link Protocol Primary IP Description
InLoop0 UP UP(s) --
NULL0 UP UP(s) --
Vlan1 DOWN DOWN 192.168.0.233

Brief information on interfaces in bridge mode:
Link: ADM - administratively down; Stby - standby
Speed: (a) - auto
Duplex: (a)/A - auto; H - half; F - full
Type: A - access; T - trunk; H - hybrid
Interface Link Speed Duplex Type PVID Description
GE1/0/1 DOWN auto A A 101
GE1/0/2 DOWN auto A A 102
GE1/0/3 DOWN auto A A 103
GE1/0/4 DOWN auto A A 104
GE1/0/5 DOWN auto A A 105
GE1/0/6 DOWN auto A A 106
GE1/0/7 DOWN auto A A 107
GE1/0/8 DOWN auto A A 108
GE1/0/9 DOWN auto A A 109
GE1/0/10 DOWN auto A A 110
GE1/0/11 DOWN auto A A 111
GE1/0/12 DOWN auto A A 112
GE1/0/13 DOWN auto A A 113
GE1/0/14 DOWN auto A A 114
GE1/0/15 DOWN auto A A 115
GE1/0/16 DOWN auto A A 116
GE1/0/17 DOWN auto A A 117
GE1/0/18 DOWN auto A A 118
GE1/0/19 DOWN auto A A 119
GE1/0/20 DOWN auto A A 120
GE1/0/21 DOWN auto A A 121
GE1/0/22 DOWN auto A A 122
GE1/0/23 DOWN auto A A 123
GE1/0/24 DOWN auto A A 124
GE1/0/25 DOWN auto A A 1
GE1/0/26 DOWN auto A A 1
GE1/0/27 DOWN auto A A 1
GE1/0/28 DOWN auto A T 1

----------------------------------------------------------------------
华三二层交换机(型号:5024pv3-EI ),1-24 口划分 VLAN 101-124 为 access 口,28 口划分为 trunk 口连接路由器,无法上网,是什么意思呢?怎么解决?
交换机如果复位用默认 VLAN 1 ,又可以上网。
是不是二屋交换机不具有划分 VLAN 后不具有上网的属性啊? 在线等各位大神解答。
1267 次点击
所在节点    宽带症候群
38 条回复
Soo0
132 天前
28 trunk 配置可通过 vlan ,不知道你是什么路由器,路由器中起对应的子接口 vlan 及 ip?
hxsf
132 天前
你可能需要的是端口隔离( port-isolate )?
然后配合路由器上的三层隔离
youdoit
132 天前
大哥啊,你几台交换机还没有好啊

应该直接给 dis cu 吧

我猜测你没有配置默认路由
Oohuo
132 天前
一、默认 vlan1 傻瓜交换机, 他就是当 hub 用的,只要路由器出来的口子能上网,插上去就能用

二、划分 VLAN
1 、路由器、交换机划分 VLAN ,网关在路由器,交换机 trunk 连路由器,每个口子 access 不同 VLAN ,也能用
2 、路由器、交换机划分 VLAN ,网关在交换机。需要在路由器和交换机起互联地址、配置路由
yiluqingshen
132 天前
@youdoit 路由器是装宽带 送的路由器(中兴 E2633 ),网关是 192.168.52.1 ,这台 2 层交换机怎么配置,二层交换机好像不能获取 DHCP 吧?
yiluqingshen
132 天前
@Oohuo 意思是 28 口( trunk 口)连接上面家用 E2633 路由器,其它任一 1-24 口( access 口)连接电脑,这样我试过了 ,不能上网。
家用 E2633 不能划分 VLAN 的,TPLINK 的 802.1Q 为什么可以,1-7 口分别划分 VLAN ,几个口分别设置 PVID 可以上网的,也试过了。
机制应该类似,但是这台华三不太会弄了,
yiluqingshen
132 天前
sysname H3C
#
telnet server enable
#
irf mac-address persistent timer
irf auto-update enable
undo irf link-delay
irf member 1 priority 1
#
lldp global enable
#
password-recovery enable
#
vlan 1
#
vlan 101 to 124
#
interface NULL0
#
interface Vlan-interface1
ip address dhcp-alloc
dhcp client identifier ascii 3cd2e5e72fb5-VLAN0001
#
interface GigabitEthernet1/0/1
port access vlan 101
#
interface GigabitEthernet1/0/2
port access vlan 102
#
interface GigabitEthernet1/0/3
port access vlan 103
#
interface GigabitEthernet1/0/4
port access vlan 104
#
interface GigabitEthernet1/0/5
port access vlan 105
#
interface GigabitEthernet1/0/6
port access vlan 106
#
interface GigabitEthernet1/0/7
port access vlan 107
#
interface GigabitEthernet1/0/8
port access vlan 108
#
interface GigabitEthernet1/0/9
port access vlan 109
#
interface GigabitEthernet1/0/10
port access vlan 110
#
interface GigabitEthernet1/0/11
port access vlan 111
#
interface GigabitEthernet1/0/12
port access vlan 112
#
interface GigabitEthernet1/0/13
port access vlan 113
#
interface GigabitEthernet1/0/14
port access vlan 114
#
interface GigabitEthernet1/0/15
port access vlan 115
#
interface GigabitEthernet1/0/16
port access vlan 116
#
interface GigabitEthernet1/0/17
port access vlan 117
#
interface GigabitEthernet1/0/18
port access vlan 118
#
interface GigabitEthernet1/0/19
port access vlan 119
#
interface GigabitEthernet1/0/20
port access vlan 120
#
interface GigabitEthernet1/0/21
port access vlan 121
#
interface GigabitEthernet1/0/22
port access vlan 122
#
interface GigabitEthernet1/0/23
port access vlan 123
#
interface GigabitEthernet1/0/24
port access vlan 124
#
interface GigabitEthernet1/0/25
#
interface GigabitEthernet1/0/26
#
interface GigabitEthernet1/0/27
#
interface GigabitEthernet1/0/28
port link-type trunk
port trunk permit vlan all
#
scheduler logfile size 16
#
line class aux
authentication-mode scheme
user-role network-admin
#
line class vty
authentication-mode scheme
user-role network-operator
#
line aux 0
user-role network-admin
#
line vty 0 63
user-role network-operator
#
snmp-agent
snmp-agent local-engineid 800063A2803CD2E5E72FC000000001
snmp-agent community write private
snmp-agent community read public
snmp-agent sys-info version all
#
domain system
#
domain default enable system
#
role name level-0
description Predefined level-0 role
#
role name level-1
description Predefined level-1 role
#
role name level-2
description Predefined level-2 role
#
role name level-3
description Predefined level-3 role
#
role name level-4
description Predefined level-4 role
#
role name level-5
description Predefined level-5 role
#
role name level-6
description Predefined level-6 role
#
role name level-7
description Predefined level-7 role
#
role name level-8
description Predefined level-8 role
#
role name level-9
description Predefined level-9 role
#
role name level-10
description Predefined level-10 role
#
role name level-11
description Predefined level-11 role
#
role name level-12
description Predefined level-12 role
#
role name level-13
description Predefined level-13 role
#
role name level-14
description Predefined level-14 role
#
user-group system
yiluqingshen
132 天前
朋友们,看看 dis cu 配置信息,是什么问题,欢迎大佬分析指正。
youdoit
132 天前
大哥配置一个默认路由吧
ScotGu
132 天前
1-24 独立 VLAN 我理解,但是 28 口 trunk 后的路由设备有对应的 VLAN 么? VLAN 里配置对应的互联(网关) IP 了么?
Soo0
131 天前
上联路由是家用的?不支持子接口?交换机这么多 VLAN 的目的是为了什么?
hefish
131 天前
家里搞这么多 vlan 啊。。。仰视一下。
xdzhang
131 天前
没搞懂这样配的目的。
Soo0
131 天前
@xdzhang 看交换机配置像是打算汇聚宽带跑 PCDN ,跟他的描述又不一样,不知道他到底啥目的😂
wuxiao2522
131 天前
你需要的是端口隔离,而非每个口划一个 vlan 。否则每个 vlan 需配置一个网关。
wuxiao2522
131 天前
interface Vlan-interface101
ip address 192.168.101.1/24
interface Vlan-interface102
ip address 192.168.102.1/24
interface Vlan-interface10x
ip address 192.168.1.10x.1/24

...

ip rooute 0.0.0.0 0.0.0.0 出口网关 ip 0---默认路由
wuxiao2522
131 天前
额,没看到你这是二层交换,那我上面写的就无效了。恢复初始化,启用端口隔离吧。
yiluqingshen
131 天前
@wuxiao2522 谢谢朋友 ,如你所说我需要的应该是“基于 VLAN 的端口隔离”。
前面配置确实如 @Soo0 所说准备跑 PCDN 的,目前正在准宽带中,把这交换机来练练手,跟你们学习 1 下。
yiluqingshen
131 天前
以下是官方文档的内容:


配置步骤
# 创建三个端口组 VLAN ,并将端口 Ethernet1/0/1 、Ethernet1/0/2 、Ethernet1/0/3 、Ethernet1/0/4 、Ethernet1/0/5 分别加入到三个端口组 VLAN 。

<Device> system-view

[Device] port-group-vlan 2 to 4

[Device] port-group-vlan 2 Ethernet 1/0/1 to Ethernet 1/0/2

[Device] port-group-vlan 2 Ethernet 1/0/6

[Device] port-group-vlan 3 Ethernet 1/0/3 to Ethernet 1/0/4

[Device] port-group-vlan 3 Ethernet 1/0/6

[Device] port-group-vlan 4 Ethernet 1/0/5

[Device] port-group-vlan 4 Ethernet 1/0/6

[Device] undo port-group-vlan 1 Ethernet 1/0/1 to Ethernet 1/0/5

# 显示端口组 VLAN 的信息。

<Device> display port-group-vlan all

Port-group-vlan ID: 1

Port-group-group Ports:

Ethernet1/0/6 Ethernet1/0/7 Ethernet1/0/8

Ethernet1/0/9 Ethernet1/0/10 Ethernet1/0/11

Ethernet1/0/12 Ethernet1/0/13 Ethernet1/0/14

Ethernet1/0/15 Ethernet1/0/16 Ethernet1/0/17

Ethernet1/0/18 Ethernet1/0/19 Ethernet1/0/20

Ethernet1/0/21 Ethernet1/0/22 Ethernet1/0/23

Ethernet1/0/24 GigabitEthernet1/0/25 GigabitEthernet1/0/26

Port-group-vlan ID: 2

Port-group-group Ports:

Ethernet1/0/1 Ethernet1/0/2 Ethernet1/0/6

Port-group-vlan ID: 3

Port-group-group Ports:

Ethernet1/0/3 Ethernet1/0/4 Ethernet1/0/6

Port-group-vlan ID: 4

Port-group-group Ports:

Ethernet1/0/5 Ethernet1/0/6
yiluqingshen
131 天前
官方针对“配置基于 VLAN 的端口隔离”的配置文档有缺失,不够详细,看得云里雾里。
有会的朋友 给个具休配置命令吗?
二层。。。。。。我提交换机是二层,再次重申。。。。。

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/1004139

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX