CISCO 3560配置作为DHCP服务器
生活随笔
收集整理的這篇文章主要介紹了
CISCO 3560配置作为DHCP服务器
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
網絡環境:
一臺3560交換機,劃分三個vlan,vlan2為服務器所在網絡,名為server,IP地址段為192.168.2.0,子網掩碼:255.255.255.0,網關:192.168.2.1,DNS服務器,IP地址為192.168.2.10,vlan3為客戶機1所在網絡,IP地址段為192.168.3.0,子網掩碼:255.255.255.0,網關:192.168.3.1命名為work01,vlan4為客戶機2所在網絡,命名為work02,IP地址段為192.168.4.0,子網掩碼:255.255.255.0,網關:192.168.4.1,3550作DHCP服務器,端口1-8劃到VLAN?2,端口9-16劃分到VLAN?3,端口17-24劃分到VLAN?4.
DHCP服務器實現功能:各VLAN保留2-10的IP地址不分配置,例如:192.168.2.0的網段,保留192.168.2.2至192.168.2.10的IP地址段不分配.
第一步:創建VLAN: Switch>en? Switch#Vlan?Database? Switch(Vlan)#Vlan?2?Name?server? Switch(Vlan)#Vlan?3?Name?work01? Switch(vlan)#Vlan?4?Name?work02? 第二步:設置VLAN?IP地址:? Switch#Config?T? Switch(Config)#Int?Vlan?2? Switch(Config-vlan)#Ip?Address?192.168.2.1?255.255.255.0? Switch(Config-vlan)#No?Shut? Switch(Config-vlan)#Int?Vlan?3? Switch(Config-vlan)#Ip?Address?192.168.3.1?255.255.255.0? Switch(Config-vlan)#No?shut Switch(Config-vlan)#Int?Vlan?4? Switch(Config-vlan)#Ip?Address?192.168.4.1?255.255.255.0? Switch(Config-vlan)#No?Shut? Switch(Config-vlan)#Exit? /*注意:由于此時沒有將端口分配置到VLAN2,3,4,所以各VLAN會DOWN掉,待將端口分配到各VLAN后,VLAN會起來*/?第三步:設置端口全局參數? Switch(Config)#Interface?Range?Fa?0/1?-?24? Switch(Config-if-range)#Switchport?Mode?Access? Switch(Config-if-range)#Spanning-tree?Portfast? 第四步:將端口添加到VLAN2,3,4中?/*將端口1-8添加到VLAN?2*/? Switch(Config)#Interface?Range?Fa?0/1?-?8? Switch(Config-if-range)#Switchport?Access?Vlan?2?/*將端口9-16添加到VLAN?3*/? Switch(Config)#Interface?Range?Fa?0/9?-?16 Switch(Config-if-range)#Switchport?Access?Vlan?3?/*將端口17-24添加到VLAN?4*/? Switch(Config)#Interface?Range?Fa?0/17?-?24? Switch(Config-if-range)#Switchport?Access?Vlan?4? Switch(Config-if-range)#Exit?/*經過這一步后,各VLAN會起來*/? 第五步:配置3550作為DHCP服務器? /*VLAN?2可用地址池和相應參數的配置,有幾個VLAN要設幾個地址池*/? Switch(Config)#Ip?Dhcp?Pool?Test01?/*設置可分配的子網*/? Switch(Config-pool)#Network?192.168.2.0?255.255.255.0?/*設置DNS服務器*/? Switch(Config-pool)#Dns-server?192.168.2.10?/*設置該子網的網關*/? Switch(Config-pool)#Default-router?192.168.2.1?/*配置VLAN?3所用的地址池和相應參數*/? Switch(Config)#Ip?Dhcp?Pool?Test02? Switch(Config-pool)#Network?192.168.3.0?255.255.255.0? Switch(Config-pool)#Dns-server?192.168.2.10? Switch(Config-pool)#Default-router?192.168.3.1?/*配置VLAN?4所用的地址池和相應參數*/? Switch(Config)#Ip?Dhcp?Pool?Test03? Switch(Config-pool)#Network?192.168.4.0?255.255.255.0? Switch(Config-pool)#Dns-server?192.168.2.10? Switch(Config-pool)#Default-router?192.168.4.1? 第六步:設置DHCP保留不分配的地址? Switch(Config)#Ip?Dhcp?Excluded-address?192.168.2.2?192.168.2.10? Switch(Config)#Ip?Dhcp?Excluded-address?192.168.3.2?192.168.3.10? Switch(Config)#Ip?Dhcp?Excluded-address?192.168.4.2?192.168.4.10? 第七步:啟用路由? /*路由啟用后,各VLAN間主機可互相訪問*/? Switch(Config)#Ip?Routing? 第八步:配置訪問控制列表?? Switch(Config)#access-list?103?permit?ip?192.168.2.0?0.0.0.255?192.168.3.0?0.0.0.255? Switch(Config)#access-list?103?permit?ip?192.168.3.0?0.0.0.255?192.168.2.0?0.0.0.255? Switch(Config)#access-list?103?permit?udp?any?any?eq?bootpc? Switch(Config)#access-list?103?permit?udp?any?any?eq?tftp? Switch(Config)#access-list?103?permit?udp?any?eq?bootpc?any?Switch(Config)access-list?103?permit?udp?any?eq?tftp?any? Switch(Config)#access-list?104?permit?ip?192.168.2.0?0.0.0.255?192.168.4.0?0.0.0.255? Switch(Config)#access-list?104?permit?ip?192.168.4.0?0.0.0.255?192.168.2.0?0.0.0.255 Switch(Config)#access-list?104?permit?udp?any?eq?tftp?any? Switch(Config)#access-list?104?permit?udp?any?eq?bootpc?any? Switch(Config)#access-list?104?permit?udp?any?eq?bootpc?any? Switch(Config)#access-list?104?permit?udp?any?eq?tftp?any? 第九步:應用訪問控制列表? /*將訪問控制列表應用到VLAN?3和VLAN?4,VLAN?2不需要*/? Switch(Config)#Int?Vlan?3? Switch(Config-vlan)#ip?access-group?103?out?Switch(Config-vlan)Int?Vlan?4? Switch(Config-vlan)#ip?access-group?104?out? 第十步:結束并保存配置?Switch(Config-vlan)End?Switch#Copy?Run?Start轉載于:https://blog.51cto.com/zhuqianwei/1544796
總結
以上是生活随笔為你收集整理的CISCO 3560配置作为DHCP服务器的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 编译内核,busybox,dropbea
- 下一篇: 图像处理之基础---傅里叶