[BPI-R2] Ubuntu 18.4 with kernel 4.14.48

Hi, i’ve created a ubuntu-image via debootstrap and 4.14.48 and got it booting…i hang on enabling the network-interfaces

Ubuntu 18.04 LTS bpi-r2-ubuntu ttyS0                                            
                                                                                
bpi-r2-ubuntu login: root                                                       
Password:                                                                       
Last login: Sun Jan 28 15:58:28 UTC 2018 on ttyS0                               
Welcome to Ubuntu 18.04 LTS (GNU/Linux 4.14.48-bpi-r2-main armv7l)              
                                                                                
 * Documentation:  https://help.ubuntu.com                                      
 * Management:     https://landscape.canonical.com                              
 * Support:        https://ubuntu.com/advantage                                 
                                                                                
root@bpi-r2-ubuntu:~# ip a                                                      
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group defaul
t 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> mtu 1500 qdisc noop state DOWN group default qlen
 1000                                                                           
    link/ether 06:e5:14:13:9b:a8 brd ff:ff:ff:ff:ff:ff                          
3: wan@eth0: <BROADCAST,MULTICAST,M-DOWN> mtu 1500 qdisc noop state DOWN group d
efault qlen 1000                                                                
    link/ether 06:e5:14:13:9b:a8 brd ff:ff:ff:ff:ff:ff                          
4: lan0@eth0: <BROADCAST,MULTICAST,M-DOWN> mtu 1500 qdisc noop state DOWN group 
default qlen 1000                                                               
    link/ether 06:e5:14:13:9b:a8 brd ff:ff:ff:ff:ff:ff                          
5: lan1@eth0: <BROADCAST,MULTICAST,M-DOWN> mtu 1500 qdisc noop state DOWN group 
default qlen 1000                                                               
    link/ether 06:e5:14:13:9b:a8 brd ff:ff:ff:ff:ff:ff                          
6: lan2@eth0: <BROADCAST,MULTICAST,M-DOWN> mtu 1500 qdisc noop state DOWN group 
default qlen 1000                                                               
    link/ether 06:e5:14:13:9b:a8 brd ff:ff:ff:ff:ff:ff                          
7: lan3@eth0: <BROADCAST,MULTICAST,M-DOWN> mtu 1500 qdisc noop state DOWN group 
default qlen 1000                                                               
    link/ether 06:e5:14:13:9b:a8 brd ff:ff:ff:ff:ff:ff  
root@bpi-r2-ubuntu:~# cat /etc/network/interfaces 
# ifupdown has been replaced by netplan(5) on this system.  See                 
# /etc/netplan for current configuration.                                       
# To re-enable ifupdown on this system, you can run:                            
#    sudo apt install ifupdown                                                  
auto eth0                                                                       
iface eth0 inet manual                                                          
  pre-up ip link set $IFACE up                                                  
  post-down ip link set $IFACE down                                             
                                                                                
auto lan0                                                                       
iface lan0 inet static                                                          
  #hwaddress ether 08:00:00:00:00:00 # if you want to set MAC manually          
  address 192.168.0.11                                                          
  netmask 255.255.255.0                                                         
  gateway 192.168.0.10                                                          
  pre-up ip link set $IFACE up                                                  
  post-down ip link set $IFACE down       

i have used same config as on debian, but here it does not work…any idea why? i also tried manually setting up the interfaces eth0 and lan0 via (have to first bring lan0 up and then eth0) to get this:

2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP gr
oup default qlen 1000                                                           
    link/ether 06:e5:14:13:9b:a8 brd ff:ff:ff:ff:ff:ff                          
    inet6 fe80::4e5:14ff:fe13:9ba8/64 scope link                                
       valid_lft forever preferred_lft forever                                                 
4: lan0@eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP 
group default qlen 1000                                                         
    link/ether 06:e5:14:13:9b:a8 brd ff:ff:ff:ff:ff:ff                          
    inet6 fe80::4e5:14ff:fe13:9ba8/64 scope link                                
       valid_lft forever preferred_lft forever

You will know alot more than me about this but I have had to change some servers around because of netplan.oi which has taken over from ifupdown on 1804. I have been watching the forum for a plain ubuntu or debian server iso which I can use on the R2 to do a project I want to try and it would be similarly affected so I have a self interest in answering this. I found the info on these pages https://wiki.ubuntu.com/BionicBeaver/ReleaseNotes , http://manpages.ubuntu.com/manpages/bionic/man5/systemd.network.5.html and another post but I can’t find it again. I hope this is of some help and let me know if I can be of any use, I’m not much of an expert.

thank you for pointing me in right direction…i made a temporary network-config

ip link set eth0 up
ip addr add 192.168.0.11/24 dev lan0 #ip/prefix in your lan-segment not used
ip link set lan0 up
ip route add default via 192.168.0.10 #ip from your router
echo "nameserver 192.168.0.10" >>/etc/resolv.conf #ip from your router for dns resolution

