2

I am using an RPi 2 with Debian Wheezy Release Date 2015-2-16 with kernel version 3.18 (This is the latest version available on the official website).

I work at a research lab where I have to connect to LAN to access the internet.

The settings that I enter in my Windows 7 laptop are the following: IP Address, Subnet Mask, Default Gateway,Preferred DNS server and Alternate DNS server [These settings can be changed at Control Panel->Network and Internet->Network Connections->Local Area Connection->Properties->Internet Protocol Version 4(TCP/IPv4)]. Other than these details I also have to input a proxy setting and Port number in Google chrome to finally access the net [Which can be changed from the settings tab in chrome].

I have been doing a lot of reading but have not been able to figure out how to make this work. I have used the following resources:

  1. To configure the IP Address, Subnet Mask, Default Gateway- http://xmodulo.com/configure-ip-address-raspberry-pi.html (I used the Text mode as mentioned in the link)

  2. To configure the DNS servers- https://superuser.com/questions/617796/how-do-i-set-dns-servers-on-raspberry-pi

  3. To configure the Proxy settings- http://mrchrisjbailey.co.uk/2013/03/19/connecting-raspberry-pi-through-school-proxy/

Yet, the browser displays an error and when I try to update the RPi I get an error saying unable to connect to the proxy. These settings and Lan cable are working on my laptop.

I'm new to this, please help!

  • does sudo ifconfig show you the ip address you expect? Can you ping another machine on the network, the router, google.com? – rob Mar 4 '15 at 7:52
  • you have a static IP address or DHCP? – Joe Platano Mar 4 '15 at 11:38
  • @joemexiko I have a static IP address. Anyway the problem has been resolved after I followed the instructions by fadedreamz. Thanks! – Vishaal Devanaboyina Mar 5 '15 at 10:00
3

1) Assign IP address

ifconfig <interface(eth0)> <ipaddress>/24 (for netmask) up

2) Set Default Gateway

route add default gw <default gw ip>

3) Set DNS servers

nano /etc/resolv.conf

add nameservers (one at a line)

nameserver <DNS1>
nameserver <DNS2>
...
nameserver <DNSn>

and save

4) config apt-get proxy by editing/creating file

nano /etc/apt/apt.conf

add following line

Acquire::http::Proxy "http://yourproxyip:proxyport";

and save

5) profit

  • I'm able to ping local addresses but nothing external like google. My IP address, gateway and mask have changed. I have entered the proxy and proxy port settings as well. The browser still shows the error. – Vishaal Devanaboyina Mar 16 '15 at 13:10
  • Have you set up the system proxy (http_proxy system variable)? It is needed to tell the browser to tunnel through proxy. Your ping and browsers are failing because most likely they don't know that you are using proxy. So, the are making direct request to the gateway ip. Which is getting blocked by the firewall rules. – fadedreamz Mar 18 '15 at 4:44
  • @fadedreamz- what do you mean by setting up the system proxy? Do you mean what you've described in step no.4 ? If yes, then I have set it up. – Vishaal Devanaboyina Mar 18 '15 at 7:08
  • @VishaalDevanaboyina Step4 is needed if you want to use apt-get with proxy. For browsers and other application (for e,g ping) use export http_proxy="http://proxy-ip:proxy-port" It should work for browsers if you setup system proxy. – fadedreamz Mar 18 '15 at 8:42
  • @fadedreamz- Do I enter this command in the apt.conf file? If yes, do I replace the line in step 4 or let that be as well. – Vishaal Devanaboyina Mar 18 '15 at 10:21
1

Try ifconfig eth0 <ipaddress> netmask <netmask> gateway <gateway> as root in a shell. <...> denotes the actual values. replace eth0 with the wired network interface, but usually it is eth0. To set up your nameservers, put them into /etc/resolv.conf.

For debugging, first try ping for the proxy's IP address, if this works, with a known, external IP address.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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