Background: I am trying to set up an access point on Linux. The ultimate aim is to run SSLStrip (for an exercise) so I need to be able to do something like this, to redirect port 80 traffic through port 10000, on which SSLStrip listens.

iptables -t nat -A PREROUTING -p tcp --destination-port 80 -j REDIRECT --to-port 10000

Using Linux - Kali2, 64bit. Machine has internet access via eth0.

This is how I am setting up the access point:

airmon-ng start wlan0 6
modprobe tun

ifconfig wlan0mon down
iwconfig wlan0mon mode monitor
ifconfig wlan0mon up

airbase-ng -e "MyAccessPoint" -c 6 wlan0mon &

ifconfig "at0" up
ifconfig "at0" "" netmask ""
ifconfig "at0" mtu 1500
route add -net "" netmask "" gw "" dev "at0"

Into /etc/dhcp/dhcpd.conf I put the following:

subnet netmask {
    default-lease-time 3600;
    max-lease-time 7200;
    option subnet-mask;
    option broadcast-address;
    option routers;
    option domain-name-servers;
    option domain-name “freeinternet.co.uk” 

Check that /etc/default/isc-dhcp-server has INTERFACES=”at0”

Start the DHCP Server:

/etc/init.d/isc-dhcp-server restart

Configure NAT and enable ip forwarding:

iptables --flush
iptables --table nat --flush
iptables --delete-chain
iptables --table nat --delete-chain
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
echo "1" > /proc/sys/net/ipv4/ip_forward

At this stage I believe I should be able to connect a client to my access point and browse the web.

The client sees the access point, connects, gets an IP address from the server's DHCP ( and then has the following routing table:

mark@laptop15:~/TT$ route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface         UG    0      0        0 wlan0   U     9      0        0 wlan0

However it cannot even ping the server ( - no errors, we just don't get the pings back:

mark@laptop15:~/TT$ ping
PING ( 56(84) bytes of data.

And it stays like that forever.

What am I doing wrong please?


Turns out it was network-manager interfering. Switched it off

service network-manager stop

and everything works fine.

I suspect there exists a less drastic solution than disabling it altogether, but it does what I need for now.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.