interface Vlanif100
ip address 192.168.100.254 255.255.255.0
ip pool MGMT
gateway-list 192.168.100.254
network 192.168.100.0 mask 255.255.255.0
option 43 sub-option 2 ip-address 192.168.100.254
#
dhcp enable
#
interface Vlanif100
dhcp select global
capwap source interface vlan 100
以下命令在 WLAN 下配置
ap auth-mode mac-auth //ap的默认认证模式,可以改为无需认证
ap-id 1 ap-mac 00e0-fcfb-10e0
ap auth-mode no-auth//ap的默认认证模式,可以改为无需认证
ssid-profile name staff
ssid staff
security-profile name staff
security wpa-wpa2 psk password a1234567 aes
vap-profile name staff
service-vlan vlan-id 2(设置STA的IP所属的VLAN)
forward-mode direct-forward(默认)
ssid-profile staff
security-profile staff
ap-group name all
ap-id 1
ap-group all
ap-group name all
vap-profile staff wlan 1 radio all
ip pool vlan 2
gateway-list 192.168.2.254
network 192.168.2.0 mask 255.255.255.0
dhcp enable
interface Vlanif2
dhcp select global
firewall zone trust
add interface GigabitEthernet0/0/0
#
firewall zone untrust
add interface GigabitEthernet0/0/1
ospf 1
default-route-advertise always
area 0.0.0.0
network 192.168.1.2 0.0.0.0
ospf 1
area 0.0.0.0
network 192.168.1.1 0.0.0.0
network 192.168.2.0 0.0.0.255
network 192.168.3.0 0.0.0.255
firewall packet-filter default permit all
nat-policy interzone trust untrust outbound
policy 1
action source-nat
policy source 192.168.0.0 mask 16
easy-ip GigabitEthernet0/0/1
acl number 2000
rule 5 permit 192.168.0.0 mask 16
#
int g0/0/1
nat outbound
ip route-static 0.0.0.0 0.0.0.0 100.64.0.2
AC配置WEB页面的IP地址
interface Vlanif1
ip address 10.8.2.1 255.255.255.0
AC配置出接口类型
interface g0/0/2
port link-type access
port default vlan 1
本地网卡配置相同网段(本机使用环回口)
http secure-server enable
aaa
local-user admin password irreversible-cipher admin@123
local-user admin privilege level 15
local-user admin service-type http
1 在网络已经打通的情况下(直连转发模式),先将AP的认证方式改为不认证
2 将以这种方式认证的AP的组从“default”移入到已有配置的“all”
3 再将认证模式改为mac,防止后续非客户ap的接入
不再展示
注:MGMT-VLAN即管理VLAN为VLAN 100,PC的VLAN为VLAN 2
隧道转发的封装我们图中简化了,具体的封装如下,原理类似GRE VPN不赘述
注:三层隔离的意思就是
缺陷:需要在物理口上一个一个过滤,如果新加接口又得重新添加过滤,不灵活
#
acl number 3000
rule 5 deny ip source 192.168.3.0 0.0.0.255 destination 192.168.2.0 0.0.0.255
#
#
interface GigabitEthernet0/0/2
traffic-filter inbound acl 2000
#
缺陷:需要匹配源目地址,当需要增加员工的地址时,需要添加新的ACL来过滤,不灵活
#
acl number 3000
rule 5 deny ip source 192.168.3.0 0.0.0.255 destination 192.168.2.0 0.0.0.255
#
traffic-filter vlan 4 inbound acl 3000
#
优势:只需要匹配源IP地址,在员工的地址增加时,不需要额外的配置也能实现三层的隔离;
#
acl number 2000
rule 5 permit source 192.168.2.0 0.0.0.255
#
traffic classifier a operator and
if-match acl 2000
#
traffic behavior a
redirect ip-nexthop 12.12.12.1
#
traffic policy a
classifier a behavior a
#
traffic-policy a global inbound
可以通过远程登录到拥有公网IP的设备上,然后使用这个设备再远程登录到其内网的设备上;
在接收到AC配置前
AP相当于是一个开启了DHCP自动获取的PC
在接收到AC配置后
AP相当于一个交换机,上联口为Trunk,下联STA的接口为Access(STA连接哪个Wifi对应哪个Service VLAN,也就是Access的Default VLAN)
注:STA就是连接AP发出无线型号的笔记本电脑