I have just posted on how to configure your network to use a static IP address at this post: Set the IP address statically on the Beaglebone Black. One issue that is related is the case where you now wish to use a proxy with your device. This is common within universities and other organisations and the limits on what you can do are determined by your network administrator.
Anyway, to get you started, you need to use connman to change your proxy settings. As in the previous post, within the /usr/lib/connman/test directory there are a set of scripts to help you with this task. The one you are looking for is set-proxy
However to use it you first need to know your service name, so within /usr/lib/connman/test type ./get-services and you will get something like:
1 2 3 4 |
root@beaglebone:/usr/lib/connman/test# ./get-services [ /net/connman/service/ethernet_c8a030ab323a_cable ] IPv6.Configuration = { Method=auto Privacy=disabled } ...etc. |
My service name is ethernet_c8a030ab323a_cable, which is of course easy to remember. So we use this with the set_proxy script. Executing this we get the full usage:
1 2 3 4 5 6 7 |
root@beaglebone:/usr/lib/connman/test# ./set-proxy Usage: ./set-proxy <service> direct ./set-proxy <service> manual [servers=uri1,uri2,...] [excludes=host1,host2,...] ./set-proxy <service> auto url=[pac-url] Example: ./set-proxy service0 manual servers=proxy.example.com:8080 This would set the proxy uri and the method to manual |
There you have an example of the general manual usage, which will probably suit most people. You obviously need to know your proxy settings to do this.
In my case, within Dublin City University it is of the form:
1 |
./set_proxy ethernet_c8a030ab323a_cable auto url=http://www.dcu.ie/proxy.pac |
So, when I execute the ./get-services script again I get:
1 2 3 4 5 6 7 8 9 10 11 12 13 |
root@beaglebone:/usr/lib/connman/test# ./get-services [ /net/connman/service/ethernet_c8a030ab323a_cable ] ... Nameservers = [ 192.168.1.1 8.8.8.8 ] ... Proxy = { URL=http://proxy.dcu.ie/proxy.pac Method=auto } Nameservers.Configuration = [ 192.168.1.1 8.8.8.8 ] IPv4 = { Netmask=255.255.255.0 Gateway=192.168.1.1 Method=manual Address=192.168.1.80 } ... Proxy.Configuration = { URL=http://proxy.dcu.ie/proxy.pac Method=auto } Type = ethernet ... IPv4.Configuration = { Netmask=255.255.255.0 Gateway=192.168.1.1 Method=manual Address=192.168.1.80 } |
Where you can see that the Proxy.Configuraton has been set.
Once this is set, we can call ./get-proxy-autoconfig, which gives:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
root@beaglebone:/usr/lib/connman/test# ./get-proxy-autoconfig [ /net/connman/service/ethernet_c8a030ab323a_cable ] Method = auto URL = http://proxy.dcu.ie/proxy.pac // DCU standard proxy autoconfiguration script. Proxy2 function FindProxyForURL(url, host) { if (!isResolvable(host)) return "DIRECT"; if (isPlainHostName(host) || isInNet(host, "136.206.0.0", "255.255.0.0") ) { return "DIRECT"; } { return "PROXY proxy2.dcu.ie:3128; PROXY proxy1.dcu.ie:3128; DIRECT; PROXY proxy1.dcu.ie:3128; PROXY proxy2.dcu.ie:3128"; } } |
Just to check that my proxy is working:
1 2 3 4 5 6 7 8 9 10 11 12 |
root@beaglebone:~# wget http://beagleboard.org/static/images/beagle_logo_hdr.gif Connecting to beagleboard.org (75.101.156.174:80) beagle_logo_hdr.gif 100% |*******************************| 10086 0:00:00 ETA root@beaglebone:/tmp# git clone git://github.com/derekmolloy/boneCV.git Cloning into boneCV... remote: Counting objects: 31, done. remote: Compressing objects: 100% (23/23), done. remote: Total 31 (delta 15), reused 18 (delta 7) Receiving objects: 100% (31/31), 10.79 KiB, done. Resolving deltas: 100% (15/15), done. root@beaglebone:/tmp# |
All appears to be in working order.
I have ubuntu-raring-13.04-armhf-3.8.13-bone20.img.xz on beaglebone.I have set ip ,dns ,gateway settings.X11 forwarding is working within the lab where I am trying .But when I use export http_proxy=http://proxy_name:portname there is no change in proxy settings.
Hello
Just wondering, if the proxy (university proxy in my case) requires a username and password to use it, where would one specify that for the beaglebone?
Kind Regards
Thanks Derek for a nice tutorial..
i m facing problem to sety proxy which has username and password..kindly advice how to do this..soloutions on provided on the net are not working ..but by setting proxy in mozilla-beaglebone internet is working fine but at command propmt it is not working at all..un know host ..error coming in command prompt…kindly advice me please.
Derek Sir,
in my beagleboneblack, ./get-services script is not displaying anything but “cat get-services” command is displaying contents of the get-services file.
kindly adivce.
Hi Sir,
I am load the Linux BeagleBone 4.4.9-ti-r25 #1 SMP Thu May 5 23:08:13 UTC 2016 arm7L GNU/Linux on BeagleBone and there is no /connman/test file. We want to connect BeagleBone to laptop and start internet over that. But we have to add router as a switch which is connected to BeagleBone and laptop and create a network using the proxy of department network. how to set the iptables and which essential changes we have to do?
Hi derek,
I have two signals input on the PRU0, I realized a program to have one signal on my output PRU0.
I saved my data output in differents register (r1,r2,…)
Now I search to send my data on the output Ethernet.
Could you help me for my project ?