Re: [问答] 请问如何正确地设定VLAN+DHCP

楼主: zaknafein (zak)   2021-07-22 15:51:41
//router
ip dhcp pool vlan2
network 192.168.2.0 255.255.255.0
default-router 192.168.2.254
dns-server 8.8.8.8
ip dhcp pool vlan3
network 192.168.3.0 255.255.255.0
default-router 192.168.3.254
dns-server 8.8.8.8
ip dhcp pool vlan4
network 192.168.4.0 255.255.255.0
default-router 192.168.4.254
dns-server 8.8.8.8
interface GigabitEthernet0/0
no ip address
duplex auto
speed auto
!
interface GigabitEthernet0/0.2
encapsulation dot1Q 2
ip address 192.168.2.254 255.255.255.0
!
interface GigabitEthernet0/0.3
encapsulation dot1Q 3
ip address 192.168.3.254 255.255.255.0
!
interface GigabitEthernet0/0.4
encapsulation dot1Q 4
ip address 192.168.4.254 255.255.255.0
switch
vlan 2
vlan 3
vlan 4
interface FastEthernet0/1
switchport mode trunk
interface Vlan 2
ip address dhcp
!
interface Vlan3
ip address dhcp
!
interface Vlan4
ip address dhcp
※ 引述《wa007123456 (大笨羊)》之铭言:
: 各位好 先贴一下实体拓朴
: https://imgur.com/s0y5Gzo
: Router组态:
: https://justpaste.it/3klhz
: Switch组态:
: https://justpaste.it/3br89
: 请问要怎么设定出 , 透过Router的DHCP 穿过VLAN后 可以自动指派DHCP
: 另外就是 有了VLAN的电脑 外部网络要如何连入特定节点呢?
: 感谢回答
: 补充一下VLAN的状态:
: https://justpaste.it/3czy7
: Router状态:
: https://justpaste.it/3w7j3
: Trunk状态:
: https://justpaste.it/43sx0
: 作业系统是 : IOS 15
: 路由器是2811
: 交换器是:2960(L2 Switch)
作者: wa007123456 (大笨羊)   2021-07-22 15:54:00
谢谢你^_^我寄1000P给你...我正在学习网络...
楼主: zaknafein (zak)   2021-07-22 15:59:00
这架构是 所谓的 router on a stick网上很多参考 但一般会用 L3 switch 取代 router
作者: wa007123456 (大笨羊)   2021-07-22 16:06:00
感谢大大 我知道ROAS 但是就是一知半解qq不管怎么样 非常感谢你我会努力加油的
作者: birdy590 (Birdy)   2021-07-23 02:16:00
2960 上面应该不需要 L3 设定~ 不然 PC 要干嘛?
楼主: zaknafein (zak)   2021-07-23 06:59:00
用 svi 测试 dhcp 有无成功PC 后续只是指定 access vlan 而已

Links booklink

Contact Us: admin [ a t ] ucptt.com