chinor
Posts: 3
Joined: Wed Oct 30, 2013 7:03 pm

How to SSH to raspberry pi without having a router as a brid

Wed Oct 30, 2013 7:04 pm

Hey, I have a raspberry pi running arch linux with wifi, It's connected to my router and I ssh to that, however I would like to be able to SSH to the pi without a router in between.
I tried making my computer as a virtual access point but for some reason it would not connect, also if the raspberry pi could act as the Acess point that would be great.
I am using EW-7811Un wireless USB.

pepedog
Posts: 1043
Joined: Fri Oct 07, 2011 9:55 am

Re: How to SSH to raspberry pi without having a router as a

Thu Oct 31, 2013 1:34 am

As far as I know, that card cannot be an access point.
Gigabit Ethernet interfaces automatically cross over, you don't have that, get a crossover cable.
Install dnsmasq and look at archlinux wiki how to configure and start

summers
Posts: 63
Joined: Mon Jan 30, 2012 4:27 pm

Re: How to SSH to raspberry pi without having a router as a

Sun Nov 03, 2013 9:14 am

I've a BeagleBone Black doing just that. Seemed easy enough to do.

1) First off check that your pi has an IP address thats in the range expected by the router (/sbin/ifconfig is your friend) - if it isn't you can use ifconfig to reset the IP address. If using dhcp the address should be fine (on my BBB, one adress uses dhcp and is fine, the other one deafults to a BBB setting of 192.168.7.2 which is not).

2) then in your router (which I presumbe is some kind of NAT firewall, that stops everything getting through), you need to set up forwarding. What needs to be enabled is forwarding to the RPi IP address, port 22. Me I forward from a high random number port (something like 12345).

3) Then from outside the router log in using "ssh -p 12345 [email protected]" - obviously chnging the port to the forwarding number you set up, the user to the user name on the pi, and the ip address to be the address of the router.

Hope that helps.

David.

User avatar
DeeJay
Posts: 2027
Joined: Tue Jan 01, 2013 9:33 pm
Location: East Midlands, UK

Re: How to SSH to raspberry pi without having a router as a

Sun Nov 03, 2013 9:38 am

summers wrote: Hope that helps.
Unlikely, because the enquirer said:
I would like to be able to SSH to the pi without a router in between.
How To Ask Questions The Smart Way: http://www.catb.org/~esr/faqs/smart-questions.html
How to Report Bugs Effectively: http://www.chiark.greenend.org.uk/~sgtatham/bugs.html

sdjf
Posts: 1395
Joined: Fri Mar 16, 2012 5:20 am
Location: California
Contact: Website

Re: How to SSH to raspberry pi without having a router as a

Sun Nov 03, 2013 5:28 pm

Since this thread is going a bit awry, let me state that it is definitely possible to SSH in to the Pi without a router with hard wired connections. The poster is asking about doing so with wifi, and pepedog pointed them to possible solutions for doing so with wireless.

This next page is about setting up ethernet and ssh, does not discuss wifi or router issues.

http://sdjf.esmartdesign.com/raspberrypi/ethernet.html
FORUM TIP: To view someone's posting history, sign in, click on their user name, then on "Search User's Posts." || Running ArchLinuxArm on Model 2B and 512MB Model B

midori
Posts: 8
Joined: Wed Nov 13, 2013 3:39 pm

Re: How to SSH to raspberry pi without having a router as a

Thu Nov 14, 2013 5:58 am

You set up an AD HOC Wi-Fi connection. That will probably be easier to set up on the desktop machine than the Pi, so have a go at setting that up on the desktop or laptop you want to connect to. Both computers will need Wi-Fi cards or dongles, of course.

You can also set up a direct cable connection. You need a Cat 5e crossover cable, and simply connect one end to each NIC port.

User avatar
aTao
Posts: 1091
Joined: Wed Dec 12, 2012 10:41 am
Location: Howlin Eigg

Re: How to SSH to raspberry pi without having a router as a

Thu Nov 14, 2013 7:34 am

