Debian 9 and lan


(andarius40) #1

Good afternoon,

I have a BPI R2 with Debian 9.4, kernel 4.14.36-bpi-r2-main

But When I try to configure network interface with static IP, on reboot, no interface have an IP:

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 address 192.168.83.10 netmask 255.255.255.0 gateway 192.168.83.254 pre-up ip link set $IFACE up post-down ip link set $IFACE down

And on my system i don’t have : /etc/init.d/networking restart || systemctl restart networking || service networking restart.

Thank you for your help


(Frank W.) #2

Is package ifupdown installed? Maybe also debian is moved to netplan or similar…


(andarius40) #3

No is not installed I get this package and install it


(Frank W.) #4

He is described what i have done in ubuntu 18.4 which uses netplan:

https://www.fw-web.de/dokuwiki/doku.php?id=en:bpi-r2:ubuntu#install_system_to_sd-card

Debian uses also systemd so please try

systemctl restart systemd-networkd.service

(Leonardo Meneses) #5

hey there, this is because of bpi-r2 mac address settings.

in order to achieve a static ip, you need to configure the connection.

in the network icon, go to edit connections, delete (if any) excessive wired connections(new connections created on every boot), edit the one you need, and in mac address select from the dropdown eth1 (or eth0) and in mac clone select “permanent”. Then you can configure your settings however you want and they will survive reboots and disconnections.

My current setup is wired connection 1: eth0 (i believe this is lan): dhcp wired connection 2: eth1 (is where you connect your wan): static IP.

BTW, this setting works also in ubuntu mate 17.10. On ubuntu 16.04 the “permanent” option is not available and I couldn’t get a static ip.


(Frank W.) #6

In my debian image i have realited static ip with /etc/network/interfaces how did you test if no interface has an ip? Please show /etc/network/interfaces and output of “ip a” with code-indentation,so it is readable


(andarius40) #7

Hello,

Sorry for this later answer.

After install ifupdown.

I do configure static ip for all network interface and define a static mac address for each interfaces.

Now I do configure my R2 with same services that R1.

Thank you for your help


(Frank W.) #8

Does it work now?

If not please provide your /etc/network/interfaces as file-upload and output of “ip a” as code-block