0

I'm creating a local network of two computers (virtual machines, both Ubuntu 14, just from the box) with static routing. I set IP addresses for them this way:

vm1:
ip link set eth0 up
ip a add 5.9.30.10/24 dev eth0

vm2:
ip link set eth0 up
ip a add 5.9.30.20/24 dev eth0

First, the ip-addresses are set up, computers can ping each other, everything's okay:

> ip a
...
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfio_fast state UP group default qlen 1000
    link/ether 08:00:27:FF:47:2c bed FF:FF:FF:FF:FF:FF
    inet 5.9.30.10/24 scope global eth0
       valid_lft forever preferred_lft forever
    inet6 fe80::a00:27ff:feff:472c/64 scope link
       valid_lft forever preferred_lft forever

However, in 20-30 seconds all my settings drop for no reason:

> ip a
...
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfio_fast state UP group default qlen 1000
    link/ether 08:00:27:FF:47:2c bed FF:FF:FF:FF:FF:FF
    inet6 fe80::a00:27ff:feff:472c/64 scope link
       valid_lft forever preferred_lft forever

Why does it happen and how can be fixed?

4
  • Is network manager running? That might reset the network. Commented Apr 21, 2020 at 13:36
  • yep, it's running. Should I turn it off while trying to set addresses myself? Commented Apr 21, 2020 at 13:52
  • 1
    I guess it depends on what you are trying to do. In general I don't think killing NM is a good long term solution but if your goal is to learn networking and you want to be able to configure some networks and run some exercises on them then it seems like a viable direction. Commented Apr 21, 2020 at 13:54
  • Learning is the goal indeed. I tried turning nm off and it looks like it worked. Thanks a lot)) Commented Apr 21, 2020 at 13:58

1 Answer 1

1

As user1794469 noticed, the problem was caused by network-manager running and refreshing information.

In general I don't think killing NM is a good long term solution but if your goal is to learn networking and you want to be able to configure some networks and run some exercises on them then it seems like a viable direction.

As long as you want to learn networking that's the solution.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .