Jump to content

How To Change Your Pineapple's IP Address


NotPike

Recommended Posts

Hi,

I didn't see any posts on how to change the WiFi Pineapple IP address on the forum. It took me a while to figure this out so I wanted to make this quick how to for those who don't know how.

1.) Connect to your Pineapple via SSH (Secure Shell)

ssh root@172.16.42.1

2.) Edit the network file under /etc/config using vim or nano.

nano /etc/config/network

3.) Under config interface 'lan' edit option ipaddr, netmask, and gateway to your settings. (Make sure your ipaddr and gateway are in the same subnet)

config interface 'lan'
        option ifname   'eth0'
        option type     'bridge'
        option proto    'static'
        option ipaddr   '10.0.0.1' #172.16.42.1 is default  
        option netmask  '255.255.255.0'
        option gateway  '10.0.0.42' #172.16.42.42 is default
        option dns      '8.8.8.8, 8.8.4.4'

5.) Save the file, Reboot your WiFi Pineapple, and Reconnect to it using your brand new IP address.

Hope this helps! If there's a better way to do this please let me know. ^_^

Link to comment
Share on other sites

You might also want to check the dhcp config file too. You might be giving out the wrong dns server and router.

Not sure if this is true or not but it looks like the dhcp file under /etc/config makes a call for 'lan' which I assume is being called from the network file. I'm new to OpenWrt so I'm most likely wrong lol.

-=dhcp=-

config dhcp lan
        option interface        lan
        option start    100
        option limit    150
        option leasetime        12h

When I connected to the Pineapple, the DNS seamed to work just fine. I was able to browse the Internet without any problems. I'll test it more and see if I can find anything tomorrow.

Link to comment
Share on other sites

Okay, so I found some conflicts with some of the modules when I changed the Pineapple's IP. This is only a temp fix and I'll try to find a way to make change with the system's IP address. (I don't know how to code in Java)

DWall has the default IP address hard coded in /pineapple/modules/DWall/js/module.js. I just commented out what defined the WebSocket and coped it with the updated IP address.

    $scope.startWS = (function() {
        $scope.throbber = true;
        // $scope.ws = new WebSocket("ws://172.16.42.1:9999/");
        $scope.ws = new WebSocket("ws://10.0.0.1:9999/");
        $scope.ws.onerror = (function() {
            $scope.ws.onclose = (function() {});
            $scope.startWS();

If there's a better way please let me know. Hope this helps!

Link to comment
Share on other sites

Okay, so I found some conflicts with some of the modules when I changed the Pineapple's IP. This is only a temp fix and I'll try to find a way to make change with the system's IP address. (I don't know how to code in Java)

DWall has the default IP address hard coded in /pineapple/modules/DWall/js/module.js. I just commented out what defined the WebSocket and coped it with the updated IP address.

    $scope.startWS = (function() {
        $scope.throbber = true;
        // $scope.ws = new WebSocket("ws://172.16.42.1:9999/");
        $scope.ws = new WebSocket("ws://10.0.0.1:9999/");
        $scope.ws.onerror = (function() {
            $scope.ws.onclose = (function() {});
            $scope.startWS();

If there's a better way please let me know. Hope this helps!

Oops, I did it out of habit. All you need to do is parse the URL and insert it there.

  • Upvote 2
Link to comment
Share on other sites

Oops, I did it out of habit. All you need to do is parse the URL and insert it there.

Cool! I'm learning Java on the fly now and I was curious. Is there an easy way to import the value of the IP address of 'br-lan'? IE like a global variable that's normal for OpenWrt systems. Or would you suggest I create a function to pull the IP address from the system or from the config file it's self?

Thanks!

Edited by NotPike
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...