一台dhcp服务器怎么给不同的vlan分配网段ip
答案:1 悬赏:10 手机版
解决时间 2021-01-24 16:48
- 提问者网友:聂風
- 2021-01-23 17:59
一台dhcp服务器怎么给不同的vlan分配网段ip
最佳答案
- 五星知识达人网友:渊鱼
- 2021-01-23 18:52
interface FastEthernet0/2(将端口f0/2划分入vlan2)
switchport access vlan 2
switchport mode access
no ip address
!
interface FastEthernet0/3(将端口f0/3划分入vlan3)
switchport access vlan 3
switchport mode access
no ip address
......
interface Vlan1
ip address 192.168.1.2 255.255.255.0
ip helper-address 192.168.1.1 (将DHCP请求的广播数据包转化为单播请求,路由器才会响应)
!
interface Vlan2
ip address 10.0.2.1 255.255.255.0
ip helper-address 192.168.1.1
!
interface Vlan3
ip address 192.168.3.1 255.255.255.0
ip helper-address 192.168.1.1
路由器上的配置:
ip dhcp pool tyl-01(配置第一个VLAN的地址池)
network 192.168.1.0 255.255.255.0
default-router 192.168.1.1 (配置PC网关)
dns-server 202.96.134.133(配置DNS服务器)
ip dhcp pool tyl-02(配置第二个VLAN的地址池)
network 10.0.2.0 255.255.255.0
default-router 10.0.2.1
dns-server 202.96.134.133
ip dhcp pool tyl-03(配置第三个VLAN的地址池)
network 192.168.3.0 255.255.255.0
default-router 192.168.3.1
dns-server 202.96.134.133
ip route 10.0.2.0 255.255.255.0 192.168.1.2(配置静态路由)
ip route 192.168.3.0 255.255.255.0 192.168.1.2
ip dhcp excluded-address 192.168.1.1 192.168.1.2 (将路由器F0/0和VLAN1的IP 地址排除)
ip dhcp excluded-address 192.168.2.1 (3550 VLAN1的IP 地址排除)
ip dhcp excluded-address 192.168.3.1 (3550 VLAN1的IP 地址排除)
switchport access vlan 2
switchport mode access
no ip address
!
interface FastEthernet0/3(将端口f0/3划分入vlan3)
switchport access vlan 3
switchport mode access
no ip address
......
interface Vlan1
ip address 192.168.1.2 255.255.255.0
ip helper-address 192.168.1.1 (将DHCP请求的广播数据包转化为单播请求,路由器才会响应)
!
interface Vlan2
ip address 10.0.2.1 255.255.255.0
ip helper-address 192.168.1.1
!
interface Vlan3
ip address 192.168.3.1 255.255.255.0
ip helper-address 192.168.1.1
路由器上的配置:
ip dhcp pool tyl-01(配置第一个VLAN的地址池)
network 192.168.1.0 255.255.255.0
default-router 192.168.1.1 (配置PC网关)
dns-server 202.96.134.133(配置DNS服务器)
ip dhcp pool tyl-02(配置第二个VLAN的地址池)
network 10.0.2.0 255.255.255.0
default-router 10.0.2.1
dns-server 202.96.134.133
ip dhcp pool tyl-03(配置第三个VLAN的地址池)
network 192.168.3.0 255.255.255.0
default-router 192.168.3.1
dns-server 202.96.134.133
ip route 10.0.2.0 255.255.255.0 192.168.1.2(配置静态路由)
ip route 192.168.3.0 255.255.255.0 192.168.1.2
ip dhcp excluded-address 192.168.1.1 192.168.1.2 (将路由器F0/0和VLAN1的IP 地址排除)
ip dhcp excluded-address 192.168.2.1 (3550 VLAN1的IP 地址排除)
ip dhcp excluded-address 192.168.3.1 (3550 VLAN1的IP 地址排除)
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