Jump to content


Photo

Connecting Pineapple Mk4 To Dsl Router


This topic has been archived. This means that you cannot reply to this topic.
5 replies to this topic

#1 smoothanx

smoothanx
  • Members
  • Newbie

  • 3 posts

Posted 26 April 2012 - 07:44 AM

Hi Everyone,
Long time reader, first time poster.

I just got my pineapple and I was planning to connect the pineapple to a DSL router (via an ethernet cable) facing the internet with a 192 private IP addressing scheme. What is the simplest and quickest method to change all required IP addresses settings on the pineapple to allow it to function with the DSL router and the internet?

Any help or tips would be greatly appreciated. Thankyou.

#2 WatskeBart

WatskeBart
  • Active Members
  • Hak5 Zombie

  • PipPipPipPipPip
  • 202 posts

Posted 26 April 2012 - 09:33 AM

The quickest way without changing any IP's is to connect your DSL with a cable to your pineapple WAN port en connect your PC to either the PoE/LAN port on the pineapple or WiFi.

But to configure the WAN port to enable NAT, you must add lines to your iptables.
I'm using it in a similar setup like your and added the following code to the WPS button script located at the configuration page http://172.16.41.1/p...pple/config.php

Add this code (source):

#!/bin/sh
#Script is executed when WPS button
#is pressed for 2-4 seconds.
iptables -A FORWARD -i eth1 -o wlan0 -s 172.16.42.0 -m state --state NEW -j ACCEPT
iptables -A FORWARD -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -t nat -A POSTROUTING -o eth1 -j MASQUERADE

After you clicked the button "Update WPS script" when the WPS button on your pineapple is pressed for 2-4 seconds NAT'ing will be enabled.
NOTE: After a reboot or replug you need to press the WPS button again to enable NAT.

//WB

 

Great things are not done by impulse, but by a series of small things brought together.

"Vincent van Gogh"


#3 smoothanx

smoothanx
  • Members
  • Newbie

  • 3 posts

Posted 26 April 2012 - 05:56 PM

Thanks for your speedy reply.

The problem is I don't want the pineapple directly connected to a PC. The setup I was going for was as follows;


Internet -- DSL Router -- Pineapple
|
|
PC

The DSL Router has 4 ethernet ports on it.

#4 smoothanx

smoothanx
  • Members
  • Newbie

  • 3 posts

Posted 26 April 2012 - 06:05 PM

My little diagram didn't come out right but basically the PC should be directly underneitht the router.

#5 petertfm

petertfm
  • Active Members
  • Hak5 Uber fan +++

  • PipPipPipPipPipPipPipPipPip
  • 1,106 posts

Posted 26 April 2012 - 06:14 PM

Thanks for your speedy reply.

The problem is I don't want the pineapple directly connected to a PC. The setup I was going for was as follows;


Internet -- DSL Router -- Pineapple
|
|
PC

The DSL Router has 4 ethernet ports on it.


how bout not connecting to pc and then on your own network you reference the pineapple via the ip your router gave the pineapple instead of 172.16.42.1/pineapple maybe 192.168.1.105/pineapple?
might work I am not 100%

#6 velkrosmaak

velkrosmaak
  • Active Members
  • Hak5 Fan ++

  • PipPipPipPip
  • 122 posts

Posted 26 April 2012 - 07:03 PM

If your PC is on the same network as the pineapple, I believe you need to set your PC's IP to 172.16.42.42 to be able to view the pineapple's UI. This was true for the MK3 anyhow.