设为首页收藏本站language 语言切换
查看: 1261|回复: 6
收起左侧

[求助] 网络小白

[复制链接]
发表于 2017-3-21 22:36:00 | 显示全部楼层 |阅读模式
3鸿鹄币
本帖最后由 我想静静 于 2017-3-21 22:47 编辑

环境:三层交换机---两层交换机---客户端,
三层交换机信息如下:
请问是基于接口划的vlan吗?还有就是我可以把IP 192.168.5.40/24划到1.1的网关里去吗????   都说小白请教要虔诚,
不多说了,一万个谢谢...

Name: Gi1/0/5
Switchport: Enabled
Administrative Mode: trunk
Operational Mode: trunk
Administrative Trunking Encapsulation: dot1q
Operational Trunking Encapsulation: dot1q
Negotiation of Trunking: On
Access Mode VLAN: 1 (default)
Trunking Native Mode VLAN: 12 (VLAN0012)
Administrative Native VLAN tagging: enabled
Voice VLAN: none
Administrative private-vlan host-association: none
Administrative private-vlan mapping: none
Administrative private-vlan trunk native VLAN: none
Administrative private-vlan trunk Native VLAN tagging: enabled
Administrative private-vlan trunk encapsulation: dot1q
Administrative private-vlan trunk normal VLANs: none
Administrative private-vlan trunk associations: none
Administrative private-vlan trunk mappings: none
Operational private-vlan: none
Trunking VLANs Enabled: ALL
Pruning VLANs Enabled: 2-1001
Capture Mode Disabled
Capture VLANs Allowed: ALL


Vlan10 is up, line protocol is up
  Internet address is 192.168.0.1/24
Vlan11 is up, line protocol is up
  Internet address is 192.168.1.1/24
Vlan12 is up, line protocol is up
  Internet address is 192.168.2.1/24   
Vlan13 is up, line protocol is up
  Internet address is 192.168.3.1/24  
Vlan14 is up, line protocol is up   
  Internet address is 192.168.4.1/24   
Vlan15 is up, line protocol is up
  Internet address is 192.168.5.1/24   
Vlan16 is up, line protocol is up
  Internet address is 192.168.6.1/24   
Vlan17 is up, line protocol is up
  Internet address is 192.168.7.1/24

最佳答案

查看完整内容

交换机的默认vlan是1,默认模式vlan1 是不打标签的,交换机内部通信会查看pvid也就是端口vlan id看端口属于哪个vlan,同vlan通信。而trunk模式的native vlan 和这个默认vlan是一样的 不打标签,你交换机access口 vlan12的口 从这个trunk口出去之后不会带上vlan 12的标签 。而且有个误区要搞清楚:为啥同一个交换机上 acess模式下 不同的vlan间不能通信 不是因为打了标签,而是因为pvid,只有经过trunk口出去才会封装 才会带上tag ...
发表于 2017-3-21 22:36:01 | 显示全部楼层
我想静静 发表于 2017-3-23 15:01
1、不是这样的,我是想把(Vlan15 is up, line protocol is up Internet address is 192.168.5.1/24 )5 ...

交换机的默认vlan是1,默认模式vlan1 是不打标签的,交换机内部通信会查看pvid也就是端口vlan id看端口属于哪个vlan,同vlan通信。而trunk模式的native vlan 和这个默认vlan是一样的 不打标签,你交换机access口 vlan12的口 从这个trunk口出去之后不会带上vlan 12的标签 。而且有个误区要搞清楚:为啥同一个交换机上 acess模式下 不同的vlan间不能通信 不是因为打了标签,而是因为pvid,只有经过trunk口出去才会封装 才会带上tag,切记,新手很容易被这个问题搞糊涂。
沙发 2017-3-21 22:36:01 回复 收起回复
回复

使用道具 举报

发表于 2017-3-22 07:58:12 | 显示全部楼层
192.168.5.40在VLAN 15上
192.168.1.1在VLAN 11上
因为这些IP地址在不同的VLAN,您不能分配192.168.1.1作为192.168.5.40的网关。
板凳 2017-3-22 07:58:12 回复 收起回复
回复

使用道具 举报

发表于 2017-3-22 10:13:11 | 显示全部楼层
做规划首先就要弄清楚你要实现什么功能,目前你的需求不是很清晰,暂理解为一个vlan一个段,客户端192.168.5.40要用1.1做网关。首先看到你有native vlan 12 这个不算错 但是你要保证 对端的所有二层交换机都需要。而你下面的配置 是所有vlan的虚拟接口都开启来了,如果你要实现基于接口的vlan子接口  你可以看下路由的单臂路由配置。至于5.40用1.1做网关 我可以理解为你想让两个段互相通信吗,如果是这样 单臂路由本身就能让网段互通。在公司网络环境中,在三层上还可以做dhcp之类,如果你出口已经有一个普通的拨号路由了,你只需在三层交换机上 和出口路由上各指一条静态路由就OK  nat  默认路由 出口拨号设备都默认设置了的
地板 2017-3-22 10:13:11 回复 收起回复
回复

