0

I configured "/etc/network/interfaces" config file as such :

auto lo
iface lo inet loopback

iface eth0 inet manual

allow-hotplug wlan0
iface wlan0 inet manual
    wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

and configured dhcpcd.conf by adding these lines at the end of file:

# Custom static IP address for eth0.
interface eth0
static ip_address=192.168.1.115/24
static routers=192.168.1.1

# Custom static IP address for wlan0.
interface wlan0
static ip_address=192.168.1.114/24
static routers=192.168.1.1

With these configurations , I see my ethernet and wifi interfaces get specified ips successfully. Wireless connection is done also. But when i open web browser and try to reach a webpage, It just doesnt happen.

8
  • 1
    Why have you tried to give 2 interfaces the same ip_address? (I could also ask why bother with static in the first place - no one seems to need to do this on Windows or OSX.)
    – Milliways
    Commented Oct 18, 2016 at 11:19
  • @Milliways I tried your suggestion. But nothing has changed. Commented Oct 18, 2016 at 14:48
  • 1
    @ŞansalBirbaş, what are the results of ping 192.168.1.1 and nslookup www.google.com ? Paste on your question post.
    – vaha
    Commented Oct 18, 2016 at 15:11
  • @ŞansalBirbaş, based on your comments under my answer I think it would be helpful to add some clarifying details to the question. For example, are eth0 and wlan0 on the same physical network (i.e. connecting to the same router)? If so, why use 2 interfaces (wlan and eth). If not, why use a 192.168.1 network for both networks. Details like this could help those trying to assist.
    – thephez
    Commented Oct 18, 2016 at 21:46
  • 1
    You could try setting in /etc/dhcpcd.conf as per its documentation, example in How do I set up networking/WiFi/Static IP with instructions for determining parameter values. Most of the other comments seem speculative. I still don't see why so many Pi users want to set static IP addresses - I did this when I setup my 1st network in 1980, but now let the computer do the work.
    – Milliways
    Commented Oct 19, 2016 at 0:19

3 Answers 3

2

Wireless routers may not accept clients with self-assigned static IPs. When a new client logs in to the router, they get assigned a dynamic IP address which they are supposed to request via DHCP. If they don't, and instead pick a random IP address (as 192.168.1.114 in your case), the router will simply drop its packets.

This can be changed by configuring static IPs on the router: you have to tell it that a client with a particular MAC address will be using a particular IP address. With some routers, the client still have to use DHCP (even if the IP address they will get is always the same) to be able to communicate with the router.

The procedure to configure static IP is router specific. It can easily be found by googling "static IP address" plus the router name.

8
  • Are you referring to commercial/industrial wireless routers? I haven't typically had that issue with home models.
    – thephez
    Commented Oct 18, 2016 at 15:23
  • @thephez Would you refer to ISP-provided routers as commercial? Then yes. Anyway, the wast majority of routers can be configured to provide static IP via DHCP, which I recommend to use. Commented Oct 18, 2016 at 15:26
  • Good to know. I always disable the ISP WiFi and use my own wireless router. I agree - static via DHCP is the way to go when possible.
    – thephez
    Commented Oct 18, 2016 at 15:32
  • I haven't encountered any wireless router that does that. Any examples?
    – Aloha
    Commented Oct 19, 2016 at 1:22
  • Personally, I have both an old Linksys E1000 and a D-Link DIR655 that support this.
    – thephez
    Commented Oct 19, 2016 at 11:55
0

A couple potential issues:

  1. As @Milliways mentioned, it appears that the same IP Address (192.168.1.115) is being assigned to both network interfaces
  2. Additionally, the domain name server listed is the same as the gateway (192.168.1.1). This is fine as long as that device actually does DNS or forwards it on to an external DNS.

If it's a DNS issue, you should still be able to ping an external IP (try the 8.8.8.8 Google DNS address) once you eliminate the duplicate IPs.

For troubleshooting purposes, I'd recommend focusing on getting just one of the interfaces working and go from there.

10
  • Actually, I tried your suggestions. But seems nothing has changed. Commented Oct 18, 2016 at 14:39
  • Can you access the internet if you disconnect one of the interfaces and switch back to DHCP?
    – thephez
    Commented Oct 18, 2016 at 15:01
  • A yes, I disconnected ethernet and I am able to surf the web with wifi now @thephez Commented Oct 18, 2016 at 15:03
  • If you run ifconfig, does the network info fall into the same range as the static values you are trying to use?
    – thephez
    Commented Oct 18, 2016 at 15:16
  • 1
    Also, if your router supports it, DHCP reservation is an easy way to assign a "static" address without having to configure any static settings on your device. It just associates a MAC address with the same IP address every time, so you can leave DHCP enabled. This is how I normally do it if I want an unchanging IP.
    – thephez
    Commented Oct 18, 2016 at 15:18
0

This sounds like you don't have assigned DNS server addresses in your static (or fallback) dhcpcd.conf. As your configuration currently is, you only set up a correct IP/netmask and default gateway. This allows for IPv4 connectivity. But most browsers honor the system-assigned DNS service/server addresses, without any fallback. So in your case you don't have told your RPi which DNS server to use. For a quick check, try dig raspberrypi.org, which should give you an error, but also tell you which DNS server it wants to use. For cross-checking, check your /etc/resolv.conf which should lack any DNS server address assignments.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.