Banana PI R2 Does not Take An IP Address After Reboot

Hello I have a Banana PI R2 and i use deb_stretch_14.4.80 . when iI reboot banana PI it always can not take a ip address after I "run systemctl restart networking " it can take an ip address and every time it takes another ip address. Could you help me? Best Regards My /etc/network/interface file

    # interfaces(5) file used by ifup(8) and ifdown(8) Include files from 
    #/etc/network/interfaces.d: cpu-ports (eth0+1) bring up without any 
    #ip-configuration
    auto eth0 
    iface eth0 inet manual
      pre-up ip link set $IFACE up
      post-down ip link set $IFACE down
    #2nd gmac (cpu-port) only in 4.14.53+
    auto eth1 
    iface eth1 inet manual
      pre-up ip link set $IFACE up
      post-down ip link set $IFACE down
    #wan-port as dhcp-client
    auto wan 
    allow-hotplug wan 
    iface wan inet dhcp
    #lan0 has fixed address

    auto lan0 
    iface lan0 inet static
      #hwaddress ether 08:00:00:00:00:00 # if you want to set MAC manually
      address 192.168.10.100
      netmask 255.255.255.0
    #  gateway 192.168.0.5
      pre-up ip link set $IFACE address 02:01:02:03:04:00 up
    #  pre-up ip link set $IFACE up
      post-down ip link set $IFACE down

    auto lan1
    iface lan1 inet static
      #hwaddress ether 08:00:00:00:00:00 # if you want to set MAC manually
      address 172.78.45.120
      netmask 255.255.255.0
    #  gateway 192.168.0.5
      pre-up ip link set $IFACE address 02:01:02:03:04:10 up
    #  pre-up ip link set $IFACE up
      post-down ip link set $IFACE down

    auto lan2
    iface lan2 inet static
      #hwaddress ether 08:00:00:00:00:00 # if you want to set MAC manually
      address 145.168.20.110
      netmask 255.255.255.0
    #  gateway 192.168.0.5
      pre-up ip link set $IFACE address 02:01:02:03:04:20 up
    #  pre-up ip link set $IFACE up
      post-down ip link set $IFACE down



    auto lan3
    iface lan3 inet static
      #hwaddress ether 08:00:00:00:00:00 # if you want to set MAC manually
      address 185.36.22.11
      netmask 255.255.255.0
    #  gateway 192.168.0.5
      pre-up ip link set $IFACE address 02:01:02:03:04:30 up
    #  pre-up ip link set $IFACE up
      post-down ip link set $IFACE down


    source-directory /etc/network/interfaces.d

You get an other ip because r2 and some others have no fixed mac address. There are several ways to set a fixed one…see my wiki for it :slight_smile:

1 Like

Yes but some times does not get any ip after boot ? İs this cause of same reason?

Maybe gmac (ethx) is not up yet when userport (wan/lanX) is query ip so the first packets get lost. Have not tried it much as imho it is no usecase for routers to get ip from another :slight_smile: