vivtiw
Posts: 3
Joined: Sun Apr 21, 2013 5:38 pm

Determining IP address and getting started

Sun Apr 21, 2013 6:31 pm

Hi,

I have a pi which I have connected to my ubuntu laptop through ethernet cable (eth0).

I have the internet connectivity on my laptop (wlan0) and I shared the connection so that pi can access it too. As soon as I hook up the power on pi, I see the rainbow LEDs blink ( which indicates that it got an ip address? I think so) . Doing ifconfig -a shows that it has an ip address of 10.42.43.1 i.e eth0 ( the ip for laptop (wlan0) is in different subnet: 192.168.x.x). Firstly I am not sure why they are on different subnets. Secondly with the 10.42.43.1, when I try to do an ssh from ubuntu to pi, I can't do so. Everytime I enter (username:pi) password as "raspberry" it says Access denied. I think there is some configuration glitch. I have a Raspbian “wheezy” installed in my SD card.


All the places I checked considers that you know the ip address of pi by connecting the screen to tv and manually configure the raspi_config ( or things similar to it). I dont have a tv or any cable so my objective was to get the Pi started from my laptop ( ubuntu 10.04)

So once I boot up the Pi and connect the ethernet cable to (eth0)ubuntu laptop how shall I correctly configure the settings ( IP and forwarding ) so that I can ssh to pi from my ubuntu system. In case you might have come across same problem, I shall be glad to get any feedback.

User avatar
FTrevorGowen
Forum Moderator
Forum Moderator
Posts: 5080
Joined: Mon Mar 04, 2013 6:12 pm
Location: Bristol, U.K.
Contact: Website

Re: Determining IP address and getting started

Mon Apr 22, 2013 6:27 pm

vivtiw wrote: ...
I have a pi which I have connected to my ubuntu laptop through ethernet cable (eth0).
I have the internet connectivity on my laptop (wlan0) and I shared the connection so that pi can access it too. As soon as I hook up the power on pi, I see the rainbow LEDs blink ( which indicates that it got an ip address? I think so) . Doing ifconfig -a shows that it has an ip address of 10.42.43.1 i.e eth0 ( the ip for laptop (wlan0) is in different subnet: 192.168.x.x). Firstly I am not sure why they are on different subnets. Secondly with the 10.42.43.1, when I try to do an ssh from ubuntu to pi, I can't do so. Everytime I enter (username:pi) password as "raspberry" it says Access denied. I think there is some configuration glitch. I have a Raspbian “wheezy” installed in my SD card.
...
From your info. above it looks as if your router is set up to assign different subnets to WiFi and wired LAN connections - there have been other posts where this has occurred. If that is the case a "permanent" solution will depend upon your router make & model etc. and, hopefully, someone on the forum with the same device will be able to advise you better. In the meantime you could either try not using WiFi on your laptop and connect both it and the Pi via "wired" connections (this assumes that your laptop also has an ethernet port) and they should both get their IP addresses by DHCP from the router and be on the same subnet etc. When pinging or ssh-ing to the Pi you will need to use it's IP address directly, rather than "by hostname" since it's unlikely that a DNS server will be running. Other possibilities are direct cable connection between the Pi and laptop (with static IP addresses) or via a separate "ethernet switch" if your router only has one LAN port.
Trev.
Still running Raspbian Jessie on some older Pi's (an A, B1, B2, B+, P2B, 3xP0, P0W) but Stretch on my 2xP3A+, P3B+, P3B, B+, A+ and a B2. See: https://www.cpmspectrepi.uk/raspberry_pi/raspiidx.htm

vivtiw
Posts: 3
Joined: Sun Apr 21, 2013 5:38 pm

Re: Determining IP address and getting started

Tue Apr 23, 2013 4:14 am

[/quote]
From your info. above it looks as if your router is set up to assign different subnets to WiFi and wired LAN connections - there have been other posts where this has occurred. If that is the case a "permanent" solution will depend upon your router make & model etc. and, hopefully, someone on the forum with the same device will be able to advise you better. In the meantime you could either try not using WiFi on your laptop and connect both it and the Pi via "wired" connections (this assumes that your laptop also has an ethernet port) and they should both get their IP addresses by DHCP from the router and be on the same subnet etc. When pinging or ssh-ing to the Pi you will need to use it's IP address directly, rather than "by hostname" since it's unlikely that a DNS server will be running. Other possibilities are direct cable connection between the Pi and laptop (with static IP addresses) or via a separate "ethernet switch" if your router only has one LAN port.
Trev.[/quote]