使用道具 举报

 楼主| 发表于 2017-3-23 15:01:28 | 显示全部楼层
erxing 发表于 2017-3-22 10:13
做规划首先就要弄清楚你要实现什么功能,目前你的需求不是很清晰,暂理解为一个vlan一个段,客户端192.168. ...

1、不是这样的,我是想把(Vlan15 is up, line protocol is up Internet address is 192.168.5.1/24 )5网段地址中的一个5.40IP划到1网段中去。
2、Name: Gi1/0/17
Switchport: Enabled
Administrative Mode: trunk
Operational Mode: down
Administrative Trunking Encapsulation: dot1q
Negotiation of Trunking: On
Access Mode VLAN: 1 (default)
Trunking Native Mode VLAN: 12 (VLAN0012)
Administrative Native VLAN tagging: enabled
Voice VLAN: none
Administrative private-vlan host-association: none
Administrative private-vlan mapping: none
Administrative private-vlan trunk native VLAN: none
Administrative private-vlan trunk Native VLAN tagging: enabled
Administrative private-vlan trunk encapsulation: dot1q
Administrative private-vlan trunk normal VLANs: none
Administrative private-vlan trunk associations: none
Administrative private-vlan trunk mappings: none
Operational private-vlan: none
Trunking VLANs Enabled: ALL
Pruning VLANs Enabled: 2-1001
Capture Mode Disabled
Capture VLANs Allowed: ALL

Protected: false
Unknown unicast blocked: disabled
Unknown multicast blocked: disabled
Appliance trust: none

Name: Gi1/0/18
Switchport: Enabled
Administrative Mode: trunk
Operational Mode: down
Administrative Trunking Encapsulation: dot1q
Negotiation of Trunking: On
Access Mode VLAN: 1 (default)
Trunking Native Mode VLAN: 12 (VLAN0012)
Administrative Native VLAN tagging: enabled
Voice VLAN: none
Administrative private-vlan host-association: none
Administrative private-vlan mapping: none
Administrative private-vlan trunk native VLAN: none
Administrative private-vlan trunk Native VLAN tagging: enabled
Administrative private-vlan trunk encapsulation: dot1q
Administrative private-vlan trunk normal VLANs: none
Administrative private-vlan trunk associations: none
Administrative private-vlan trunk mappings: none
Operational private-vlan: none
Trunking VLANs Enabled: ALL
Pruning VLANs Enabled: 2-1001
Capture Mode Disabled
Capture VLANs Allowed: ALL

Protected: false
Unknown unicast blocked: disabled
Unknown multicast blocked: disabled
Appliance trust: none
上面的输出中Access Mode VLAN: 1 (default) ;Trunking Native Mode VLAN: 12 (VLAN0012)
怎么理解?接口Gi1/0/17是属于哪个vlan?谢谢。
5# 2017-3-23 15:01:28 回复 收起回复
回复

使用道具 举报

发表于 2017-3-23 17:55:53 | 显示全部楼层
我想静静 发表于 2017-3-23 15:01
1、不是这样的,我是想把(Vlan15 is up, line protocol is up Internet address is 192.168.5.1/24 )5 ...

5.40划到192.168.1.1中去,如果在虚拟vlan接口都是在同一接口下 这样直接弄是不行的,你这台主机不能变成1网段的吗?你把接这台主机的接口vlan改了 就可以啊 。你的最终目的是要实现什么  不明白单独弄个5.40到1网段中时什么意思
6# 2017-3-23 17:55:53 回复 收起回复
回复

使用道具 举报

 楼主| 发表于 2017-3-25 23:33:39 | 显示全部楼层
erxing 发表于 2017-3-23 17:50
交换机的默认vlan是1,默认模式vlan1 是不打标签的,交换机内部通信会查看pvid也就是端口vlan id看端口属 ...

首先,谢谢你!
1、根据你的回答,我还是没有明白Trunking Native Mode VLAN: 12 (VLAN0012)这个到底怎么理解。
我现在的理解是:拿接口gi1/0/17来说,接口模式是中继链路。Access Mode VLAN: 1 (default)是指17接口属于vlan1;Trunking Native Mode VLAN: 12 (VLAN0012)是指接口17如果收到不带tag的帧时,它会把帧直接转到vlan12所在的接口上面去。不知道对不对???
2、我查了我的核心交换机,发现上面除了有Trunking Native Mode VLAN: 12 (VLAN0012),还有Trunking Native Mode VLAN: 1 (default)、Trunking Native Mode VLAN: 11 (vlan0011),这是什么原因啊?按理说native vlan (本征vlan)不是只有一个嘛?而且我的vlan1 已经被关掉了:Vlan1 is administratively down, line protocol is down。
3、我把5.40划到1.1网段中去是因为一网段有Linux机器,这样子才可以通信互访。你说的我的这台主机变成一网段,好像不可以。我的拓扑是核心交换机---两层交换机---PC,核心交换机划的网段,一个楼层一个独立的网段,我观察上面的配置猜测应该是基于端口划的vlan,一个端口一个vlan,然后从那个端口出来接到楼层的两层交换机。不知道你可以判断出它是怎么划的Vlan吗???回答是请注意标点符号,十分感谢。。。
详情如下:
Global values:
  Internet Protocol routing is enabled
