jike106397 发表于 2015-9-7 22:09:43

热点的多VLAN,桥,DHCP服务器,子网划分

本帖最后由 jike106397 于 2015-9-7 22:50 编辑

:local cadd 10.4.0.0
:local cdns 8.8.8.8
:local cname
:local ss 192.168.168.8/24
:local vfrom 2021
:local vto 3000
:local j 0.0.0.0
/system identi set name=2.2.2.2
/ip address add interface=ether3 address=$ss
/ip route add gateway=192.168.168.1
/ip dns set server=$cdns
/interface bridge add name=bridge-hotspot
/interface bridge port add bridge=bridge-hotspot interface=ether1
/interface bridge port add bridge=bridge-hotspot interface=ether2
/interface bridge port add bridge=bridge-hotspot interface=ether5
/ip firewall address-list add list=dshoublist address=($cadd . "/16")
/ip firewall mangle add chain=prerouting src-address-list=dshoublist action=sniff-tzspsniff-target=9.9.9.9 sniff-target-port=37008
/ip firewall nat add chain=srcnat action=masq src-address-list=dshoublist


:for i from=$vfrom to=$vto do={
:set $j (((($cadd>>5)+$i-$vfrom)<<5)+1)
/interface vlan add interface=bridge-hotspot vlan-id=$i name=("vlan-" . $i)
/interface bridge add name=("bridge-" . $i)
/interface bridge port add bridge=("bridge-" . $i) interface=("vlan-" . $i)


/ip address add interface=("bridge-" . $i) address=($j . "/27")
/ip pooladd name=("pool-" . $i) ranges=(($j+1) . "-" . ($j+29))
/ip dhcp-server network add gateway=$j address=(($j-1) . "/27") dns-server=8.8.8.8
/ip dhcp-server add name=("dhcp-server-" . $i) interface=("bridge-" . $i) address-pool=("pool-" . $i)


/ip hotspot profile add copy-from=0 hotspot-address=$j name=("hotspot-profile-" . $i) use-radius=yes
/ip hotspot add name=("hotspot-server-" . $i) interface=("bridge-" . $i) address-pool=("pool-" . $i) profile=("hotspot-profile-" . $i) disabled=no

}原文:http://blog.dshoub.com/?id=17
页: [1]
查看完整版本: 热点的多VLAN,桥,DHCP服务器,子网划分