码迷,mamicode.com
首页 > 系统相关 > 详细

kali linux虚拟wifi搭建

时间:2015-07-05 16:56:55      阅读:313      评论:0      收藏:0      [点我收藏+]

标签:

1、设置DHCP:

leaf /etc/dhcp/dhcpd.conf   编辑dhcp服务器配置文件,修改如下:


authoritative;


default-lease-time 700;

max-lease-time 8000;


subnet 10.0.0.0 netmask 255.255.255.0 {

option routers 10.0.0.1;

option subnet-mask 255.255.255.0;


option domain-name "FreeWiFi";

option domain-name-servers 10.0.0.1;


range 10.0.0.10 10.0.0.100;


}



2、启动激活网卡至监听模式:
airmon-ng start wlan0
airbase-ng -e FreeWiFi -c 6 mon0

3、热点的网络流量会被虚拟到at0这块网卡上面

ifconfig at0 up
ifconfig at0 10.0.0.1 netmask 255.255.255.0
ifconfig at0 mtu 1400
route add -net 10.0.0.0 netmask 255.255.255.0 gw 10.0.0.1
iptables --flush
iptables --table nat --flush
iptables --delete-chain
iptables --table nat --delete-chain

4、IP转发
echo 1 > /proc/sys/net/ipv4/ip_forward 

5、配置NAT转换  
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE  #对eth0进行源nat
iptables -A FORWARD -i wlan1 -o eth0 -j ACCEPT     
iptables --append FORWARD --in-interface at0 -j ACCEPT
iptables --table nat --append POSTROUTING --out-interface eth0 -j MASQUERADE
iptables -t nat -A PREROUTING -p tcp --destination-port 80 -j REDIRECT --to-port 10000

6、开启dhcp

dhcpd -cf /etc/dhcp/dhcpd.conf -pf /var/run/dhcpd.pid at0
/etc/init.d/isc-dhcp-server start


本文出自 “我的世界,我就是导演。” 博客,请务必保留此出处http://biock.blog.51cto.com/4643304/1671051

kali linux虚拟wifi搭建

标签:

原文地址:http://biock.blog.51cto.com/4643304/1671051

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!