Jump to content

Script kiddy - dhclient


dre2007

Recommended Posts

Hello all,

First of all, great work on the PineApple nano everything is great and I am new to this community and I can say that I love the way how everything has been setup, kudos also to the webdeveloper and to the people who make the design and PR.

I got a script kiddy's question, sorry..

Because the modules are still in development and there is no exact date of when they will be available I am transferring some of my home made scripts to the Nano.

However, I got stuck on 1 command line as dhclient isn't available in the nano and I love to ssh to it and do my commands.

Does anyone knows away of how to obtain an IP address once I am connected to a wifi network with the cmd "iwconfig wlan1 essid Welcome"?

It is an open network in my home, yes I will add encryption later but first thing first, start with the basics.

Normally I use "dhclient wlan1" but DHCLIENT isn't added in the Nano ( firmware 1.0.1 )

Specific Questions:

1. Does anyone knows of how to obtain an IP address manually ( I know I can connect via they GUI, but I want it via the terminal.. )

2. If there is no way, would you then please add the dhclient command to the new firmware build?

Thanks again.

Regards,

André

Link to comment
Share on other sites

I don't have my nano handy, but you should be able to install dhclient easy enough.

opkg update

opkg install dhclient

You can of course assign a manual IP address to the interface, with ifconfig wlan1 123.456.789.123 netmask 255.255.255.0

Hope that helps!

telot

Link to comment
Share on other sites

Try udhcpc :rolleyes:

root@Pineapple:~# udhcpc --help
BusyBox v1.23.2 (2015-08-21 19:26:26 PDT) multi-call binary.

Usage: udhcpc [-fbqRB] [-t N] [-T SEC] [-A SEC/-n]
        [-i IFACE] [-s PROG] [-p PIDFILE]
        [-oC] [-r IP] [-V VENDOR] [-F NAME] [-x OPT:VAL]... [-O OPT]...

        -i,--interface IFACE    Interface to use (default eth0)
        -s,--script PROG        Run PROG at DHCP events (default /usr/share/udhc                                                                                                                                                             pc/default.script)
        -p,--pidfile FILE       Create pidfile
        -B,--broadcast          Request broadcast replies
        -t,--retries N          Send up to N discover packets (default 3)
        -T,--timeout SEC        Pause between packets (default 3)
        -A,--tryagain SEC       Wait if lease is not obtained (default 20)
        -n,--now                Exit if lease is not obtained
        -q,--quit               Exit after obtaining lease
        -R,--release            Release IP on exit
        -f,--foreground         Run in foreground
        -b,--background         Background if lease is not obtained
        -S,--syslog             Log to syslog too
        -r,--request IP         Request this IP address
        -o,--no-default-options Don't request any options (unless -O is given)
        -O,--request-option OPT Request option OPT from server (cumulative)
        -x OPT:VAL              Include option OPT in sent packets (cumulative)
                                Examples of string, numeric, and hex byte opts:
                                -x hostname:bbox - option 12
                                -x lease:3600 - option 51 (lease time)
                                -x 0x3d:0100BEEFC0FFEE - option 61 (client id)
        -F,--fqdn NAME          Ask server to update DNS mapping for NAME
        -V,--vendorclass VENDOR Vendor identifier (default 'udhcp VERSION')
        -C,--clientid-none      Don't send MAC as client identifier
Signals:
        USR1    Renew lease
        USR2    Release lease

  • Upvote 1
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...