If wired is ok then just use a standard cable, no need for cross over as the RPi, and probably the desktop will have auto sense network adapters.
That was new to me too before this forum helped out.
>)))'><'(((<

Rich107
Posts: 7
Joined: Thu Oct 16, 2014 10:35 am

Re: How to SSH to raspberry pi without having a router as a

Thu Oct 16, 2014 10:53 am

Hello all,

I am looking at doing something similar,

Wired is not an option for me as my project is outside and a router will be a pain, so I am in the same boat. My Mac Book has the option to make a computer to computer network (ad-hoc) however the pi will not connect using standard WiFi settings.

The next option I am looking at is using is setting up my second pi and using that as a router to bridge the two. Going on holiday this week so will start when I get back. If anyone thinks this will be a pointless venture please let me know before next week.

All the best
Rich

pepedog
Posts: 1043
Joined: Fri Oct 07, 2011 9:55 am

Re: How to SSH to raspberry pi without having a router as a

Thu Oct 16, 2014 1:36 pm

I'm not going to try this
First replace hostapd

Code: Select all

pacman -Syu
pacman -S base-devel git
wget https://aur.archlinux.org/packages/ho/hostapd-8192cu/hostapd-8192cu.tar.gz
tar xf hostapd-8192cu.tar.gz
cd hostapd-8192cu
makepkg -Acs --asroot
pacman -U *.xz
In /etc/hostapd/hostapd.conf driver=rtl871xdrv
Configuring, I recommend bridge
https://bbs.archlinux.org/viewtopic.php?id=162895
You might need to blacklist rtl8192cu

thegnnu
Posts: 157
Joined: Thu Oct 18, 2012 7:07 pm
Location: Bristol

Re: How to SSH to raspberry pi without having a router as a

Thu Oct 16, 2014 4:59 pm

Rich How do you power the Raspberry Pi outside ?
Is it a Model A or B

I moved away from WiFi for outdoors when it is mains connected.

TerryR

Rich107
Posts: 7
Joined: Thu Oct 16, 2014 10:35 am

Re: How to SSH to raspberry pi without having a router as a

Thu Oct 16, 2014 6:19 pm

Hi gnnu,

I am using this: http://thepihut.com/products/portable-p ... spberry-pi

It powers two Raspberrys for a while so will see if it works... I need to send a video feed via netcat and mplayer so I assume that wifi is the way to go...

Cheers
Rich

thegnnu
Posts: 157
Joined: Thu Oct 18, 2012 7:07 pm
Location: Bristol

Re: How to SSH to raspberry pi without having a router as a

Thu Oct 16, 2014 8:10 pm

As you are fully portable what about the Floureon Wi-fi router cost about £12 portable built in battery acts as a hotspot AP Router . I have just set one up waiting for the rain to stop to try portable.
Set router with same SSID and password on same radio channel (turn of main router to do this then you can connect WiFi or Ethernet to it.

when portable your Pi and computer will think they are in the house
so normal SSH can happen make the PI Static IP and that should work.
Even has a USB for a 3G Dongle.

TerryR

Rich107
Posts: 7
Joined: Thu Oct 16, 2014 10:35 am

Re: How to SSH to raspberry pi without having a router as a

Fri Oct 17, 2014 12:31 pm

Terry,

That sounds like a good idea, I find it hard to believe that the raspberry pi cannot directly connect to another computer via WiFi... but at least this will do the job. Might try the second raspberry pi before I go an buy this. Let me know how your project goes when the rain stops.

Rich

Rich107
Posts: 7
Joined: Thu Oct 16, 2014 10:35 am

Re: How to SSH to raspberry pi without having a router as a

Sun Oct 19, 2014 11:10 pm

Well this might not be the answer people were looking for.... but it might be helpful to some.

I have managed very easily to stream video to my laptop via my phones personal hotspot which works very well. I have done this on a LAN level as my laptop is also in range of my phone's hotspot. My Sony Z2 (running android) has a list of all the attached devices allowing me to know the local IP of both my laptop and Pi right away. It was just a case of changing the config file to have the same SSID and psk as my phone's personal hotspot.

If anyone is interested...

I am using netcat and mplayer on both devices to stream the live video on the raspberry pi to my laptop. I am also using the tee command to save the live steam on the Pi itself at the same time. I plan to use this on an RC helicopter which will no doubt end in the destruction of my Pi :(

Terry thank you for the idea of using a hotspot device to bridge the gap.

Cheers
Rich

Return to “Arch”