Bpi and gateway with wire

it is slow because of packet-drops…every dropped packet have to requested and sent again

source:

compiled Package:

backup your old uImage before overwriting. you have to change kernel-var in uEnv.txt if using another name than “uImage” for kernel

but something is strange in your system/with your r2

made test from my client over r2 (forwarding+nat/pat) to internet

--- www.google.com ping statistics ---
533 packets transmitted, 533 received, 0% packet loss, time 532747ms
rtt min/avg/max/mdev = 14.064/28.386/1037.457/90.110 ms, pipe 2

have you looked on soldering-points of ethernet-ports? there were some bad ones on sata of some people here…maybe your ethernet-ports are affected with same issue

The welds seem normal, How did you see the welding problems? My BPI-R2 is in a box : https://e.banana-pi.fr/2165-thickbox_default/boitier-acrylique-pour-le-routeur-banana-pi-bpi-r2.jpg

Why backup my kernel ? If it’s don’t run I make a new sd-card. With a new config, first only for forwarding+nat/pat to internet. Start from nothing… And try now…

Now, I run with the new kernel…

The bpi-r2 is in the network (wan with lan0) and I can not communicate with the bridge.

No time now…

Error… I can’t remove this.

You have a usb2serial-cable?

You have copied uImage to first partition in bananapi/bpi-r2/linux and modules to second partition (/lib/modules)?

Basicly folder-structure inside the archive

I don’t have some time… But I have do test.

I think that’s bridge do not run. hdmi do not run. I have a usb2serial-cable, but I don’t remember who :disappointed_relieved:

--- www.google.fr ping statistics ---
137 packets transmitted, 116 received, 15% packet loss, time 136595ms
rtt min/avg/max/mdev = 23.458/24.050/24.996/0.266 ms

if you use lan0 as wan and bridging lan1-3 why not using wan as management-interface with fixed address?

Hello I come back !

I think that’s I have not welding problems. I have try all lan and the wan in the network.

root@bpi-r2:~# cat /etc/network/interfaces
source-directory /etc/network/interfaces.d

auto eth1
iface eth1 inet manual
  pre-up ip link set $IFACE up
  post-down ip link set $IFACE down

auto eth0
iface eth0 inet manual
  pre-up ip link set $IFACE up
  post-down ip link set $IFACE down

auto wan
allow-hotplug wan
  iface wan inet dhcp
  pre-up ip link set $IFACE address 32:D1:55:7D:03:39 up

auto lan0
allow-hotplug lan0
  iface lan0 inet dhcp

auto lan1
allow-hotplug lan1
  iface lan1 inet dhcp

auto lan2
allow-hotplug lan2
  iface lan2 inet dhcp

auto lan3
allow-hotplug lan3

iface lan3 inet dhcp

All the lan0-3 have the same mac address ! I was connected in the bpi-r2 by the WiFi and try all the wired port : I my computer I test ping to wan. stop it. And in the bpi-r2, I do :

ifdown wan
ifdown lan0
ifup lan0

I deconnect the wire of wan and put it at lan0 and test ping with lan0.

--- 192.168.1.8 ping statistics ---
2705 packets transmitted, 2700 received, 0% packet loss, time 2768924ms
rtt min/avg/max/mdev = 0.250/0.325/0.515/0.033 ms

No problem I think.

DSA-User-ports (wan,lanx) getting mac-address from CPU-port (ethx). Currently i’m testing to set fixed mac (default is random) without compiling full kernel.

You have no more problem with pingdrops?

No problem with this test. But it’s not the config that I need.

You tested each port? If now all it’s ok you can move to your config step by step. But do not bridge wan+lan or ap0 with lan/wan

Before this hollyday, I have tested a bridge with lan0-3 only. It don’t work. I test no bridge (only lan0 zum bispiel) when I can.

I have try to have a DHCP in my bridge :

auto br0
  iface br0 inet dhcp
  pre-up ip link set $IFACE address 32:D1:55:7D:03:39 up
  bridge_ports lan0 lan1 lan2 lan3
  bridge_fd 5
  bridge_stp no
  up /etc/init.d/firewall start

It don’t work. The bridge need have a public address !

i don’t think this is possible, all your clients need a public ip too. why not connect your ISP to wan and your clients to lan-bridge? thats the normal setup and r2 can do what it is designed for…routing :slight_smile:

bridging your lan to public internet is a very bad idea

I think that’s I have do this with the BPI-R2 and ubuntu. The PBI-R2 has work als a swith.

Today I have a little time to test…

I don’t nothing understand. Before the test I have :

auto wan
  iface wan inet dhcp
  pre-up ip link set $IFACE address 32:D1:55:7D:03:39 up
  up /etc/init.d/firewall start

Before today I have never see problem with this. But today I have rbbot my BPI-R2 and after I have this :

--- 192.168.1.10 ping statistics ---
2260 packets transmitted, 2173 received, 3.84956% packet loss, time 2545ms
rtt min/avg/max/mdev = 0.347/0.484/0.587/0.044 ms

I have the problem I had with the bridge br0 :I can’t run vi with a big file.

I try it :