installed “ifupdown” and added “netcfg/do_not_use_netplan=true” to my bootopts in /boot/bananapi/bpi-r2/linux/uEnv.txt

rebooted and voilá interfaces-file is used :slight_smile: but resolv.conf is changed back to default :frowning:

root@bpi-r2-ubuntu:~# ls -l /etc/resolv.conf                                    
lrwxrwxrwx 1 root root 39 Jun 13 10:27 /etc/resolv.conf -> ../run/systemd/resolve/stub-resolv.conf

tried adding “dns-nameservers” to interfaces:

auto lo
iface lo inet loopback
  dns-nameservers 192.168.0.10

but it seems to be ignored…

seems i found a fix:

rm /etc/resolv.conf
echo "nameserver 192.168.0.10" >>/etc/resolv.conf

deleting the symlink and place a static file with my content seems not to be overridden

1 Like

uploaded my current image to my gdrive: https://drive.google.com/open?id=1oP7jy1KrrIOifvImo2nQ59wx3_9hHkgk

ubuntu-18.04-bpi-r2-preview.img.gz

note this is a very basic image (steps in my wiki: https://www.fw-web.de/dokuwiki/doku.php?id=en:bpi-r2:ubuntu )…you have to install/configure all you need by yourself :slight_smile:

login currently only via debug-uart

user: root password: bananapi

@frank-w, ubuntu will use a dynamic resolv.conf as long as you let it be a link. If you want a static resolve.conf then remove the link from /etc/ and create a real text file called /etc/resolv.conf with your contents.

After that ubuntu will always use your manual settings as opposed to dynamic.

UPDATE: Ah, I didn’t read the bottom of your post.

dynamic does not work as i can’t set my dns-server

Right, that’s why you create a real file. What is happening is that ubuntu will run a DNS caching server locally, and that one queries the server provided by the DHCP.

So yeah, if you want to over-ride this behavior then you create /etc/resolv.conf file with your own settings.

Normally a router/server has fixed ip and does not use dhcp for itself… but just try my image :slight_smile:

Actually routers and servers use dhcp all the time for upstream connections… for example most home routers in america use dhcp, even though they always get the same ip…

Sorry, I’m in the middle of fighting my own battles with openwrt customization so I can’t try ubuntu image right now… I just thought I’d help you with your resolve issue, but missed that you modified your post with a solution already…

are you sure it is really dhcp? Dhcp ist designed for lans.

As far as i know here in germany home-routers getting (mostly) ip-config over ppp-protocol (lcp) from their isp. Routers above have static ips and /30-subnets for communicating to “next hop” (except their loopback-address…these are no local-loopbacks like 127.x.x.x)

Yes, I’m sure it’s DHCP. I have symmetric fiber to my house(pretty standard in my area), 1Gbs Up/1Gbs Down and I have a linux box as a router/firewall that fetches the address through DHCP on it’s WAN interface.

Hardly anyone uses ppp around here, at least on ISPs I have been on. So yes, my ISP’s DHCP gives be a public internet ping-able address

Added an ssh-section to my wiki. Here is described what to do for getting ssh-access running: https://www.fw-web.de/dokuwiki/doku.php?id=en/bpi-r2/ubuntu#ssh

Simply add permitrootlogin yes to /etc/ssh/sshd_config

Lan0-ip is 192.168.0.11 (second port,next to wan) you can change it in /etc/network/interfaces. More on https://www.fw-web.de/dokuwiki/doku.php?id=en:bpi-r2:network:start

Does this image will work from emmc?

I have got this error booting from emmc:

[ 3.268189] Waiting for root device /dev/mmcblk0p2…

and one more question: if I will run system from emmc can I still use system from SD as test (to make some changes to check if it’s working)

Please try to use /dev/mmcblk1p2 instead of /dev/mmcblk0p2 in case of eMMC.

but where to change it? /etc/fstab ? And how access / mount emmc when running system from SD …

/boot/bananapi/bpi-r2/linux/uEnv.txt

In case of using emmc boot is placed on /dev/mmcblk1p1

Find the line “root=…” and define root as /dev/mmcblk1p2

It’s good idea to change /etc/fstab too, but in’s not nessesary for boot, only for mounting options.

Thank you. Everything works.

have added instructions for emmc: https://www.fw-web.de/dokuwiki/doku.php?id=en:bpi-r2:ubuntu#installation

1 Like

one problem i have currently not solved: you can’t start dnsmasq (or another dns-server) because port 53 is by default mapped from systemd

root@bpi-r2-ubuntu:~# apt-get install net-tools
root@bpi-r2-ubuntu:~# netstat -tulpn | grep ":53 "                                                                                                                          
tcp        0      0 127.0.0.53:53           0.0.0.0:*               LISTEN      402/systemd-resolve                                                                         
udp        0      0 127.0.0.53:53           0.0.0.0:*                           402/systemd-resolve

@frank-w try this:

1 Like