Not able to access internet with proxy at virtual centos 7

Issues related to applications and software problems
pragyagupta
Posts: 10
Joined: 2018/03/06 06:53:48

Not able to access internet with proxy at virtual centos 7

Post by pragyagupta » 2018/03/08 06:42:45

I fed up to resolve this issue as i am facing this issue since 2 week but didn't get exact issue so please help me out.
I am not able to access internet in virtual centos 7 at virtual box but I can able to access from my physical computer.
on Physical I am using proxy.pac file for internet access but for centos I have another proxy as IP address but not able to access anything as I have full access on same proxy address.
I am using static IP for physical please don't reject this post and I need your help.

My configuration as follows below:

vi /etc/wgetrc
https_proxy = http://domain\user:password@10.x.x.x:8080/

http_proxy = http://domain\user:password@10.x.x.x:8080/
ftp_proxy = http://domain\user:password@10.x.x.x:8080/

# If you do not want to use proxy at all, set this to off.
use_proxy = on
---------------------------------------------------------------------------------------------------------------------------------------------
vi /etc/yum.conf

[main]
cachedir=/var/cache/yum/$basearch/$releasever
keepcache=0
debuglevel=2
logfile=/var/log/yum.log
exactarch=1
obsoletes=1
gpgcheck=1
plugins=1
installonly_limit=5
bugtracker_url=http://bugs.centos.org/set_project.php? ... tegory=yum
distroverpkg=centos-release

https_proxy = http://domain\user:password@10.x.x.x:8080/
http_proxy = http://domain\user:password@10.x.x.x:8080/
ftp_proxy = http://domain\user:password@10.x.x.x:8080/

---------------------------------------------------------------------------------------------------------------------------------------------
vi /etc/sysconfig/network-scripts/ifcfg-enp0s8
TYPE="Ethernet"
BOOTPROTO="dhcp"
DEFROUTE="yes"
#PEERDNS="yes"
IPV4_FAILURE_FATAL="no"
#IPV6INIT="yes"
IPV4_AUTOCONF="yes"
IPV6_AUTOCONF="yes"
IPV6_DEFROUTE="yes"
IPV6_PEERDNS="yes"
IPV6_PEERROUTES="yes"
IPV6_FAILURE_FATAL="no"
NAME="enp0s8"
UUID="3c36b8c2-334b-57c7-91b6-4401f3489c69"
DEVICE="enp0s8"
ONBOOT="yes"

DNS1=x.x.x.x
DNS2=x.x.x.x
DNS3=8.8.8.8
PEERDNS=yes
PEERROUTES=yes
IPV6INIT=no
--------------------------------------------------------------------------------------------------------------------
vi /etc/environment
http_proxy = http://ABC1\f1abcde:pw%24321@10.240.164.214:8080/
https_proxy = http://ABC1\f1abcde:pw%24321@10.240.164.214:808/

ftp_proxy = http://ABC1\f1abcde:pw%24321@10.240.164.214:8080/

export http_proxy = http://ABC1\f1abcde:pw%24321@10.240.164.214:8080/
export https_proxy = http://ABC1\f1abcde:pw%24321@10.240.164.214:8080/
export ftp_proxy = http://ABC1\f1abcde:pw%24321@10.240.164.214:8080/

User avatar
avij
Retired Moderator
Posts: 3046
Joined: 2010/12/01 19:25:52
Location: Helsinki, Finland
Contact:

Re: Not able to access internet with proxy at virtual centos 7

Post by avij » 2018/03/08 08:31:06

I had initially rejected your post for two reasons: it seemed to include username and passwords, and in your configuration you had backslashes \ at the end of the lines, and the error message complained about an invalid port number. I wrote about this in the rejection message.

This message of yours also had valid-looking usernames in the /etc/environment section, but I mangled those a bit so that those could not be abused.

See if it works any better if you replace \ with %5C, ie. http://ABC1%5Cf1abcde:pw%24321@10.240.164.214:8080

Similar escaping is done for the password (mangled here a bit). For example, if your password is pw%24321, you should write it as pw%2524321. On the other hand, if your password is pw$321 it should be written pw%24321. See man ascii for the hexadecimal table.

What is the error message you get with your current configuration?

User avatar
TrevorH
Site Admin
Posts: 33215
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Not able to access internet with proxy at virtual centos 7

Post by TrevorH » 2018/03/08 09:36:19

Also, yum.conf does not use http_ or ftp_proxy lines. Read man yum.conf and search for proxy and you will find it wants proxy=/proxy_username= and proxy_password= lines
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

pragyagupta
Posts: 10
Joined: 2018/03/06 06:53:48

Re: Not able to access internet with proxy at virtual centos 7

Post by pragyagupta » 2018/03/09 05:01:52

I have tried and reset all details but getting an error please help me out
https://the-security-page.com/index.htm
Connecting to 10.x.x.x:8080... connected.
Proxy tunneling failed: authenticationrequiredUnable to establish SSL connection.


[root@localhost ~]# vi /etc/yum.conf
[main]
cachedir=/var/cache/yum/$basearch/$releasever
keepcache=0
debuglevel=2
logfile=/var/log/yum.log
exactarch=1
obsoletes=1
gpgcheck=1
plugins=1
installonly_limit=5
bugtracker_url=http://bugs.centos.org/set_project.php? ... tegory=yum
distroverpkg=centos-release


proxy=http://10.x.x.x:8080
proxy_username=ABC%5Cf1cccc
proxy_password=India0987

--------------------------------------------------------------------------------------------------------------------------------------------
vi /etc/environment

