Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
DHCP and wpad
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
beren43
n00b
n00b


Joined: 19 Dec 2015
Posts: 21

PostPosted: Sat Feb 13, 2016 2:16 pm    Post subject: DHCP and wpad Reply with quote

I configure the DHCP server for the wpad. In the dhcp.conf added
option wpad code 252 = text;
subnet {....
option wpad "http:// 172.18.01/proxy.pac" }

But if the internet expoler to automatically set the parameters, but does not load the page. If you set a script http:// 172.18.01/proxy.pac, everything works. What could be the problem ?
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6228
Location: Room 101

PostPosted: Sat Feb 13, 2016 3:08 pm    Post subject: Re: DHCP and wpad Reply with quote

beren43 wrote:
option wpad "http:// 172.18.01/proxy.pac" }

But if the internet expoler to automatically set the parameters, but does not load the page. If you set a script http:// 172.18.01/proxy.pac, everything works. What could be the problem ?

beren43 ... firstly, that is not an ip address, and there is a space in the URI. Secondly, does the httpd serving the proxy.pac know that what sort of mimetype it is.

httpd.conf:
AddType application/x-ns-proxy-autoconfig .pac

best ... khay
Back to top
View user's profile Send private message
Ant P.
Watchman
Watchman


Joined: 18 Apr 2009
Posts: 5914

PostPosted: Sat Feb 13, 2016 5:30 pm    Post subject: Re: DHCP and wpad Reply with quote

khayyam wrote:
beren43 ... firstly, that is not an ip address

Not to invalidate the rest of what you said, but that's a valid notation most software recognises, even if it is a bit strange (and obviously a lucky accident it works at all here).
Code:
 ~ $ ping 127.1
PING 127.1 (127.0.0.1) 56(84) bytes of data.
64 bytes from 127.0.0.1: icmp_seq=1 ttl=64 time=0.022 ms
 ~ $ ping 0x7f000001
PING 0x7f000001 (127.0.0.1) 56(84) bytes of data.
64 bytes from 127.0.0.1: icmp_seq=1 ttl=64 time=0.021 ms
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6228
Location: Room 101

PostPosted: Sat Feb 13, 2016 10:54 pm    Post subject: Re: DHCP and wpad Reply with quote

Ant P. wrote:
khayyam wrote:
beren43 ... firstly, that is not an ip address

Not to invalidate the rest of what you said, but that's a valid notation most software recognises, even if it is a bit strange (and obviously a lucky accident it works at all here).

Ant ... ok, its an ip address, but if you do a ping on your lan it'll take time to return, dhcp probably has a timeout, and so takes that as host unreachable.

Code:
# time /bin/ping -c 1 192.168.2.254 1>/dev/null
/bin/ping -c 1 192.168.2.254 1>/dev/null  0.00s user 0.00s system 0% cpu 0.004 total
# time /bin/ping -c 1 192.168.2.253 1>/dev/null
/bin/ping -c 1 192.168.2.253 1>/dev/null  0.00s user 0.00s system 0% cpu 0.008 total
# time /bin/ping -c 1 192.168.254 1>/dev/null
/bin/ping -c 1 192.168.254 1>/dev/null  0.00s user 0.00s system 0% cpu 10.003 total

Only the first of those addresses is reachable ... but of the two unreachable address the '192.168.254' took significantly longer. I can't test this with 192.168.0.254 obviously, but if this were reachable I'm fairly sure this would also take more time to execute.

best ... khay
Back to top
View user's profile Send private message
beren43
n00b
n00b


Joined: 19 Dec 2015
Posts: 21

PostPosted: Sun Feb 14, 2016 9:18 am    Post subject: Re: DHCP and wpad Reply with quote

khayyam wrote:
beren43 wrote:
option wpad "http:// 172.18.01/proxy.pac" }

But if the internet expoler to automatically set the parameters, but does not load the page. If you set a script http:// 172.18.01/proxy.pac, everything works. What could be the problem ?

beren43 ... firstly, that is not an ip address, and there is a space in the URI. Secondly, does the httpd serving the proxy.pac know that what sort of mimetype it is.

httpd.conf:
AddType application/x-ns-proxy-autoconfig .pac

best ... khay



Update: nginx, squid , dhcp server are located on the same physical server (172.18.0.1)

In nginx.conf
Code:
server {
listen 172.18.0.1 ;
root /var/www/loaclhost/htdocs};


That is, I add
Code:
server {
listen 172.18.0.1 ;
root /var/www/loaclhost/htdocs};
AddType application/x-ns-proxy-autoconfig proxy.pac;


Correctly ?
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6228
Location: Room 101

PostPosted: Sun Feb 14, 2016 11:04 am    Post subject: Re: DHCP and wpad Reply with quote

beren43 wrote:
Code:
server {
listen 172.18.0.1 ;
root /var/www/loaclhost/htdocs};
AddType application/x-ns-proxy-autoconfig proxy.pac;

beren43 ... I'm not familiar with nginx, the 'AddType' directive is for apache. On a search I see nginx.conf should have an 'include mime.types' so it seems the following would be the nginx method:

nginx.conf:
include mime.types;
types {
   application/x-ns-proxy-autoconfig .pac
}

best ... khay
Back to top
View user's profile Send private message
beren43
n00b
n00b


Joined: 19 Dec 2015
Posts: 21

PostPosted: Mon Feb 15, 2016 6:00 pm    Post subject: Reply with quote

I added in /etc/nginx/mime.types
Code:
types {
   application/x-ns-proxy-autoconfig .pac
}


It didn't help. The idea still there ?
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6228
Location: Room 101

PostPosted: Mon Feb 15, 2016 7:25 pm    Post subject: Reply with quote

beren43 wrote:
It didn't help. The idea still there ?

beren43 ... what you you using as dhcpd? In the above you'd stated "dhcp.conf", that is incorrect as net-misc/dhcp uses /etc/dhcp/dhcpd.conf (as I remember). From the syntax I'm inclined to think you are using net-misc/dhcp and so the following is the correct entry:

dhcpd.conf:
option local-pac-server code 252 = text;
option local-pac-server "http://172.18.01:80/proxy.pac";

Also, I don't know about nginx but with apache you need to supply a "ServerName" directive, and this is what apache expects to be the FQDN of the requested URI. So, dependent on how you've configured nginx, hosts/DNS, you may need to use the FQDN rather than the ip address.

best ... khay
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum