Static IP not taking
I have a Raspberry pi connected to my LAN via wifi, and the hardwired Ethernet is not connected. As for as I could tell, my static IP is 192.168.1.199. Agree?
Code:
pi@raspberrypi ~ $ ifconfig Please explain what is happening. Thank you Code:
[root@devserver ~]# ping 192.168.1.199 |
Could it be the IP address from when you plugged in the ethernet? Assuming you used the ethernet port if it was set to dhcp at somepoint.
|
Hi Swampthing. I don't think so. I am sure it originally had the hardwired Ethernet setup with dhcp, but currently, it is not even plugged in.
|
well you can ping it. is it the machine you pinged the pi from?
|
What machine provides your DNS, your wireless router? check in its DHCP tables for these IP's and hostnames, may need to clear or correct entries.
|
ifconfig has its limits after a long life of about 30 years. Perhaps it doesn't show everything.
Run ip address for ip addresses and ip route for the routing table. Also check the arp cache right after running the ping test (ip neighbor) to see the MAC address of 192.168.1.173. If you don't like typing, you can abbreviate the commands: ip a, ip r, ip n. The fact that 199 doesn't have a host name is unrelated. You need to configure the host name on the DNS server. |
Okay, I see 192.168.1.173 when using ip address and ip route, but don't know what it means. "secondary wlan0"?
Also, how should I check the arp cache?. See the bottom for when I used arp -a. Also, I see man arp says it is obsolete and I should use ip neighbor. Thanks Quote:
Code:
pi@raspberrypi ~/bacnet-stack-0-8-0 $ ip a Code:
[root@devserver ~]# ping 192.168.1.173 |
Quote:
|
Quote:
|
Dang, this is frustrating!
So, if I log onto my router, it shows both eth0 and wlan0 as being DHCP and not static. I want them to be static. Furthermore, if I reboot my router, I am not able to PuTTY into the device (at least using what I assumed were its static IPs) until I restart it. So, while I thought I had set it up with static IPs, it appears I haven't. Below is my config. Is there a way to confirm whether it is set up with a static IP or not? When searching for answers, all I saw was "Look at /etc/network/interfaces", and that gets me nowhere. Thanks in advance for any help or suggestions. Code:
pi@raspberrypi ~ $ cat /etc/network/interfaces EDIT. Also, if I restart the network, I lose communication and need to reboot the machine. Code:
pi@raspberrypi ~ $ sudo /etc/init.d/networking restart |
It looks right from what I can tell. You define a static IP on the machine and not the router. This breaks down the process of setting up a static IP on eth0 http://www.modmypi.com/blog/tutorial...tic-ip-address and this post is pretty spot on with establishing a static IP on wlan0 http://www.electroschematics.com/949...-raspberry-pi/ And this one too https://www.raspberrypi.org/forums/v...p?f=91&t=22660
|
I agree it looks right, but why would the router show it as being DHCP? Is there any commands which would confirm?
|
First, I am a bit confused - your Raspberry Pi is not the same as the router, correct? If so:
It's absolutely normal to have more than one IP address on an interface. ifconfig is too old for such things, that's why you should retire it and use the ip command instead. You can, for example, add an IP address manually: Code:
# ip a add 1.2.3.4/11 dev wlan0 # add a bogus address to wlan0 The fact that your router is configured differently than your Raspberry simply means that you didn't configure it correctly (in my humble opinion - again, I don't know too much about wireless LAN configuration). |
Your Pi only has one ethernet connection - but you are defining two ethernet connections for it.
When it comes up, entering Code:
arp -n |
Thanks berndbausch,
The Raspberry Pi is not the same as the router. Why is it absolutely normal to have more than one IP address on an interface? Is it primarily to support virtual servers? I ended up deleting the second IP, and think I have it resolved. Code:
update-rc.d dhcpcd disable |
All times are GMT -5. The time now is 10:59 AM. |