Discussion:
static ip
ahmad
2018-02-26 03:01:14 UTC
Permalink
Hi
I am trying to set static ip on my board (eth0 which is shown in the output
of ifconfig).

I edited the /etc/network/interfaces to this, and rebooted my board.
=====================
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
address 192.168.1.30
gateway 192.168.1.1
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
=====================
but the baord still get ip from dhcp. How I can resolve this problem?

this is the linux I am using:
Linux 4.4.0-linaro-lt-qcom #2 SMP PREEMPT Wed Feb 24 15:41:26 UTC 2016
armv7l GNU/Linux

Thanks
ahmad
2018-02-26 03:19:41 UTC
Permalink
that's getting interesting. after sudo /etc/init.d/networking restart, the
eth0 got my desire static IP(*192.168.1.30*).(not after sudo reboot).
however, here is another problem:
*192.168.1.15 *is the old ip of the board before restarting the network.
however, I can still connect to board using *192.168.1.15* (I flushed the
arp table of computer, but still the same result)
=======================================================
blahblahblah:~$ ssh linaro@*192.168.1.15*
***@192.168.1.15's password:

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Mon Feb 26 03:11:54 2018 from 192.168.1.12
***@kay:~$ sudo ifconfig
eth0 Link encap:Ethernet HWaddr blahbblahblah
inet addr:*192.168.1.30* Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: blahblahblah Scope:Link
UP BROADCAST RUNNING MULTICAST DYNAMIC MTU:1500 Metric:1
RX packets:637 errors:0 dropped:0 overruns:0 frame:0
TX packets:425 errors:0 dropped:0 overruns:0 carrier:1
collisions:0 txqueuelen:1000
RX bytes:65596 (64.0 KiB) TX bytes:59460 (58.0 KiB)
=========================================================
Post by ahmad
Hi
I am trying to set static ip on my board (eth0 which is shown in the
output of ifconfig).
I edited the /etc/network/interfaces to this, and rebooted my board.
=====================
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet static
address 192.168.1.30
gateway 192.168.1.1
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
=====================
but the baord still get ip from dhcp. How I can resolve this problem?
Linux 4.4.0-linaro-lt-qcom #2 SMP PREEMPT Wed Feb 24 15:41:26 UTC 2016
armv7l GNU/Linux
Thanks
Loading...