Vlan1 is administratively down, line protocol is down
Vlan10 is up, line protocol is up
  Internet address is 192.168.0.1/24
Vlan11 is up, line protocol is up
  Internet address is 192.168.1.1/24
Vlan12 is up, line protocol is up
  Internet address is 192.168.2.1/24   
Vlan13 is up, line protocol is up
  Internet address is 192.168.3.1/24   
Vlan14 is up, line protocol is up   
  Internet address is 192.168.4.1/24   
Vlan15 is up, line protocol is up
  Internet address is 192.168.5.1/24   
Vlan16 is up, line protocol is up
  Internet address is 192.168.6.1/24   
Vlan17 is up, line protocol is up
  Internet address is 192.168.7.1/24   
Name: Gi1/0/2
Switchport: Enabled
Administrative Mode: trunk
Operational Mode: trunk
Administrative Trunking Encapsulation: dot1q
Operational Trunking Encapsulation: dot1q
Negotiation of Trunking: On
Access Mode VLAN: 1 (default)
Trunking Native Mode VLAN: 14 (VLAN0014)
Administrative Native VLAN tagging: enabled
Voice VLAN: none
Administrative private-vlan host-association: none
Administrative private-vlan mapping: none
Administrative private-vlan trunk native VLAN: none
Administrative private-vlan trunk Native VLAN tagging: enabled
Administrative private-vlan trunk encapsulation: dot1q
Administrative private-vlan trunk normal VLANs: none
Administrative private-vlan trunk associations: none
Administrative private-vlan trunk mappings: none
Operational private-vlan: none
Trunking VLANs Enabled: ALL
Pruning VLANs Enabled: 2-1001
Capture Mode Disabled
Capture VLANs Allowed: ALL

Protected: false
Unknown unicast blocked: disabled
Unknown multicast blocked: disabled
Appliance trust: none

Name: Gi1/0/3
Switchport: Enabled
Administrative Mode: trunk
Operational Mode: trunk
Administrative Trunking Encapsulation: dot1q
Operational Trunking Encapsulation: dot1q
Negotiation of Trunking: On
Access Mode VLAN: 1 (default)
Trunking Native Mode VLAN: 15 (VLAN0015)
Administrative Native VLAN tagging: enabled
Voice VLAN: none
Administrative private-vlan host-association: none
Administrative private-vlan mapping: none
Administrative private-vlan trunk native VLAN: none
Administrative private-vlan trunk Native VLAN tagging: enabled
Administrative private-vlan trunk encapsulation: dot1q
Administrative private-vlan trunk normal VLANs: none
Administrative private-vlan trunk associations: none
Administrative private-vlan trunk mappings: none
Operational private-vlan: none
Trunking VLANs Enabled: ALL
Pruning VLANs Enabled: 2-1001
Capture Mode Disabled
Capture VLANs Allowed: ALL

Protected: false
Unknown unicast blocked: disabled
Unknown multicast blocked: disabled
Appliance trust: none

Name: Gi1/0/4
Switchport: Enabled
Administrative Mode: trunk
Operational Mode: trunk
Administrative Trunking Encapsulation: dot1q
Operational Trunking Encapsulation: dot1q
Negotiation of Trunking: On
Access Mode VLAN: 1 (default)
Trunking Native Mode VLAN: 16 (VLAN0016)
Administrative Native VLAN tagging: enabled
Voice VLAN: none
Administrative private-vlan host-association: none
Administrative private-vlan mapping: none
Administrative private-vlan trunk native VLAN: none
Administrative private-vlan trunk Native VLAN tagging: enabled
Administrative private-vlan trunk encapsulation: dot1q
Administrative private-vlan trunk normal VLANs: none
Administrative private-vlan trunk associations: none
Administrative private-vlan trunk mappings: none
Operational private-vlan: none
Trunking VLANs Enabled: ALL
Pruning VLANs Enabled: 2-1001
Capture Mode Disabled
Capture VLANs Allowed: ALL

Protected: false
Unknown unicast blocked: disabled
Unknown multicast blocked: disabled
Appliance trust: none
7# 2017-3-25 23:33:39 回复 收起回复
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 论坛注册

本版积分规则

QQ|Archiver|手机版|小黑屋|sitemap|鸿鹄论坛 ( 京ICP备14027439号 )  

GMT+8, 2025-2-7 15:56 , Processed in 0.059430 second(s), 13 queries , Redis On.  

  Powered by Discuz!

  © 2001-2025 HH010.COM

快速回复 返回顶部 返回列表