[Solved] No access to RPi3+ / eth0 gets no IP

Hi all

First excuse my poor english, I hope you can understand it.

I have Internetaccess with a Huawei B315 LTE Modem and try to install openWRT on a Raspberry 3B+.

I "use" openWRT since a few days.

After my first installation on sdcard with openwrt-19.07.5-brcm2708-bcm2710-rpi-3-ext4-factory.img, I was able to work with the GUI of openWRT.

Today I must have done something wrong in the GUI and my Modem "crashed".
After that I could not reach WAN or LAN, so I was unable to change something in the GUI.

I made (more than once :frowning: ) a new sdcard from the same img-file as above, but now I never had seen the GUI and when I connect the pi with my LTE modem by cable, the modem fails and e.g. my connected TV stops working, until I unplug the rj45 cable.

I realy have no idea what I did better in my first installation.

With ifconfig I see
br-lan with ip 192.168.1.1
eth0 without ip and
lo with 127.0.0.1.

How can I bring up the eth0 by using the command line?

thank you for any ideas

regards
Hans

(speaking german;-)

The eth0 interface does not have an IP address because it's part of the br-lan bridge. It is the bridge who has an IP address, and it works since you were able to login and execute commands.

What is probably happening is that both the RPi and the modem have the same IP address, and that is creating a conflict. Choose one IP address in the 192.168.1.x range, but outside those issued by the modem, and change it on the RPi.

2 Likes

Also disable the DHCP server of the RPi. Otherwise it will mess with the DHCP server of the modem.

Hi eduperez

thank you for the answer.

At the moment I cannot get access to the RPi over the network, and so I cannot change any thing using the GUI.

I have access to the RPi by the console (ash/bash?). So I think I have to use an uci-command or have to know the name and the content of the conf-file to edit.

Or ist this the wrong way?

Hi trendy

thank you for the answer.

Same problem as my answer above.

Please run the following commands (copy-paste the whole block) and paste the output here, using the "Preformatted text </> " button:
grafik
Remember to redact passwords, MAC addresses and any public IP addresses you may have

ubus call system board; \
uci export network; uci export wireless; \
uci export dhcp; uci export firewall; \
head -n -0 /etc/firewall.user; \
ip -4 addr ; ip -4 ro li tab all ; ip -4 ru; \
ls -l  /etc/resolv.* /tmp/resolv.* /tmp/resolv.*/* ; head -n -0 /etc/resolv.* /tmp/resolv.* /tmp/resolv.*/*

another small problem:

I cannot copy-paste this commands, because there ist no connection possible between the RPi and my PC.

So I executed the commands step-by-step and wrote it to different txt-files.

Now I want to copy them from the RPi to an usb-stick BUT
I cannot find where the stick is mounted and with my known linux-commands I dont find out this.

I will to this command on the RPi:

cp .txt /path/to/usbstick/. *

What is the common path for that?

Usually you need to install a few packages first to be able to mount drives. If you don't have internet on the RPi it will be quite hard to install them manually.
Maybe it would be faster to just take out the sd card and flash it on your PC with OpenWrt image to start from scratch.

of corse! I'm a little bit confused, spent to mutch hours for trying ;(

Here the output of

ubus call system board

{
	"kernel": "4.9.243",
	"hostname": "OpenWrt",
	"model": "Raspberry Pi 3 Model B Rev 1.2",
	"board_name": "raspberrypi,3-model-b",
	"release": {
		"distribution": "OpenWrt",
		"version": "18.06.9",
		"revision": "r8077-7cbbab7246",
		"target": "brcm2708\/bcm2710",
		"description": "OpenWrt 18.06.9 r8077-7cbbab7246"
	}
}

uci export network

package network

config interface 'loopback'
	option ifname 'lo'
	option proto 'static'
	option ipaddr '127.0.0.1'
	option netmask '255.0.0.0'

config globals 'globals'
	option ula_prefix 'fddb:527c:312e::/48'

config interface 'lan'
	option type 'bridge'
	option ifname 'eth0'
	option proto 'static'
	option ipaddr '192.168.1.1'
	option netmask '255.255.255.0'
	option ip6assign '60'

uci export wireless

package wireless

