Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Question] Possible to use network interface name instead of IP address? #96

Open
Saya47 opened this issue Jun 11, 2021 · 0 comments
Open

Comments

@Saya47
Copy link

Saya47 commented Jun 11, 2021

Greetings,

I know that when we want to specify the tcp outgoing address, we should use this line in the config:

tcp_outgoing_address 192.168.1.20

But sometimes, the IP address is not static and always changes. Checking for the new IP, editing the config with the new address, stopping and starting the Squid server takes a lot of time, is there any way to use a network interface name instead of using and IP address here? For example I wish we could use something like:

tcp_outgoing_interface Wi-Fi

Foe example, iIn these following 2 scenarios, I cannot assign a static IPv4 addresses to my network cards, thus my IP is dynamic and always changes:

  1. I share my Android phone's internet as a hotspot on the laptop. There's no way to assign a static IPv4 address to it. It doesn't accept the IP address.
  2. I use OpenVPN Connect software to connect to a VPN server using an .ovpn profile. This also doesn't accept a static IPv4 address, it doesn't honor the Windows' settings and simply uses it's own IPv4 address which changes every time I reconnect.

Thanks a lot in advance.

Edit: Here's my full config file:

acl localnet src 10.0.0.0/8	
acl localnet src 172.16.0.0/12	
acl localnet src 192.168.0.0/16	
acl localnet src fc00::/7       
acl localnet src fe80::/10      
acl SSL_ports port 443
acl Safe_ports port 80		
acl Safe_ports port 21		
acl Safe_ports port 443		
acl Safe_ports port 70		
acl Safe_ports port 210		
acl Safe_ports port 1025-65535	
acl Safe_ports port 280		
acl Safe_ports port 488		
acl Safe_ports port 591		
acl Safe_ports port 777		
acl CONNECT method CONNECT
tcp_outgoing_address 192.168.1.20
http_access allow localhost manager
http_access deny manager
http_access deny !Safe_ports
http_access allow localnet
http_access allow localhost
http_access deny all
http_port 3128
coredump_dir /var/cache/squid
refresh_pattern ^ftp:		1440	20%	10080
refresh_pattern ^gopher:	1440	0%	1440
refresh_pattern -i (/cgi-bin/|\?) 0	0%	0
refresh_pattern .		0	20%	4320
dns_nameservers 8.8.8.8 208.67.222.222
max_filedescriptors 3200
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant