ifconfig not showing changed ip address
As steeldriver notes in a comment, there is a typo. If that's not just a typo in your question, you need to fix that.
iface etho0 inet static
^
extra "o"
Also, for readability, traditionally they are indented and you don't actually need to specify the network and broadcast when the defaults are OK:
iface eth0 inet static
address 110.76.71.106
netmask 255.255.255.0
gateway 110.76.71.1
dns-nameserver 143.248.1.177
Once you've fixed that (or if that's not an error in the actual file) then you need to either reboot or do ifdown eth0; ifup eth0
to actually apply the network config. Also, you need an allow-hotplug eth0
or auto eth0
line to make it come up on boot.
Related videos on Youtube
![kwagjj](https://i.stack.imgur.com/cUEnz.jpg?s=256&g=1)
kwagjj
Updated on September 18, 2022Comments
-
kwagjj almost 2 years
I'm trying to configure IP settings on my Raspberry Pi running Rasperian.
I edited /etc/networks/interfaces to be:
auto lo iface lo inet loopback iface eth0 inet static address 110.76.71.106 netmask 255.255.255.0 network 110.76.71.0 broadcast 110.76.71.255 gateway 110.76.71.1 dns-nameserver 143.248.1.177 allow-hotplug wlan0 iface wlan0 inet manual wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf iface default inet dhcp
after that, I came back to bash and types 'ifconfig' and the result was like this:
eth0 Link encap:Ethernet HWaddr b8:27:eb:e0:70:ca UP BROADCAST MULTICAST MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B) lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 UP LOOPBACK RUNNING MTU:65536 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
as far as I know, beneath the 'Link encap:Ethernet HWaddr b8:27:eb:e0:70:ca' line, there should be something like 'inet addr:110.76.71.106 Bcase:110.76.71.255 ...blahblah'.
What could I have done wrong?
P.S. when I'm doing this, I'm not yet plugging the LAN cable to the raspberry pi. Could this be a reason why the correct 'ifconfig' result doesn't show up?
-
smw almost 10 yearsThere appears to be a typo in your file (
etho0
foreth0
) -
kwagjj almost 10 yearschanged the etho0 -> eth0 mistake. but still doesn't show the correct result even after rebooting...
-
pqnet almost 10 yearsadd
auto eth0
if you want the device to be brought up automatically at boot
-