Canedje
Posts: 265
Joined: Thu Mar 26, 2015 7:18 am

Installing new RPI 3B problems

Thu Oct 27, 2016 3:16 pm

I just bought an extra RPI 3 B and trying to initiate it.
I try to fix the ip adresses for wifi and eth using the same code as used in an older RPI 3 in /etc/network/interfaces.
It lookes like:

Code: Select all

auto lo

iface lo inet loopback
iface eth0 inet static
address 192.168.2.187
netmask 255.255.255.0
network 192.168.2.0
broadcast 192.168.2.255
gateway 192.168.2.1

allow-hotplug wlan0
iface wlan0 inet static
address 192.168.2.202
netmask 255.255.255.0
network 192.168.2.0
broadcast 192.168.2.255
gateway 192.168.2.1
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
iface default inet dhcp
For the Wlan there is now a fixed ip adress.
For the eth0 not (still using a dhcp adress).
ifconfig shows:

Code: Select all

eth0      Link encap:Ethernet  HWaddr b8:27:eb:65:18:18
          inet addr:192.168.2.173  Bcast:192.168.2.255  Mask:255.255.255.0
          inet6 addr: fe80::c1d5:9b74:7bfc:415c/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:12994 errors:0 dropped:350 overruns:0 frame:0
          TX packets:800 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:841885 (822.1 KiB)  TX bytes:155533 (151.8 KiB)

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:140 errors:0 dropped:0 overruns:0 frame:0
          TX packets:140 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1
          RX bytes:11888 (11.6 KiB)  TX bytes:11888 (11.6 KiB)

wlan0     Link encap:Ethernet  HWaddr b8:27:eb:30:4d:4d
          inet addr:192.168.2.202  Bcast:192.168.2.255  Mask:255.255.255.0
          inet6 addr: fe80::b76b:fcf0:278a:679d/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:14875 errors:0 dropped:4174 overruns:0 frame:0
          TX packets:619 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:1493745 (1.4 MiB)  TX bytes:78356 (76.5 KiB)
What am I doing wrong?

Beside this I did add a new user.
Every time I use the sudo command the first time after login it ask the sudo password. Like:

Code: Select all

[sudo] password for ewh:
How can i fix not to type everytime the sudo passwd once?

Thanks inadvance
Last edited by Canedje on Thu Oct 27, 2016 3:58 pm, edited 1 time in total.

epoch1970
Posts: 5132
Joined: Thu May 05, 2016 9:33 am
Location: Paris, France

Re: Installing new RPI 3B problems

Thu Oct 27, 2016 3:58 pm

In Raspbian Jessie, dhcpcd is responsible for handling interfaces configuration, and /etc/network/interfaces is less useful.
(If you don't like that, as I do, I think you can remove the dhcpcd package. I am not advocating for that, but it is a possibility.)

If you have an extra user and give it super-user powers without at least verifying once the user identity, you just could as well login as root and leave the console open...
But I have to admit I have this in my sudo file:

Code: Select all

...
www-data	ALL=NOPASSWD: /usr/sbin/hostapd_cli
And if you really wanted to give root power to your user you could do this (note the %sudo line is above the user line):

Code: Select all

# Allow members of group sudo to execute any command
%sudo	ALL=(ALL:ALL) ALL
# Allow user badidea to run any command as root without entering a password even if it belongs to the sudo group
badidea	ALL=NOPASSWD: ALL
"S'il n'y a pas de solution, c'est qu'il n'y a pas de problème." Les Shadoks, J. Rouxel

Canedje
Posts: 265
Joined: Thu Mar 26, 2015 7:18 am

Re: Installing new RPI 3B problems

Thu Oct 27, 2016 4:06 pm

Epoch, thanks. The passwd problem is solved.

I don't understand how to use fixed adresses bij dhcpcd? Or how to remove it?
In my old RPI i used /etc/network/interfaces working fine?

drgeoff
Posts: 10765
Joined: Wed Jan 25, 2012 6:39 pm

Re: Installing new RPI 3B problems

Thu Oct 27, 2016 4:41 pm

Canedje wrote:Epoch, thanks. The passwd problem is solved.

I don't understand how to use fixed adresses bij dhcpcd? Or how to remove it?
In my old RPI i used /etc/network/interfaces working fine?
There are many posts with the details of putting static IPs in dhcpcd.conf for Raspbian Jessie. Which ones have you read and not understood?

Canedje
Posts: 265
Joined: Thu Mar 26, 2015 7:18 am

Re: Installing new RPI 3B problems

Thu Oct 27, 2016 5:23 pm

I did read several posts around this subject and they are quit confusing.
I do have it working now but I do think it orchanized in the wrong way.
I did use both systems :
/etc/network/interfaces. I configures this file like:

Code: Select all

auto lo

iface lo inet loopback
iface eth0 inet static
address 192.168.2.187
netmask 255.255.255.0
network 192.168.2.0
broadcast 192.168.2.255
gateway 192.168.2.1

allow-hotplug wlan0
iface wlan0 inet static
address 192.168.2.202
netmask 255.255.255.0
network 192.168.2.0
broadcast 192.168.2.255
gateway 192.168.2.1
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
iface default inet dhcp
and the file : /etc/dhcpcd.conf like this (At the end of the file):

Code: Select all

# A hook script is provided to lookup the hostname if not set by the DHCP
# server, but it should not be run by default.
nohook lookup-hostname

interface wlan0
static ip_address=192.168.2.202/24
static routers=192.168.2.1
static domain_name_servers=192.168.2.1 8.8.8.8

interface eth0
static ip_address=192.168.2.187/24
static routers=192.168.2.1
static domain_name_servers=192.168.2.1 8.8.8.8
Is this the right way to achieve eth0: 192.168.2.187 static adres
and Wlan0: 192.168.2.202 static adres?

EDIT: Strange part is that my router says that both adresses are dhcp and not static??

Return to “Troubleshooting”