首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >VLAN下的IP如何与其他VLAN的IP通信?

VLAN下的IP如何与其他VLAN的IP通信?
EN

Network Engineering用户
提问于 2019-05-29 12:14:10
回答 2查看 161关注 0票数 0

我有一个网络拓扑如下:

我想使用Server0来管理(通信)到10.10.10.1-3

你知道10.10.10.1-3是vlan100 100‘S SVI。

vlan 100vlan 501

知识产权方案:

代码语言:javascript
复制
vlan 100(10.10.10.0/24) 
vlan 501(10.50.1.0/24)

服务器的IP是10.10.10.5,但如果它也可以是10.50.1.*/24的话。(我的意思是,我只希望Server0能够管理10.10.10.0/24)

如何认识到这一点?

配置如下:

Switch0:

代码语言:javascript
复制
Switch#show running-config 
Building configuration...

Current configuration : 1427 bytes
!
version 12.2(37)SE1
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname Switch

!
spanning-tree mode pvst
!
!
!
!
!
!
interface FastEthernet0/1
...
interface FastEthernet0/24
!
interface GigabitEthernet0/1
 switchport trunk encapsulation dot1q
 switchport mode trunk
!
interface GigabitEthernet0/2
 switchport trunk encapsulation dot1q
 switchport mode trunk
!
interface Vlan1
 no ip address
 shutdown
!
interface Vlan100
 mac-address 0005.5ed1.7601
 ip address 10.10.10.1 255.255.255.0
!
interface Vlan501
 mac-address 0005.5ed1.7602
 ip address 10.50.1.254 255.255.255.0
!
ip classless
!
ip flow-export version 9
!
!
!
!
!
!
!
!
line con 0
!
line aux 0
!
line vty 0 4
 login
!
!
!
!
end

Switch1:

代码语言:javascript
复制
Switch#show running-config 
Building configuration...

Current configuration : 1341 bytes
!
version 12.2(37)SE1
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname Switch
!

!
spanning-tree mode pvst
!
!
!
!
!
!
interface FastEthernet0/1
...
interface FastEthernet0/24
!
interface GigabitEthernet0/1
 switchport trunk encapsulation dot1q
 switchport mode trunk
!
interface GigabitEthernet0/2
 switchport trunk encapsulation dot1q
 switchport mode trunk
!
interface Vlan1
 no ip address
 shutdown
!
interface Vlan100
 mac-address 00d0.ff83.b201
 ip address 10.10.10.2 255.255.255.0
!
ip classless
!
ip flow-export version 9
!
!
!
!
!
!
!
!
line con 0
!
line aux 0
!
line vty 0 4
 login
!
!
!
!
end

Switch2:

代码语言:javascript
复制
Switch#show running-config 
Building configuration...

Current configuration : 1459 bytes
!
version 12.2(37)SE1
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname Switch
!
!
spanning-tree mode pvst
!
!
!
!
!
!
interface FastEthernet0/1
 switchport access vlan 501
!
interface FastEthernet0/2
...
!
interface FastEthernet0/24
!
interface GigabitEthernet0/1
 switchport trunk encapsulation dot1q
 switchport mode trunk
!
interface GigabitEthernet0/2
 switchport access vlan 501
 switchport trunk encapsulation dot1q
 switchport mode access
 switchport nonegotiate
!
interface Vlan1
 no ip address
 shutdown
!
interface Vlan100
 mac-address 0002.179a.3701
 ip address 10.10.10.3 255.255.255.0
!
ip classless
ip route 0.0.0.0 0.0.0.0 10.10.10.1 
!
ip flow-export version 9
!
!
!
line con 0
!
line aux 0
!
line vty 0 4
 login
!
!
!
!
end

所有的开关都有vlan 100vlan 501

编辑-01

我已将服务器的IP更改为10.50.1.5/24。但我不知道如何为SVI添加网关。

Vlanif中的命令似乎没有用于添加网关的参数:

代码语言:javascript
复制
Switch(config-if)#ip address 10.10.10.2 255.255.255.0 ?
<cr>

我的目的是让服务器管理(与10.10.10.0/24通信)。

EN

回答 2

Network Engineering用户

发布于 2019-05-29 12:28:07

服务器地址必须是它所配置的子网的一部分。因为您在VLAN 501上有服务器,所以它的IP地址必须在10.50.1.0/24子网中,而不是按照您配置的那样。

将服务器的默认网关设置为VLAN 501: 10.50.1.254上的SVI。

交换机1还需要将网关设置为Sw0上的SVI : 10.10.10.1,方式与Sw2相同。

票数 4
EN

Network Engineering用户

发布于 2019-05-31 11:17:21

如果要使用Server0与10.10.10.0/24通信,则应满足以下条件:

  1. Switch0,Switch1,Switch2都应该拥有vlan 100vlan 501
  2. Switch0有两个SVI:vlanif-100: 10.10.10.1/24vlanif-501: 10.50.1.254/24
  3. 我假设Server0 0‘S IP是10.50.1.5
  4. 然后10.50.1.5可以与10.10.10.1通信,因为Switch0本身就有SVI。
  5. 如果要与其他交换机通信,则应在交换机中写入静态路由。ip route 10.50.1.5 255.255.255.255 10.10.10.1
票数 0
EN
页面原文内容由Network Engineering提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://networkengineering.stackexchange.com/questions/59478

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档