how can I connect to a D-link DIR-300 router using command line
Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
how can I connect to a D-link DIR-300 router using command line
I need to connect to my router using only CLI, specifying an username and password, preferably with a single command line, so it won't be interactive, 'cause I need to include the command in a script.
If your AP is WPA you'll need to look into wpa_supplicant. There are more options available for wireless tools and plenty information on wpa_supplicant in the man pages.
Install and use 'lynx' its a web CLI that allows you to get into WEB based configuration pages on these types of modems.
Cheers.
True , I've already used lynx for the rest of the script. Basically I've done a script that called through conky would display the number and IP's of those that are connected to the router I want to watch. For that I've used
Code:
lynx --dump path_to_routers_status
There's just one small probelm, lynx can't get passed routers autentification using just one command line. You have to launch it and log in to the routers interface interactivelly. After I log in to the routers interface using any web browser conky displays what I want but I want it to do it automatically, so I could quicly check the wireless network and just log out after I've finished.
Quote:
Originally Posted by Peacedog
Hi Tux Rules, Welcome to LQ. If your AP is open or WEP you could use wireless tools.
Code:
# iwconfig wlan0 essid yourrouter key yourkey
# dhclient wlan0
or if you use an ascii password
Code:
# iwconfig wlan0 essid yourrouter key :syourpassword
# dhclient wlan0
replacing wlan0 with your interface.
It has to be done through an UTP cable, from the main computer for the reasons I've allready mentioned in my reply to WildPossum
--http-user=user
--http-password=password
Specify the username user and password password on an HTTP server.
According to the type of the challenge, Wget will encode them using
either the "basic" (insecure), the "digest", or the Windows "NTLM"
authentication scheme.
Although it sounds like you need something to display the results, too. You could save the URL as a file and open it with a browser I suppose.
What specifically is your concern? And how do you want this process to work? Do you intend to have a browser pop up every time this script runs? You could parse the file and strip out the bits you want to see and do it via text, which would eliminate the need for a browser.
what I need is to see on my desktop when I start the computer the number of those connected to the wireless router their IPs and the signals percentage they use. All this is shown in the routers graphical interface that I can access through a web browser. For this I've used lynx, so it will dump the status section of the wireless network. Using awk I've managed to isolate only the parameters I've needed. But lynx, as far as I know, cannot automatically get passed the routers authentication that requires an user name and a password.
Therefore I have to log in the routers interface first, providing the right username and password so conky could display what I want to see. Now I would like to know if the authentication could be done only through a command or commands that I could incorporate in that script so everything would be done automatically without my intervention.
Anyway if there are other ways I could watch constantly the informations I need so passing through routers authentication won't be needed it would be great but that's the only solution I could think of.
By the way that script it's no biggie and it looks like this
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.