[SOLVED] how to assing static ip in kernel commandline

Started by gurpartap, September 23, 2015, 10:19:08 AM

Previous topic - Next topic

gurpartap

I am using debian on olinuxino-a20-micro-4gb board.I have no serial port cable.I cennected hdmi display and it shows the desktop of debian image.It shows fixed ip 192.168.1.54 but my router give ip in 192.168.0.x form.I changed from network connections and set manual ip
ip --> 192.168.0.115
netmask ---> 255.255.255.0
gateway ---> 192.168.0.1
but after reconnecting ethernet it is showing 192.168.1.54 address.
How can I provide kernel commandline to set static ip and recompile it to make uImage.

Gerrit

#1
you can't set an ip address in the kernel command line, but you can do it in /etc/network/interfaces

https://www.howtoforge.com/debian-static-ip-address

But it should not be needed to set a static address there must be something wrong with your network connection

before you try static, put this in /etc/network/interfaces
auto eth0
iface eth0 inet dhcp

MBR

You can also try to configure the DHCP server to always give the same IP address, by assigning the IP adress to the device MAC address. Most of the DHCP servers supports it, even in cheap routers.

Quote from: Gerrit on September 23, 2015, 02:24:55 PM
But it should not be needed to set a static address there must be something wrong with your network connection

That's right ... as long as the device works as a pure client. If you want to runs some kind of server on it (even a SSH), you either need some kind of a service discovery (most of them are complicated and unsuitable for simple services), or a static IP.


gurpartap

 Hi thanks for replies....
My problem is solved...
I put static ip in /etc/network/interfaces
and changed /etc/Network-Manager/Network-Manager.conf file
and changed managed=false