How to interface two different networks in BPI-R2

Hi. On my BPI-R2 BOARD, I have eth1 with IP address of 192.168.0.110 and WLAN0 with IP address of 192.168.200.1. I would like to exchange the datas from one network into another. Help me to communicate these two different network. I have @frank-w wiki page for network, http://www.fw-web.de/dokuwiki/doku.php?id=en:bpi-r2:network:start But unable to understand how to get it done.

TIA.

You have to enable routing…

In debian based system this can be done via procfs (temporary) or /etc/sysctl.conf (permanent)

You are on right page…now added picture below to it with some explainations

http://www.fw-web.de/dokuwiki/doku.php?id=en:bpi-r2:network:start#routing

if this are not your only networks, static routes are needed too. For example if your client wants to connect/ping your net behind r2,but default gateway is not the r2 your default-gateway needs a (static) route for your net behind r2 (with next-hop=r2). else your default gateway does not know this net and uses its default-gw (internet)

Iptables and debug is also not complete

routing

router #1 does not know net 10.0.3.0/24 and router #2 does not know net 10.0.1.0/24, these nets must be propagated in the routers…

  • in router #1 a static route must be added for net 10.0.3.0/24 with next-hop 10.0.2.2 (send pakets over lan#2)
  • in router #2 a static route must be added for net 10.0.1.0/24 with next-hop 10.0.2.1 (send pakets over lan#1)
2 Likes

@frank-w great explanation. Thanks. May I know which kernel you suggest to use?. My requirement priority is network & GPIOs( SPI/I2C/Serial). HDMI is not important to me.

if you don’t need hdmi i suggest the highest kernel available for r2.currently it’s 4.14 longterm. But we can’t get spi working at the moment…also on 4.4

Fine. SPI is optional for me right now and I will be waiting for SPI issue to be fixed. Let me use 4.14.

Hi @frank-w I tried your 4.14.28 kernel as emmc boot. Its failed to boot with the message, “Waiting for root device /dev/mmcblk0p2…”. Please cross check this kernel.

/dev/mmcblk0 in my kernel is the SD-card…so please change the root-option in you uEnv.txt to /dev/mmcblk1p2

Yes, I got it. Its working after I edited uEnv.txt file.

However, when I was using 4.4.70, my WAN port was working fine by default and got IP address from my router on eth1. But in 4.14.28 kernel, eth0 is not getting any IP from my router and eth1 is not available.

Also like to know whether 4.14.28 kernel is working fine with I2Cs.

TIA.

In 4.14 ethx is only the port between soc and switch…here the lan/wan-port should get the ip via dhcp.

I have a picture in my wiki ( http://wiki.fw-web.de/doku.php?id=en:bpi-r2:network:start )

I got a ds1307-rtc running on i2c0