ML
    • Recent
    • Categories
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    CentOS 7 - Proxy Server

    IT Discussion
    linux centos centos 7 proxy
    2
    27
    4.7k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • A
      Alex Sage
      last edited by scottalanmiller

      In CentOS 7, what command(s) do I run to tell it to use a proxy server to connect to the internet?

      1 Reply Last reply Reply Quote 1
      • S
        scottalanmiller
        last edited by

        the basic setting is...

        http_proxy=http://proxy_server_address:port
        
        A 1 Reply Last reply Reply Quote 0
        • S
          scottalanmiller
          last edited by

          You can run that while your shell is running. To set it for a user, it is typical to put it into their ~/.bash_profile file. Or put it into /etc/profiles to apply to all users. Be sure to export it as well.

          1 Reply Last reply Reply Quote 1
          • A
            Alex Sage @scottalanmiller
            last edited by

            @scottalanmiller will that work even after reboot?

            S 1 Reply Last reply Reply Quote 0
            • S
              scottalanmiller @Alex Sage
              last edited by

              @anonymous said:

              @scottalanmiller will that work even after reboot?

              Not if you don't put it into one of the files mentioned 🙂

              1 Reply Last reply Reply Quote 1
              • A
                Alex Sage
                last edited by

                Loaded plugins: fastestmirror
                Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=os&infra=stock error was
                14: curl#7 - "Failed to connect to 2a02:2498:1:3d:5054:ff:fed3:e91a: Network is unreachable"
                
                
                 One of the configured repositories failed (Unknown),
                 and yum doesn't have enough cached data to continue. At this point the only
                 safe thing yum can do is fail. There are a few ways to work "fix" this:
                
                 1. Contact the upstream for the repository and get them to fix the problem.
                
                 2. Reconfigure the baseurl/etc. for the repository, to point to a working
                    upstream. This is most often useful if you are using a newer
                    distribution release than is supported by the repository (and the
                    packages for the previous distribution release still work).
                
                 3. Disable the repository, so yum won't use it by default. Yum will then
                    just ignore the repository until you permanently enable it again or use
                    --enablerepo for temporary usage:
                
                        yum-config-manager --disable <repoid>
                
                 4. Configure the failing repository to be skipped, if it is unavailable.
                    Note that yum will try to contact the repo. when it runs most commands,
                    so will have to try and fail each time (and thus. yum will be be much
                    slower). If it is a very temporary problem though, this is often a nice
                    compromise:
                
                        yum-config-manager --save --setopt=<repoid>.skip_if_unavailable=true
                
                Cannot find a valid baseurl for repo: base/7/x86_64
                

                Maybe it's a IPV6 issue? Maybe the proxy hates me?

                1 Reply Last reply Reply Quote 0
                • A
                  Alex Sage
                  last edited by

                  Ping doesn't work ether 😞

                  S 1 Reply Last reply Reply Quote 0
                  • A
                    Alex Sage
                    last edited by

                    I can ping the proxy, so no issue there.....

                    1 Reply Last reply Reply Quote 0
                    • S
                      scottalanmiller @Alex Sage
                      last edited by

                      @anonymous said:

                      Ping doesn't work ether 😞

                      Ping doesn't work in what way? You said that you can ping the proxy, so it sounds like ping it working.

                      A 1 Reply Last reply Reply Quote 0
                      • A
                        Alex Sage @scottalanmiller
                        last edited by

                        @scottalanmiller I just tried to ping google.com

                        S 1 Reply Last reply Reply Quote 0
                        • S
                          scottalanmiller
                          last edited by

                          You are on IPv6? You have an IPv6 connection from your ISP?

                          A 1 Reply Last reply Reply Quote 0
                          • S
                            scottalanmiller @Alex Sage
                            last edited by

                            @anonymous said:

                            @scottalanmiller I just tried to ping google.com

                            But I thought that you put in an HTTP Proxy?

                            A 1 Reply Last reply Reply Quote 0
                            • A
                              Alex Sage @scottalanmiller
                              last edited by

                              @scottalanmiller I did.

                              S 1 Reply Last reply Reply Quote 0
                              • S
                                scottalanmiller @Alex Sage
                                last edited by

                                @anonymous said:

                                @scottalanmiller I did.

                                Then how would you ping it? Are you trying to ping it FROM the proxy?

                                1 Reply Last reply Reply Quote 0
                                • A
                                  Alex Sage @scottalanmiller
                                  last edited by

                                  @scottalanmiller said:

                                  You are on IPv6? You have an IPv6 connection from your ISP?

                                  No. But isn't this a IPV6 address?

                                  "Failed to connect to 2a02:2498:1:3d:5054:ff:fed3:e91a: Network is unreachable"

                                  S 1 Reply Last reply Reply Quote 0
                                  • S
                                    scottalanmiller @Alex Sage
                                    last edited by

                                    @anonymous said:

                                    @scottalanmiller said:

                                    You are on IPv6? You have an IPv6 connection from your ISP?

                                    No. But isn't this a IPV6 address?

                                    "Failed to connect to 2a02:2498:1:3d:5054:ff:fed3:e91a: Network is unreachable"

                                    Yes, so you have IPv6 being used somewhere. You need to get everything onto IPv4 if you want that to work 🙂

                                    1 Reply Last reply Reply Quote 1
                                    • S
                                      scottalanmiller
                                      last edited by

                                      Since that address would have to have come from DNS, I assume, then maybe the proxy things it is on IPv6 and is requesting AAAA records.

                                      1 Reply Last reply Reply Quote 0
                                      • A
                                        Alex Sage
                                        last edited by

                                        I am assuming when the proxy is working correctly I will be able to ping google.com from this server.

                                        S 1 Reply Last reply Reply Quote 0
                                        • S
                                          scottalanmiller @Alex Sage
                                          last edited by

                                          @anonymous said:

                                          I am assuming when the proxy is working correctly I will be able to ping google.com from this server.

                                          No, the purpose of using a web proxy is to block that, not allow it. You have no path for the ping to get to google.com since you just put in a proxy to block that.

                                          1 Reply Last reply Reply Quote 1
                                          • S
                                            scottalanmiller
                                            last edited by

                                            If you accidentally forgot to lock down your firewall and left the routes on your server, then ping would continue to work as before, but then a proxy would be pretty silly as it wouldn't be doing its job in most cases. Assuming you configured the firewall to block outbound traffic that doesn't come from the proxy server, there would be no route for a ICMP packet to take to get to the Internet since the server isn't on the Internet anymore.

                                            1 Reply Last reply Reply Quote 0
                                            • 1
                                            • 2
                                            • 2 / 2
                                            • First post
                                              Last post