auto lan0
  iface lan0 inet dhcp
  pre-up ip link set $IFACE address 32:D1:55:7D:03:39 up
  up /etc/init.d/firewall start

and I have no problem.

--- 192.168.1.10 ping statistics ---
111 packets transmitted, 111 received, 0% packet loss, time 748ms
rtt min/avg/max/mdev = 0.349/0.487/0.607/0.052 ms

After this reboot I have a problem with the https server. It answers with https://192.168.1.10, but it don’t answers with a public name (I use ovh for my domaine). The name is good “ssh mein_mane” is good but it’s redirect to a other computer. When it’s redirect to the BPI-R2, it’s don’t run.
And I don’t see any problem in /var/log.

The problem with https redirection was due to the interfaces file
Now, I test the ping.

Have you a good configuration for a bridge ?

The ping :

--- 192.168.1.10 ping statistics ---
1146 packets transmitted, 1144 received, 0.17452% packet loss, time 1681ms
rtt min/avg/max/mdev = 0.329/0.422/0.558/0.053 ms

This morning I have do a test

br0 with lan0-3. A computer (A) in lan0 and a other computer (B) in lan1.

when A ping B or B ping A : 0% lost,
rtt min/avg/max/mdev = 0.171/0.365/.509/.0052

when A or B ping the BPI-R2 :

--- 192.168.2.1 ping statistics ---
2686 packets transmitted, 2433 received, 9.41921% packet loss, time 3221ms
rtt min/avg/max/mdev = 0.277/0.424/0.547/0.049 ms

for info :

root@bpi-r2:/var/log# ifconfig 
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 2e:26:e2:1f:af:af brd ff:ff:ff:ff:ff:ff
    inet6 fe80::2c26:e2ff:fe1f:afaf/64 scope link 
       valid_lft forever preferred_lft forever
3: wan@eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
    link/ether 32:d1:55:7d:03:39 brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.10/24 brd 192.168.1.255 scope global wan
       valid_lft forever preferred_lft forever
    inet6 2a01:cb14:aba:d900:30d1:55ff:fe7d:339/64 scope global mngtmpaddr dynamic 
       valid_lft 1780sec preferred_lft 580sec
    inet6 fe80::30d1:55ff:fe7d:339/64 scope link 
       valid_lft forever preferred_lft forever
4: lan0@eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue master br0 state LOWERLAYERDOWN group default qlen 1000
    link/ether 32:d1:55:7d:03:30 brd ff:ff:ff:ff:ff:ff
5: lan1@eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master br0 state UP group default qlen 1000
    link/ether 32:d1:55:7d:03:31 brd ff:ff:ff:ff:ff:ff
6: lan2@eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue master br0 state LOWERLAYERDOWN group default qlen 1000
    link/ether 32:d1:55:7d:03:32 brd ff:ff:ff:ff:ff:ff
7: lan3@eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master br0 state UP group default qlen 1000
    link/ether 32:d1:55:7d:03:33 brd ff:ff:ff:ff:ff:ff
8: br0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
    link/ether 32:d1:55:7d:03:30 brd ff:ff:ff:ff:ff:ff
    inet 192.168.2.1/24 brd 192.168.2.255 scope global br0
       valid_lft forever preferred_lft forever
    inet6 fe80::30d1:55ff:fe7d:330/64 scope link 
       valid_lft forever preferred_lft forever
9: wlan0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether 00:08:22:bc:ed:fb brd ff:ff:ff:ff:ff:ff
10: ap0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether 02:08:22:bc:ed:fb brd ff:ff:ff:ff:ff:ff
    inet 192.168.3.1/24 scope global ap0
       valid_lft forever preferred_lft forever
    inet6 fe80::8:22ff:febc:edfb/64 scope link 
       valid_lft forever preferred_lft forever

Why I have not eth1 in ifconfig ?

The beginning of /etc/network/interfaces is :

root@bpi-r2:~# cat /etc/network/interfaces
# interfaces(5) file used by ifup(8) and ifdown(8)
# Include files from /etc/network/interfaces.d:
source-directory /etc/network/interfaces.d

# The loopback network interface
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet manual
  pre-up ip link set $IFACE up
  post-down ip link set $IFACE down

auto eth1
iface eth1 inet manual
  pre-up ip link set $IFACE up
  post-down ip link set $IFACE down

I test :

 root@bpi-r2:~# grep eth1 /var/log/syslog
Jan 20 08:55:53 bpi-r2 ifup[705]: Cannot find device "eth1"
Jan 20 08:55:53 bpi-r2 ifup[705]: ifup: failed to bring up eth1
Jan 20 09:15:42 bpi-r2 ifup[704]: Cannot find device "eth1"
Jan 20 09:15:42 bpi-r2 ifup[704]: ifup: failed to bring up eth1
Jan 20 11:08:17 bpi-r2 ifup[717]: Cannot find device "eth1"
Jan 20 11:08:17 bpi-r2 ifup[717]: ifup: failed to bring up eth1

second gmac is only available in 4.14.53+ or 4.19.14+

if A pings B (or opposite direction) through bridge, r2 does not touch Traffic, i guess it’s not running over CPU-Port (ethx), means directly in switch from port lanX to lanY