0

I have headless rpi3. I have problem when I connect RPi ethernet directly to PC. Network is going down after a while. My /etc/network/interfaces:

auto lo
iface lo inet loopback

auto eth0
allow-hotplug eth0
iface eth0 inet dhcp

auto eth0:0
iface eth0:0 inet static
        address 192.168.2.222/24
        netmask 255.255.255.0

I am able to use both eth0 and eth0:0 when I connect it to my router with: 192.168.2.35-> eth0 192.168.2.222->eth0.0.

After that when I connect RPi to my PC directly, I can reach RPi over 192.168.2.222 for a while than it is gone. I dont know why. Why it is like that? How can I fix it?

1

If you REALLY want an Answer - you CAN'T "fix it" because this is how virtual network interfaces work.

If you read the documentation you will discover that you can only define a virtual network interfaces if the interface exists, which yours WON'T if not connected to a DHCP server.

There is also NO POINT in attempting to define a netmask (or CIDR notation) on a virtual network interface.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.