I'm on CentOS 7. I'm running this command:
wget http://wordpress.org/latest.tar.gz
This is the returned output:
--2016-09-08 15:53:04-- http://wordpress.org/latest.tar.gz
Resolving wordpress.org (wordpress.org)... 66.155.40.250, 66.155.40.249
Connecting to wordpress.org (wordpress.org)|66.155.40.250|:80... failed: Network is unreachable.
Connecting to wordpress.org (wordpress.org)|66.155.40.249|:80... failed: Network is unreachable.
I'm not sure why that might be. I have access to my local network from my machine; I can install yum packages without issue.
EDIT
Result of ip route get 66.155.40.249
RTNETLINK answers: Network is unreachable
My /etc/sysconfig/network-scripts/ifcfg-eno16777736 after I edited it:
TYPE=Ethernet
BOOTPROTO="static"
IPADDR=192.168.2.100
NETMASK=255.255.255.0
NM_CONTROLLED=no
DEFROUTE=yes
PEERDNS=yes
PEERROUTES=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_PEERDNS=yes
IPV6_PEERROUTES=yes
IPV6_FAILURE_FATAL=no
NAME=eno16777736
UUID=*random*
DEVICE=eno16777736
ONBOOT=yes
With the exception of my UUID... Specifically I added: bootproto, ipadder, netmask, and nm_controlled.
This situation happens when no entry in the routing table has been found.
If you're using a laptop (with wifi and ethernet) this may happen if you dhclient -r from one interface, which can remove the default route.
Easy resolution:
make a new dhcp request (optionally release the current lease)
add the default route by hand: ip route add default via <<GW ip>>. If you have several interfaces, you may need to specify the output interface using ip route add default via <<GW ip>> dev <<devname>> instead.
Related
my client machine has syslog-ng and my remote machine has rsyslog configuration.
my server/remote machine manages many clients and I need to differentiate which machine is sending which logs.
normally I would use syslog-ng on the server side but these machines aren't meant to have them.
Also would like to mention it isn't for apache or web servers just physical machines.
On the client's side
Tried altering and adding different options or changing them to yes/no respectively.
options {
keep_hostname(yes);
create_dirs(no);
use_dns(no);
};
for eg:keep_hostname to no, it worked but only when I changed the hostname to the machine's ip address. which is not what I want.
Using a template
template("$(ISODATE) $(FULLHOST_FROM) $(SOURCEIP) $(HOST) $(HOSTNAME) ${PROGRAM}: ${MESSAGE}\n")
output:
day time localhost abc[ID] .source.s_local SourceIP=127.0.0.1 localhost localhost (root) CMD (xyz.conf)#ID
this isn't the output I want, it is printing in the message section when I want it in the place of the "host" and I don't understand how the source ip is the loopback address.
Using structured logging
rewrite r_sourceip{
set('${SOURCEIP}' value(HOST));
};
log { source(s_local); rewrite(r_sourceip);destination(d_syslog_tcp); };
output:
and the ip is displayed in the logs as the loopback address instead of the machine ip.
day date time 127.0.0.1 syslog-ng.service: Succeeded.
Tried installing rsyslog on my client but it doesn't work
sudo add-apt-repository ppa:adiscon/v8-stable
sudo apt-get update
sudo apt-get install rsyslog
I kept running into many errors, fixing them was impossible due to the difference in OS version or type maybe.
add apt repository command not found
wget command not found
On the server's side
Using a template
which creates a folder with the client's hostname and stores the logs in that particular folder.
not the solution I want.
$template DynaFile,"/var/log/%FROMHOST-IP%/%syslogfacility-text%.log"
*.* -?DynaFile
I want the logs to appear as such
day date time `client's ip address` syslog-ng.service: Succeeded.
Can someone suggest me a solution and why I keep getting the loopback address as my client's ip?
I am facing one error while installing FCL-CLI on my system (linux).
The command I have used is : sh -ci "$(curl -fsSL https://raw.githubusercontent.com/onflow/flow-cli/master/install.sh)" .
Error: curl: (28) Failed to connect to raw.githubusercontent.com port 443...NEED HELP!
Set DNS 8.8.8.8 in network will resolve this
Faced the same issue while trying to install nvm on ubuntu. Following steps solved my issue:
1)Open the /etc/hosts file using
$ sudo nano /etc/hosts
2)Enter your password.
3)Add the following IP address at the end of the file:
185.199.108.133 raw.githubusercontent.com
4)Save and close the file.
5)Now Try installing Again.
This my fix your problem.
Change from network in setting.
Open the /etc/hosts file using
$ sudo nano /etc/hosts
and then add following IP
185.199.108.133 raw.githubusercontent.com
save it and reinstall it again
For Windows Users:
Go to the Control Panel.
Click Network and Internet > Network and Sharing Center > Change adapter settings.
Select the connection for which you want to configure Google Public DNS. For example:
3.1 To change the settings for an Ethernet connection, right-click the Ethernet
interface and select Properties.
3.2 To change the settings for a wireless connection, right-click the Wi-Fi
interface and select Properties.
If you are prompted for an administrator password or confirmation, type the password or provide confirmation.
Select the Networking tab. Under This connection uses the following items, select Internet Protocol Version 4 (TCP/IPv4) or Internet Protocol Version 6 (TCP/IPv6) and then click Properties.
Click Advanced and select the DNS tab. If there are any DNS server IP addresses listed there, write them down for future reference, and remove them from this window.
Click OK.
Select Use the following DNS server addresses. If there are any IP addresses listed in the Preferred DNS server or Alternate DNS server, write them down for future reference.
Replace those addresses with the IP addresses of the Google DNS servers:
For IPv4: 8.8.8.8 and/or 8.8.4.4.
For IPv6: 2001:4860:4860::8888 and/or 2001:4860:4860::8844.
For IPv6-only: you can use Google Public DNS64 instead of the IPv6 addresses in the previous point.
Test that your setup is working correctly; see Test your new settings.
Repeat the procedure for additional network connections you want to change.
Ref: [https://developers.google.com/speed/public-dns/docs/using][Configure your network settings to use Google Public DNS]
Use a VPN or go to 1.1.1.1 in your browser and use WRAP by Cloudflare. Worked for me 👍
It's OK to ping IP address.
picture about ping and cat /etc/resolve.conf
I can ping 8.8.8.8, so the DNS server is OK to reach, and /etc/resolv.conf edited correctly. But I just can't ping domain. I've tried shutdown firewall but failed. Too strange, I used service iptables stop and iptables was still there.
Two problems:
1. unknown host
2. stop iptables failed.
Anyone can tell me how to fix these?
I solved this problem by accident and I don't know if it's copyable, but I need to write it down.
1. I set /etc/hosts to run command `yum install bind-utils`.
2. then, I run command `dig +trace www.baidu.com` to find out why ping fail.
then, miracle happens. I can ping domain again. The problem solved magically just as it occurred.
I'd like to use forticlientsslvpn on Cent OS 7 through a proxy but it doesn't work with a message "Can not connect to proxy" or "Can not resolve proxy address". I guess it needs some dependent libraries but I don't know them.
I downloaded the latest Forticlient SSLVPN 4.4.2329-1 64bit from here. (I installed it on debian then copied the forlder(/opt/forticlientsslvon) to the clean Cent OS 7.)
Both forticlientsslvpn CLI and GUI failed on the same error. This is the result of the cli command.
[root#cent7 /]# cd ~/forticlient-sslvpn/64bit/
[root#cent7 /]# ./forticlientsslvpn_cli --proxy 10.0.0.73:3128 --server 203.0.113.1:10443 --vpnuser myuser
Password for VPN:
STATUS::Setting up the tunnel
STATUS::Connecting...
NOTICE::Can not connect to proxy.
STATUS::Set up tunnel failed
SSLVPN down unexpectedly with error:2
Press Ctrl-C to quit
Clean up...
# Another proxy variable
[root#cent7 /]# ./forticlientsslvpn_cli --proxy http://10.0.0.73:3128 --server 172.17.97.85:10443 --vpnuser myuser
Password for VPN:
08/19/2016 18:19:26 [23461] can not resolve name http://10.0.0.73
Init SSLVPN error:Can not resolve proxy address
# Check the proxy connection
[root#cent7 /]# telnet 10.0.0.73 3128
Trying 10.0.0.73...
Connected to 10.0.0.73.
Escape character is '^]'. # OK
# Check DNS
[root#cent7 /]# nslookup 10.0.0.73
Server: 10.0.0.70
Address: 10.0.0.70#53
Non-authoritative answer:
73.0.0.10.in-addr.arpa name = dns.example.com.
Of cource my forticlient on windows in the same network works with the proxy to the server. And FireFox/wget on this Cent OS 7 server works with the proxy. Does anyone know anything about "Can not connect to proxy" error?
My IP was wrong and needed ip route add
Although the error message was "Can not connect to proxy", my destination forti IP was wrong. It was connected after I fixed it.
One more thing, I noticed a confusing point. I have two proxies like a socks proxy and a web proxy at this time. I knew ssl-vpn uses only web connections but I guessed forticlient might use ssh command during the connection. But it didn't. Forticlient_sslvpn needs only a web proxy so we just need to fill the proxy form of forticlient with a web proxy's url.
And one more thing. After I connected to ssl-vpn, it doesn't work perfectly because I can ping to internal server but not to DMZ(Of course my windows forticlient works well for both). I added ip route to DMZ and it started to work.
ip route add 192.168.3.0 via 10.0.0.5
I guessed this GW 10.0.0.5 is not the same everytime and every machine so I made the dynamic command.
ip route add 192.168.3.0/24 via $(ip route | grep 10.0.0 | awk '{print $3}' | head -1)
I hope this helps someone.
I have configured ProxyChains to use 127.0.0.1:1080 as the only socks server. All the DNS requests are proxied through the above server.
I am able to use Firefox with ProxyChains properly, but there is some issue with wget. Whenever I use proxychains wget it first tries to connect to my university's proxy server and then it tries to connect to my local proxy server.
The output of the command proxychains wget www.google.com is as follows:
ProxyChains-3.1 (http://proxychains.sf.net)
--2010-11-26 22:14:38-- http://www.google.com/
Resolving **********... |DNS-request| **********
|D-chain|-<>-127.0.0.1:1080-<><>-4.2.2.2:53-<><>-OK
|DNS-response|: ********** is not exist
failed: Unknown error.
wget: unable to resolve host address `**********'
********** above represents my university's proxy server host name.
in file /usr/lib/proxychains3/proxyresolv
change 4.2.2.2 to 8.8.8.8
or use env PROXYRESOLV_DNS
also you can make proxychains doesn't proxy DNS request,
in proxychains.conf comment the proxy_dns setting
My Problem was resolved after becoming root ("sudo sh") and executing the same command.
Running the command as proxychains sudo wget google.com worked.
You may want to try defining your proxy's address with a shell environment variable. There's a brief section in the wget manual on configuring for proxies.