config wifi-device 'radio0'
	option type 'mac80211'
	option channel '11'
	option hwmode '11g'
	option path 'platform/soc/3f300000.mmc/mmc_host/mmc1/mmc1:0001/mmc1:0001:1'
	option htmode 'HT20'
	option disabled '1'

config wifi-iface 'default_radio0'
	option device 'radio0'
	option network 'lan'
	option mode 'ap'
	option ssid 'OpenWrt'
	option encryption 'none'

uci export dhcp

package dhcp

config dnsmasq
	option domainneeded '1'
	option boguspriv '1'
	option filterwin2k '0'
	option localise_queries '1'
	option rebind_protection '1'
	option rebind_localhost '1'
	option local '/lan/'
	option domain 'lan'
	option expandhosts '1'
	option nonegcache '0'
	option authoritative '1'
	option readethers '1'
	option leasefile '/tmp/dhcp.leases'
	option resolvfile '/tmp/resolv.conf.auto'
	option nonwildcard '1'
	option localservice '1'

config dhcp 'lan'
	option interface 'lan'
	option start '100'
	option limit '150'
	option leasetime '12h'
	option dhcpv6 'server'
	option ra 'server'

config dhcp 'wan'
	option interface 'wan'
	option ignore '1'

config odhcpd 'odhcpd'
	option maindhcp '0'
	option leasefile '/tmp/hosts/odhcpd'
	option leasetrigger '/usr/sbin/odhcpd-update'
	option loglevel '4'

uci export firewall

package firewall

config defaults
	option syn_flood '1'
	option input 'ACCEPT'
	option output 'ACCEPT'
	option forward 'REJECT'

config zone
	option name 'lan'
	list network 'lan'
	option input 'ACCEPT'
	option output 'ACCEPT'
	option forward 'ACCEPT'

config zone
	option name 'wan'
	list network 'wan'
	list network 'wan6'
	option input 'REJECT'
	option output 'ACCEPT'
	option forward 'REJECT'
	option masq '1'
	option mtu_fix '1'

config forwarding
	option src 'lan'
	option dest 'wan'

config rule
	option name 'Allow-DHCP-Renew'
	option src 'wan'
	option proto 'udp'
	option dest_port '68'
	option target 'ACCEPT'
	option family 'ipv4'

config rule
	option name 'Allow-Ping'
	option src 'wan'
	option proto 'icmp'
	option icmp_type 'echo-request'
	option family 'ipv4'
	option target 'ACCEPT'

config rule
	option name 'Allow-IGMP'
	option src 'wan'
	option proto 'igmp'
	option family 'ipv4'
	option target 'ACCEPT'

config rule
	option name 'Allow-DHCPv6'
	option src 'wan'
	option proto 'udp'
	option src_ip 'fc00::/6'
	option dest_ip 'fc00::/6'
	option dest_port '546'
	option family 'ipv6'
	option target 'ACCEPT'

config rule
	option name 'Allow-MLD'
	option src 'wan'
	option proto 'icmp'
	option src_ip 'fe80::/10'
	list icmp_type '130/0'
	list icmp_type '131/0'
	list icmp_type '132/0'
	list icmp_type '143/0'
	option family 'ipv6'
	option target 'ACCEPT'

config rule
	option name 'Allow-ICMPv6-Input'
	option src 'wan'
	option proto 'icmp'
	list icmp_type 'echo-request'
	list icmp_type 'echo-reply'
	list icmp_type 'destination-unreachable'
	list icmp_type 'packet-too-big'
	list icmp_type 'time-exceeded'
	list icmp_type 'bad-header'
	list icmp_type 'unknown-header-type'
	list icmp_type 'router-solicitation'
	list icmp_type 'neighbour-solicitation'
	list icmp_type 'router-advertisement'
	list icmp_type 'neighbour-advertisement'
	option limit '1000/sec'
	option family 'ipv6'
	option target 'ACCEPT'

config rule
	option name 'Allow-ICMPv6-Forward'
	option src 'wan'
	option dest '*'
	option proto 'icmp'
	list icmp_type 'echo-request'
	list icmp_type 'echo-reply'
	list icmp_type 'destination-unreachable'
	list icmp_type 'packet-too-big'
	list icmp_type 'time-exceeded'
	list icmp_type 'bad-header'
	list icmp_type 'unknown-header-type'
	option limit '1000/sec'
	option family 'ipv6'
	option target 'ACCEPT'