https_proxy = http://ABC1%5Cfbbbv:India0987@10.x.x.x:8080/
http_proxy = http://ABC1%5Cfbbbv:India0987@10.x.x.x:8080/
ftp_proxy = http://ABC1%5Cfbbbv:India0987@10.x.x.x:8080/


export http_proxy=http://ABC1%5Cfbbbv:India0987@10.x.x.x:8080/
export https_proxy=http://ABC1%5Cfbbbv:India0987@10.x.x.x:8080/
export ftp_proxy=http://ABC1%5Cfbbbv:India0987@10.x.x.x:8080/
-----------------------------------------------------
Same in wgetrc path

https_proxy = http://ABC1%5Cfbbbv:India0987@10.x.x.x:8080/
http_proxy = http://ABC1%5Cfbbbv:India0987@10.x.x.x:8080/
ftp_proxy = http://ABC1%5Cfbbbv:India0987@10.x.x.x:8080/

pragyagupta
Posts: 10
Joined: 2018/03/06 06:53:48

Re: Not able to access internet with proxy at virtual centos 7

Post by pragyagupta » 2018/03/09 05:50:10

After this I restarted my network then it's giving error again.I don't know what is happening as I am new in centos

systemctl restart network
Job for network.service failed because the control process exited with error code. See "systemctl status network.service" and "journalctl -xe" for details.

pragyagupta
Posts: 10
Joined: 2018/03/06 06:53:48

Re: Not able to access internet with proxy at virtual centos 7

Post by pragyagupta » 2018/03/12 09:22:04

pls help me out.

hunter86_bg
Posts: 2019
Joined: 2015/02/17 15:14:33
Location: Bulgaria
Contact:

Re: Not able to access internet with proxy at virtual centos 7

Post by hunter86_bg » 2018/03/12 17:35:40

What is the output of :

Code: Select all

systemctl -l status NetworkManager
cat /etc/sysconfig/network-scripts/ifcfg-*

pragyagupta
Posts: 10
Joined: 2018/03/06 06:53:48

Re: Not able to access internet with proxy at virtual centos 7

Post by pragyagupta » 2018/03/13 06:05:23

Ran both command and getting output like that:

1.systemctl -l status NetworkManager


[root@localhost ~]# systemctl -l status NetworkManager
Unit NetworkManager.service could not be found.

2.cat /etc/sysconfig/network-scripts/ifcfg-*

cat /etc/sysconfig/network-scripts/ifcfg-*
TYPE=Ethernet
BOOTPROTO=dhcp
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
IPV6_ADDR_GEN_MODE=stable-privacy
NAME=enp0s3
UUID=
HWADDR=08:00:27:F3:BD:E2
DEVICE=enp0s3
ONBOOT=yes
DHCPV6C=yes
IPV6_PEERDNS=yes
IPV6_PEERROUTES=yes
PEERDNS=no
PEERROUTES=yes
IPV6_PRIVACY=no
TYPE=Ethernet
BOOTPROTO=dhcp
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
IPV6_ADDR_GEN_MODE=stable-privacy
NAME=enp0s3
UUID=6e0b94cd-3685-4cf4-99c9-9ad9533bbff8
DEVICE=enp0s3
ONBOOT=yes
MTU=1500
PEERDNS=yes
PEERROUTES=yes
IPV6_PEERDNS=yes
IPV6_PEERROUTES=yes
IPV6_PRIVACY=no

TYPE="Ethernet"
BOOTPROTO="dhcp"
DEFROUTE="yes"
PEERDNS="yes"
IPV4_FAILURE_FATAL="no"
IPV6INIT="yes"
IPV4_AUTOCONF="yes"
IPV6_AUTOCONF="yes"
IPV6_DEFROUTE="yes"
IPV6_PEERDNS="yes"
IPV6_PEERROUTES="yes"
IPV6_FAILURE_FATAL="no"
NAME="enp0s8"
UUID="3c36b8c2-334b-57c7-91b6-4401f3489c69"
DEVICE="enp0s8"
ONBOOT="yes"

DNS1=141.86.38.15
DNS2=146.47.243.168

PEERDNS=yes
PEERROUTES=yes
IPV6INIT=no


HWADDR=08:00:27:7C:1E:D7
TYPE=Ethernet
IPV6INIT=yes
IPV6_AUTOCONF=no
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
IPV6_ADDR_GEN_MODE=stable-privacy
IPV6_DNS_PRIORITY=100
NAME=enp0s8
UUID=def240b5-7921-40d7-b33b-e47493e24a03
DEVICE=enp0s8
ONBOOT=no
DEVICE=lo
IPADDR=127.0.0.1
NETMASK=255.0.0.0
NETWORK=127.0.0.0
# If you're having problems with gated making 127.0.0.0/8 a martian,
# you can change this to something else (255.255.255.255, for example)
BROADCAST=127.255.255.255
ONBOOT=yes
NAME=loopback

pragyagupta
Posts: 10
Joined: 2018/03/06 06:53:48

Re: Not able to access internet with proxy at virtual centos 7

Post by pragyagupta » 2018/03/13 08:39:02

Hi ,Please help me out.

hunter86_bg
Posts: 2019
Joined: 2015/02/17 15:14:33
Location: Bulgaria
Contact:

Re: Not able to access internet with proxy at virtual centos 7

Post by hunter86_bg » 2018/03/14 05:07:38

Do a restart on the network service again and check the output in '/var/log/messages' for errors.
If your network is running (got some assigned IPs /ip a s/) then proceed with the next one.
If I recall correct - you have already setup the https_proxy , so check with curl if you can access web sites via:

Code: Select all

curl https://www.centos.org
and seee if you get the website.

Post Reply