LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 04-11-2020, 11:10 AM   #1
anilw
LQ Newbie
 
Registered: Oct 2018
Posts: 20

Rep: Reputation: Disabled
Squid proxy server with 3G mobile dongle


Dear All,
i'm running ubuntu 18.04 on my Odroid XU4 and i have connected to internet using 3G mobile dongle. i have installed squid proxy server but i have no clue how to set up proxy ip ( i have set my port to 8080)
my
Code:
ifconfig
reads as below

Code:
root@odroid:~# ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 10.42.0.1  netmask 255.255.255.0  broadcast 10.42.0.255
        inet6 fe80::466:800f:cd03:77ce  prefixlen 64  scopeid 0x20<link>
        ether 00:1e:06:32:e3:00  txqueuelen 1000  (Ethernet)
        RX packets 1006050  bytes 1074956359 (1.0 GB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 2152643  bytes 3038443982 (3.0 GB)
        TX errors 0  dropped 8 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 2820  bytes 395944 (395.9 KB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 2820  bytes 395944 (395.9 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

wwan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 10.158.81.175  netmask 255.255.255.224  broadcast 10.158.81.191
        ether 00:1e:10:1f:00:00  txqueuelen 1000  (Ethernet)
        RX packets 65366  bytes 72974764 (72.9 MB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 35547  bytes 6375709 (6.3 MB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
pls tell me which ip to be used in "IP:8080"

is it 127.0.0.1 or 10.158.81.175 or just 10.42.0.1

i have tried with 127.0.0.1 but none of proxy rules that i have set seems to not working....

can i put my visbile hostname instead of an IP?

pls help me
 
Old 04-11-2020, 06:00 PM   #2
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
Quote:
Originally Posted by anilw View Post
pls tell me which ip to be used in "IP:8080"

is it 127.0.0.1 or 10.158.81.175 or just 10.42.0.1

i have tried with 127.0.0.1 but none of proxy rules that i have set seems to not working....

can i put my visbile hostname instead of an IP?
Have you tried anything apart from 127.0.0.1? If not, do it. If yes, what was the outcome? Be specific - "doesn't seem to work" is not a precise problem description.

I would guess the eth0 address, but essentially this depends on your Squid config. Which only you know.
I don't know either to which address your hostname is mapped and can't say if you can use that instead.
 
Old 04-15-2020, 05:38 AM   #3
anilw
LQ Newbie
 
Registered: Oct 2018
Posts: 20

Original Poster
Rep: Reputation: Disabled
Hi tks for the reply and sorry for not making the question clear..

my squid is running and status as below

Code:
root@127:~# sudo service squid status
● squid.service - LSB: Squid HTTP Proxy version 3.x
   Loaded: loaded (/etc/init.d/squid; generated)
   Active: active (running) since Wed 2020-04-15 15:36:31 +0530; 28min ago
     Docs: man:systemd-sysv-generator(8)
  Process: 3520 ExecStop=/etc/init.d/squid stop (code=exited, status=0/SUCCESS)
  Process: 3601 ExecStart=/etc/init.d/squid start (code=exited, status=0/SUCCESS
   CGroup: /system.slice/squid.service
           ├─3640 /usr/sbin/squid -YC -f /etc/squid/squid.conf
           ├─3642 (squid-1) -YC -f /etc/squid/squid.conf
           ├─3643 (logfile-daemon) /var/log/squid/access.log
           ├─3644 (unlinkd)
           └─3645 (pinger)

Apr 15 15:36:31 127.0.0.1localhostlocalhost.localdomainodroid systemd[1]: Starti
Apr 15 15:36:31 127.0.0.1localhostlocalhost.localdomainodroid squid[3601]:  * St
Apr 15 15:36:31 127.0.0.1localhostlocalhost.localdomainodroid squid[3640]: Squid
Apr 15 15:36:31 127.0.0.1localhostlocalhost.localdomainodroid squid[3601]:    ..
Apr 15 15:36:31 127.0.0.1localhostlocalhost.localdomainodroid systemd[1]: Starte
Apr 15 15:36:31 127.0.0.1localhostlocalhost.localdomainodroid squid[3640]: Squid
but all block sites are also working.... how come that happens?
some configuration issues???
pls help
 
Old 04-15-2020, 06:06 AM   #4
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
I didn't ask whether Squid was running. Read the questions again.

It would also help to know
- Squid's listening address (try netstat -ltpn or ss -ltpn)
- How do you block sites

Quote:
Originally Posted by anilw View Post
but all block sites are also working.... how come that happens?
I can see two reasons. Either, the applications you use to access the sites don't go through your proxy server, or your Squid configuration is incorrect.

Last edited by berndbausch; 04-15-2020 at 06:07 AM.
 
Old 04-15-2020, 06:27 AM   #5
anilw
LQ Newbie
 
Registered: Oct 2018
Posts: 20

Original Poster
Rep: Reputation: Disabled
Hi tks again for the repl..

pls see output for

Code:
root@127:~# ss -ltpn
State         Recv-Q          Send-Q                    Local Address:Port                    Peer Address:Port
LISTEN        0               50                              0.0.0.0:445                          0.0.0.0:*             users:(("smbd",pid=24953,fd=35))
LISTEN        0               50                              0.0.0.0:139                          0.0.0.0:*             users:(("smbd",pid=24953,fd=36))
LISTEN        0               128                             0.0.0.0:10000                        0.0.0.0:*             users:(("miniserv.pl",pid=1196,fd=5))
LISTEN        0               32                            10.42.0.1:53                           0.0.0.0:*             users:(("dnsmasq",pid=823,fd=7))
LISTEN        0               128                       127.0.0.53%lo:53                           0.0.0.0:*             users:(("systemd-resolve",pid=543,fd=13))
LISTEN        0               128                             0.0.0.0:22                           0.0.0.0:*             users:(("sshd",pid=727,fd=3))
LISTEN        0               5                             127.0.0.1:631                          0.0.0.0:*             users:(("cupsd",pid=580,fd=7))
LISTEN        0               50                                 [::]:445                             [::]:*             users:(("smbd",pid=24953,fd=33))
LISTEN        0               128                                   *:1984                               *:*             users:(("squid",pid=17237,fd=17))
LISTEN        0               50                                 [::]:139                             [::]:*             users:(("smbd",pid=24953,fd=34))
LISTEN        0               128                                [::]:10000                           [::]:*             users:(("miniserv.pl",pid=1196,fd=6))
LISTEN        0               128                                [::]:22                              [::]:*             users:(("sshd",pid=727,fd=4))
LISTEN        0               5                                 [::1]:631                             [::]:*             users:(("cupsd",pid=580,fd=6))
my squid configuration is pasted here https://pastebin.com/YDqCZjbd

pls check let me what mistakes i have done

tks..
 
Old 04-15-2020, 06:41 AM   #6
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
I am not very good at Squid, but these seem to be the relevant lines in your configuration file:
Code:
acl blocked_websites dstdomain .msn.com .espn.com .yahoo.com
#http_access deny blocked_websites
cache_effective_group proxy
As far as I understand this, you declare an ACL, but you don't use it.
 
Old 04-15-2020, 06:44 AM   #7
anilw
LQ Newbie
 
Registered: Oct 2018
Posts: 20

Original Poster
Rep: Reputation: Disabled
ok tks for your quick reply... what shall i do then?

can i have a better configuration file pls...
 
Old 04-15-2020, 06:48 AM   #8
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
I don't think you should be using Squid if you know less about it than me. Perhaps you should first learn the basics, for example https://wiki.squid-cache.org/SquidFaq/SquidAcl.

Internet search can also very effective. It took me 20 seconds to find https://stackoverflow.com/questions/...g-squid-server, searching for how to block access squid.

In this case, it should be sufficient to uncomment the http_access line.
 
Old 04-15-2020, 08:05 AM   #9
anilw
LQ Newbie
 
Registered: Oct 2018
Posts: 20

Original Poster
Rep: Reputation: Disabled
hi..
Tks for your reply and the links

i'll see myself how to solve this...
tks again
 
Old 04-15-2020, 09:05 AM   #10
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
As I said, uncomment the http_access line.
 
Old 04-16-2020, 09:34 AM   #11
anilw
LQ Newbie
 
Registered: Oct 2018
Posts: 20

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by berndbausch View Post
As I said, uncomment the http_access line.
i have done that. and this what i find under Squid status...
Code:
root@odroid:~# systemctl status squid
● squid.service - LSB: Squid HTTP Proxy version 3.x
   Loaded: loaded (/etc/init.d/squid; generated)
   Active: active (running) since Thu 2020-04-16 19:41:42 +0530; 18min ago
     Docs: man:systemd-sysv-generator(8)
  Process: 971 ExecStart=/etc/init.d/squid start (code=exited, status=0/SUCCESS)
   CGroup: /system.slice/squid.service
           ├─1154 /usr/sbin/squid -YC -f /etc/squid/squid.conf
           ├─1156 (squid-1) -YC -f /etc/squid/squid.conf
           ├─1166 (logfile-daemon) /var/log/squid/access.log
           └─1169 (pinger)

Apr 16 19:41:42 odroid squid[971]: 2020/04/16 19:41:42| WARNING: (B) '127.0.0.1' is a subnetwork of (A) '127.0.0.1'
Apr 16 19:41:42 odroid squid[971]: 2020/04/16 19:41:42| WARNING: because of this '127.0.0.1' is ignored to keep splay tree searching predictable
Apr 16 19:41:42 odroid squid[971]: 2020/04/16 19:41:42| WARNING: You should probably remove '127.0.0.1' from the ACL named 'localhost'
Apr 16 19:41:42 odroid squid[971]: 2020/04/16 19:41:42| WARNING: (B) '127.0.0.1' is a subnetwork of (A) '127.0.0.1'
Apr 16 19:41:42 odroid squid[971]: 2020/04/16 19:41:42| WARNING: because of this '127.0.0.1' is ignored to keep splay tree searching predictable
Apr 16 19:41:42 odroid squid[971]: 2020/04/16 19:41:42| WARNING: You should probably remove '127.0.0.1' from the ACL named 'localhost'
Apr 16 19:41:42 odroid squid[1154]: Squid Parent: will start 1 kids
Apr 16 19:41:42 odroid squid[1154]: Squid Parent: (squid-1) process 1156 started
Apr 16 19:41:42 odroid squid[971]:    ...done.
Apr 16 19:41:42 odroid systemd[1]: Started LSB: Squid HTTP Proxy version 3.x.
cannot i user 127.0.0.1 as in squid ip???
 
Old 04-16-2020, 10:01 AM   #12
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
Perhaps there is a conflict between the built-in ACL localhost and your ACL localnet. Perhaps you need to remove 127.0.0.1 from localnet, or from localhost.

Why don't you try an internet search? I found this: https://superuser.com/questions/7311...ing-subnetwork.
 
Old 04-17-2020, 12:18 AM   #13
anilw
LQ Newbie
 
Registered: Oct 2018
Posts: 20

Original Poster
Rep: Reputation: Disabled
hi
tks.. i did tried enough on internet before asking here.... since i could find any clue only i have posted here...
tks for your tip
 
  


Reply

Tags
mobile, proxy, squid



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
how to connect to internet via usb dongle (MPS internet dongle) on Fedora 16 O.S danibhai Linux - Newbie 1 07-30-2012 11:03 AM
configure squid proxy with cc proxy as a parent proxy faisi Linux - Networking 1 08-10-2010 01:16 PM
configure squid proxy with microsoft proxy as a parent proxy nintykola Linux - Software 1 08-28-2007 01:38 AM
Need help to connect a squid proxy to connect to another squid proxy server bellerophon Linux - Newbie 1 02-07-2006 06:52 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 11:57 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration