static ip is not working properly

Santhosh
Hiiii guys. 

I am working with Nano Pi M1. I want to set static ip to the Pi. But when I
am setting it, Pi is being connected with 2 ips. dynamic ip and static ip.
When checking ifocnfig it is showing static ip but when i am pinging and
opening with ssh it is working for both ips. And after few hours of time
static ip is disappearing with an error showing 

eth0: must be stopped to change its MTU 

and dynamic ip is displaying in ifconfig. So I want to know how can I
maintain only static IP to my Nano Pi even though it was connected to DHCP
server.

davef
Are you running Debian Jessie on the M1?

I have noticed that:

   hostname -I

gives

   192.168.1.200 192.168.1.103

The first is my static IP found in /etc/network/interfaces for wlan0.  The
second ... I don't know where it came from.

Like you I could ping the target at both IPs.  Before I did that the target
could not ping my router.  After I could ping the router.

At one stage the 192.168.1.130 disappeared, but has re-appeared.

Maybe showing your interfaces file might help someone explain to the both
of us what is going on.

If you are running Jessie then a search of the Raspberry Pi forums might be
more helpful.

davef
What does:

   arp -a 

say on your board?

davef
http://superuser.com/questions/764143/how-can-i-ensure-that-my-static-ip...

Where he talks about editing /etc/dhcp/dhclient.conf and commenting out the


   request ...

Check out the other suggestions.

davef
Ah, what about:

   route -n

For me there are two lines with the same router gateway address, except
Metric for one is 0 and the other 303.

http://serverfault.com/questions/730918/how-to-delete-gateway-from-defau...

   route del default gw 192.168.1.1

got rid of the line with Metric 303 and now

   hostname -I

gives only one Gateway entry.

Still don't know how the spurious gateway entry got there.

davef
Darn ... came back after a re-boot.

I know on the NanoPi there is a comment about having to remove a file
called /etc/udev/rules.d/70-persistent-net.rules ... I wonder if there is
some rules.d file that needs deleting or changing.

Good luck and report back.

Good night.

davef
I am going to work through this tutorial:

http://www.lhsspirit.com/linux/

I see he too modifies dhcpcd.conf "to statically assign a IP Address to our
RPi".

davef
Did it for me.  Just make sure the static IP address you have in
/etc/network/interfaces is in the range of IP addresses in dhcpcd.conf

Maybe use wpa_supplicant.conf like he does.