config rule
	option name 'Allow-IPSec-ESP'
	option src 'wan'
	option dest 'lan'
	option proto 'esp'
	option target 'ACCEPT'

config rule
	option name 'Allow-ISAKMP'
	option src 'wan'
	option dest 'lan'
	option dest_port '500'
	option proto 'udp'
	option target 'ACCEPT'

config include
	option path '/etc/firewall.user'

head -n -0 /etc/firewall.user

# This file is interpreted as shell script.
# Put your custom iptables rules here, they will
# be executed with each firewall (re-)start.

# Internal uci firewall chains are flushed and recreated on reload, so
# put custom rules into the root chains e.g. INPUT or FORWARD or into the
# special user chains, e.g. input_wan_rule or postrouting_lan_rule.

ip -4 addr ; ip -4 ro li tab all ; ip -4 ru

0:	from all lookup local 
32766:	from all lookup main 
32767:	from all lookup default 

ls -l /etc/resolv. /tmp/resolv. /tmp/resolv./ ; head -n -0 /etc/resolv.* /tmp/resolv.* /tmp/resolv./**

==> /etc/resolv.conf <==
search lan
nameserver 127.0.0.1

==> /tmp/resolv.conf <==
search lan
nameserver 127.0.0.1

==> /tmp/resolv.conf.auto <==

I hope I did no error by typing the commands :wink:

1 Like

The configurations show a default installation.
However the IP commands didn't all return something:

Seems that only ip -4 ru gave an output, unless you didn't paste it properly.

I do it again on the RPi and check it once more

i retyped the command

ip -4 addr ; ip -4 ro li tab all ; ip -4 ru

the output on the screen is different from the same command, only added " > ip.txt "

Is there another command that I can use to write in a file?

ip -4 addr > ip.txt; ip -4 ro li tab all >>ip.txt; ip -4 ru >>ip.txt

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN qlen 1
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
4: br-lan: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN qlen 1000
    inet 192.168.1.1/24 brd 192.168.1.255 scope global br-lan
       valid_lft forever preferred_lft forever
192.168.1.0/24 dev br-lan scope link  src 192.168.1.1 
broadcast 127.0.0.0 dev lo table local scope link  src 127.0.0.1 
local 127.0.0.0/8 dev lo table local scope host  src 127.0.0.1 
local 127.0.0.1 dev lo table local scope host  src 127.0.0.1 
broadcast 127.255.255.255 dev lo table local scope link  src 127.0.0.1 
broadcast 192.168.1.0 dev br-lan table local scope link  src 192.168.1.1 
local 192.168.1.1 dev br-lan table local scope host  src 192.168.1.1 
broadcast 192.168.1.255 dev br-lan table local scope link  src 192.168.1.1 
0:	from all lookup local 
32766:	from all lookup main 
32767:	from all lookup default 

BTW

In my "normal" Linux envirement I can inform me about the commands with the "man" command.

Is there something similar in openWRT bash?

It's not bash, it's ash.
Due to size restrictions, man pages are not included, however you can run a command with -h or --help to see the options.
Other than that the RPi is running with defaults. Connect a PC on it and it should get IP 192.168.1.100 from DHCP. If it doesn't for some reason add it manually and connect to OpenWrt at 192.168.1.1

@trendy

you helped me a lot. Many thanks.

In the meantime I did this commands:

uci set network.lan.proto=dhcp
uci commit
/etc/init.d/network restart

Don't ask me why. I had something in my mind, that in one of my uncountable tries, I already used it.

And now, my router don't crash anymore and I can reach the RPi commandline over the LAN.

So far so good.

But when I try to open the OpenWRT-GUI it dosn't accept the password for root.
I already set it with the passwd command, but the GUI still doesn't accept it.

Can you give me an answer or should I open a new request in this forum?

Have a nice evening.

Greetings from snowy Switzerland
regards Hans

Do also uci set dhcp.lan.ignore='1'; uci commit dhcp; service dnsmasq restart to disable the dhcp.
Regarding the browser, try to clean cache, try private browsing, or another browser.

I'm in. YES :-))

Last problem was the browser.

Great help @trendy

1 Like

If your problem is solved, please consider marking this topic as [Solved]. See How to mark a topic as [Solved] for a short how-to.

1 Like