Hi Trev, thanks for taking time and going through the post. It usually is very unlikely that a router may assign different subnets to systems in the same LAN. I was trying to get this working with the tutorial in here: https://help.ubuntu.com/community/Inter ... ionSharing

I still think this is achievable by having a DHCP ip ( or probably static ) to my laptop and for sure a static ip to the Pi. Although I got it started by plugging the Pi directly through my router and sshing to the board through my Laptop, which is having wlan0 connection. It was as easy as pie, but to reach to this conclusion took me an entire day. I am wondering whether it is possible to install Ubuntu OSes on Pi ( as its ARM11 and ubuntu suports ARM7 and up)? Any thoughts.

User avatar
rpdom
Posts: 15173
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: Determining IP address and getting started

Tue Apr 23, 2013 4:54 am

vivtiw wrote: I am wondering whether it is possible to install Ubuntu OSes on Pi ( as its ARM11 and ubuntu suports ARM7 and up)
No. Ubuntu will not run on a Pi.

You are right to say that the CPU on the Pi is an ARM11 chip, but that's just the chip number, not what type of ARM architecture it is. The Pi uses ARMv6 architecture. Ubuntu needs ARMv7, as supported by chips like the ARM Cortex-A5 and later series.

Details of different ARM cores are listed on Wikipedia [url]http://en.wikipedia.org/wiki/Armv7#ARM_cores[/url/.

User avatar
rpdom
Posts: 15173
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: Determining IP address and getting started

Tue Apr 23, 2013 6:25 am

So, what you're trying to do, if I got it right is:

[internet]---[wifi-router]~~~~~~~~(wlan0)[ubuntu-laptop](eth0)---------(eth0)[Pi]

The WiFi is running on a 192.168.x.x subnet and the ethernet connection is on a 10.x.x.x subnet. Right?

The Ubuntu laptop should have two network addresses then. 192.168.x.x for Wifi and 10.x.x.x for wired to the Pi.

Does ifconfig -a on Ubuntu confirm that?

If so, can you ping the laptop's 10.x.x.x address from the pi?
Does ssh from the Pi to the laptop work?
Can you ping the Pi's address from the laptop?

Usernamevvv
Posts: 1
Joined: Sun Jun 16, 2013 10:50 am

Re: Determining IP address and getting started

Sun Jun 16, 2013 10:54 am

SSH is enabled automatically on Wheezy and Debian.

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

Re: Determining IP address and getting started

Mon Jun 17, 2013 9:47 am

Your Ubuntu box can and should have more than one IP address, one for each subnet that it is on. I do not know how you would configure that with GUIs and routers because my setup is different, but the basic idea will be that your Ubuntu has to also have an ip assigned on the eth0 subnet as well as on the wlan0, at least as I understand it.

I guess I am agreeing with rpdom.

To see if ethernet is enabled on the box I connect to my Pi, I run the route command:

route

And if ethernet is not enabled, then I enable it with an ifconfig command (you might not need sudo, but this what you could possibly run on Ubuntu without router):

sudo ifconfig eth0 10.xxx.xx.x netmask 255.255.255.0 up

the IP needs to be that you want to have the Ubuntu box take. You also might run route on the pi to make sure they are finally on same subnet.
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

vivtiw
Posts: 3
Joined: Sun Apr 21, 2013 5:38 pm

Re: Determining IP address and getting started

Wed Jun 19, 2013 2:33 am

Thanks all for the reply. It certainly helped me to get the thing going.
I connected my pi with the router/modem ( Zyxel ( i know its no good)) using an ethernet cable.

Then from my laptop i ran nmap : nmap -sV -p 22 192.168.0.1-255
Go the ip of pi ( good palindrome) ; connected through ssh using root privileges and it worked.

Return to “Beginners”