一、实验环境
公司最近新租赁了写字楼,领导要求一定要好好规划网络,整理IP地址
二、实验需求
1、财务部有几台服务器,IP地址不能变,分别是:
192.168.0.143
192.168.0.144
192.168.0.145
192.168.0.146
因此,我们需要给财务找个网段,把上面的IP包含进去,但是范围还不能太大。研究之后决定给财务:192.168.0.140/27 这个网段。
实际就是:
财务部IP范围:192.168.0.129 到 192.168.0.158
子掩码是:255.255.255.224
网关:192.168.0.140
2、按照部门划分vlan,除了财务部20台终端左右,其他部门最多不超过50台。
vlanID | 区域 | vip | 子掩码 | IP范围 | 主机数量 |
---|
VLAN11 | 财务部 | 192.168.0.129 | 255.255.255.224 | 192.168.0.129 到 192.168.0.158 | 30 |
VLAN12 | 管理层 | 192.168.12.1 | 255.255.255.192 | 192.168.12.1 到 192.168.12.62 | 62 |
VLAN13 | 行政部 | 192.168.13.1 | 255.255.255.192 | 192.168.13.1 到 192.168.13.62 | 62 |
VLAN14 | 市场部 | 192.168.14.1 | 255.255.255.192 | 192.168.14.1 到 192.168.14.62 | 62 |
VLAN15 | 工程/运检 | 192.168.15.1 | 255.255.255.192 | 192.168.15.1 到 192.168.15.62 | 62 |
VLAN16 | 研发 | 192.168.16.1 | 255.255.255.192 | 192.168.16.1 到 192.168.16.62 | 62 |
VLAN17 | 预留 | —— | —— | —— | —— |
VLAN18 | 预留 | —— | —— | —— | —— |
VLAN19 | 预留 | —— | —— | —— | —— |
VLAN20 | 全公司移动端 | 192.168.20.1 | 255.255.255.192 | 192.168.20.1 到 192.168.20.62 | 62 |
三、SW核心交换机vlan配置
创建需要的vlan
un in en
vlan batch 11 12 13 14 15 16 99
q
将接口划分到相应的vlan
interface GigabitEthernet0/0/1port link-type accessport default vlan 11
qinterface GigabitEthernet0/0/2port link-type accessport default vlan 12
qinterface GigabitEthernet0/0/3port link-type accessport default vlan 13
qinterface GigabitEthernet0/0/4port link-type accessport default vlan 14
qinterface GigabitEthernet0/0/5port link-type accessport default vlan 15
qinterface GigabitEthernet0/0/6port link-type accessport default vlan 16
qinterface GigabitEthernet0/0/24port link-type accessport default vlan 99
q
配置vlanIP
interface Vlanif11
ip address 192.168.0.1 255.255.255.0
qinterface Vlanif12ip address 192.168.12.1 255.255.255.192
qinterface Vlanif13ip address 192.168.13.1 255.255.255.192
qinterface Vlanif14ip address 192.168.14.1 255.255.255.192
qinterface Vlanif15
ip address 192.168.15.1 255.255.255.192
qinterface Vlanif16
ip address 192.168.16.1 255.255.255.192
qinterface Vlanif99
ip address 192.168.99.99 255.255.255.192
q
配置完,可以用下面的命令查看确认。
dis ip in b
四、R1路由器DHCP配置
开启DHCP
[R1]un in en
dhcp enable
interface GigabitEthernet0/0/2ip address 192.168.99.254 255.255.255.0 dhcp select globalq
加入回执路由
ip route-static 0.0.0.0 0 192.168.99.99
创建各个vlan的地址池
vlan99不用创建,vlan99我们不开启DHCP
ip pool vlan11 gateway-list 192.168.0.129 network 192.168.0.129 mask 255.255.255.224 dns-list 114.114.114.114
qip pool vlan12gateway-list 192.168.12.1 network 192.168.12.0 mask 255.255.255.192 dns-list 114.114.114.114
qip pool vlan13gateway-list 192.168.13.1 network 192.168.3.0 mask 255.255.255.192 dns-list 114.114.114.114
qip pool vlan14gateway-list 192.168.14.1 network 192.168.4.0 mask 255.255.255.192 dns-list 114.114.114.114
qip pool vlan15gateway-list 192.168.15.1 network 192.168.5.0 mask 255.255.255.192 dns-list 114.114.114.114
qip pool vlan116gateway-list 192.168.16.1 network 192.168.6.0 mask 255.255.255.192 dns-list 114.114.114.114
q
配置完可以使用下面的命令查看一下有没有问题。
dis ip pool
五、SW1核心交换机上配置DHCP中继
dhcp enableinterface Vlanif11
dhcp select relay
dhcp relay server-ip 192.168.99.254
qinterface Vlanif12
dhcp select relay
dhcp relay server-ip 192.168.99.254
qinterface Vlanif13
dhcp select relay
dhcp relay server-ip 192.168.99.254
qinterface Vlanif14
dhcp select relay
dhcp relay server-ip 192.168.99.254
qinterface Vlanif15
dhcp select relay
dhcp relay server-ip 192.168.99.254
qinterface Vlanif16
dhcp select relay
dhcp relay server-ip 192.168.99.254
q