客戶的需求:企業(yè)通過(guò)Switch實(shí)現(xiàn)各個(gè)部門之間的互連,且各個(gè)部門加入不同的VLAN。總裁辦公室和文件備份服務(wù)器采取手工方式分配已經(jīng)獲取到固定IP地址,員工網(wǎng)絡(luò)通過(guò)DHCP方式獲取IP地址。由于員工網(wǎng)絡(luò)擁有訪問(wèn)外網(wǎng)的權(quán)利,主機(jī)經(jīng)常會(huì)感染ARP病毒,攻擊Switch并修改Switch上的動(dòng)態(tài)ARP表項(xiàng),造成總經(jīng)理辦公室與外界的通信中斷以及不能正常訪問(wèn)文件備份服務(wù)器。公司希望在Switch上配置靜態(tài)ARP表項(xiàng),以保證總經(jīng)理辦公室與外界的通信安全,并保證各個(gè)部門能正常訪問(wèn)文件備份服務(wù)器。
直接上dis cu后的命令--------
Switch配置文件
#
sysname Switch
#
vlan batch 10 20 30 100 200
#
dhcp enable
#
acl number 2001 //建立基礎(chǔ)規(guī)則2001
rule 5 deny source 192.168.10.0 0.0.0.255 //禁止服務(wù)器上公網(wǎng)
#
interface Vlanif10
ip address 192.168.1.1 255.255.255.0
#
interface Vlanif20
ip address 192.168.2.1 255.255.255.0
dhcp select interface
dhcp server excluded-ip-address 192.168.2.2 192.168.2.99 //調(diào)整DHCP的IP地址池
dhcp server excluded-ip-address 192.168.2.101 192.168.2.254
#
interface Vlanif30
ip address 192.168.3.1 255.255.255.0
#
interface Vlanif100
ip address 192.168.10.1 255.255.255.0
#
interface Vlanif200
ip address 192.168.20.1 255.255.255.0
#
interface GigabitEthernet0/0/1
port link-type access
port default vlan 10
#
interface GigabitEthernet0/0/2
port link-type access
port default vlan 100
#
interface GigabitEthernet0/0/3 //在G0/0/3端口上應(yīng)用ACL規(guī)則
port link-type access
port default vlan 200
traffic-filter outbound acl 2001
#
interface GigabitEthernet0/0/4
port link-type access
port default vlan 20
#
arp static 192.168.1.8 5489-98cb-56cc vid 10 interface GigabitEthernet0/0/1 //ARP靜態(tài)綁定總經(jīng)理辦公室PC
arp static 192.168.10.10 5489-98da-7202 vid 100 interface GigabitEthernet0/0/2 //ARP靜態(tài)綁定 文件備份服務(wù)器
#
ip route-static 0.0.0.0 0.0.0.0 192.168.20.2 //缺省靜態(tài)路由
#
Router配置文件
#
interface GigabitEthernet0/0/0
ip address 192.168.20.2 255.255.255.0
#
interface GigabitEthernet0/0/1
ip address 200.0.0.1 255.255.255.0
#
ip route-static 0.0.0.0 0.0.0.0 200.0.0.2 //配置缺省路由
ip route-static 192.168.0.0 255.255.0.0 192.168.20.1 //配置回程路由
#
測(cè)試結(jié)果
1、員工網(wǎng)絡(luò)DHCP到IP地址不在(192.168.2.2—192.168.2.99)&(192.168.2.101—192.168.2.254)區(qū)間內(nèi)
2、靜態(tài)ARP表項(xiàng)
3、員工網(wǎng)絡(luò)能上外網(wǎng)
4、文件備份服務(wù)器不能上外網(wǎng),ping公網(wǎng)失敗