Can't access internet from Vagrant libvirt VM - vagrant

So, I setup a Vagrant libvirt VM, but I can't access internet using it. I can reach google.com from the host but not from the guest.
/home/vagrant# ping www.google.com
PING www.google.com (64.233.177.105) 56(84) bytes of data.
^C
--- www.google.com ping statistics ---
4 packets transmitted, 0 received, 100% packet loss, time 3075ms
nslookup shows this:
/home/vagrant# nslookup www.google.com
Server: 127.0.0.53
Address: 127.0.0.53#53
Non-authoritative answer:
Name: www.google.com
Address: 64.233.177.104
Name: www.google.com
Address: 64.233.177.106
Name: www.google.com
Address: 64.233.177.103
Name: www.google.com
Address: 64.233.177.147
Name: www.google.com
Address: 64.233.177.99
Name: www.google.com
Address: 64.233.177.105
Name: www.google.com
Address: 2607:f8b0:4002:805::2004
I tried with nslookup www.google.com 8.8.8.8 as well, but it didn't do anything. Any idea how to resolve this? TIA.

Related

Windows network folders across routers

Case 1 (Three routers, not ok)
Router1 WAN(Internet)
Router1 LAN: 10.0.0.1
Windows Server: 10.0.0.3
Router2 WAN: 10.0.0.2
Router2 LAN: 172.16.1.1
Router3 WAN: 172.16.1.2
Router3 LAN: 192.168.1.1
PC: 192.168.1.2
PC can ping 10.0.0.3 Windows Server, but cannot open network folders.
Case 2 (Two routers, ok)
Router1 WAN(Internet)
Router1 LAN: 10.0.0.1
Windows Server: 10.0.0.3
Router2 WAN: 10.0.0.2
Router2 LAN: 172.16.1.1
PC: 172.16.1.2
PC can open network folders.
Question:
Why case 1 not ok, but case 2 ok? Should I do some port mapping on case 1's router2 or router3?
Problem solved. Router3, internet ok, but network folders not ok. Find another router replace it, works!

Bind the ip adresses with the hosts using socat command

I have squid proxy installed in my server, and I want to bind the ip adresses with the hosts I want to connect to them.
How can I do it with socat command?
Example :
prox_IP : 1.1.1.1
proxy_port : 1111
host_to_connect: 2.2.2.2
port_to connect: 2222
How can I connect to 2.2.2.2:2222 connect like my address IP is 1.1.1.1:1111?

mongod Failed to obtain address information for hostname OS X

Having an issue starting mongo using mongod --dbpath. I get the following error:
NETWORK [HostnameCanonicalizationWorker] Failed to obtain address information for hostname ##########: nodename nor servname provided, or not known
Host name only has latin characters. I've tried multiple networks, deleted all DNS entries, confirmed my /etc/hosts looks fine and now I'm at a standstill.
Here is my /etc/hosts:
##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting. Do not change this entry.
##
127.0.0.1 localhost
255.255.255.255 broadcasthost
#::1 localhost
Try enabling the ipv6 and restart the mongod server
::1 localhost
I followed the answer in this JIRA ticket.
And here is my /etc/hosts file.
1 ##
2 # Host Database
3 #
4 # localhost is used to configure the loopback interface
5 # when the system is booting. Do not change this entry.
6 ##
7 # 127.0.0.1 localhost
8 127.0.0.1 localhost localhost.localdomain
9 255.255.255.255 broadcasthost
10 # ::1 localhost
change your HOSTNAME in /etc/sysconfig/network likes:
HOSTNAME=Steven
Then change your hostname in /etc/hosts:
127.0.0.1 localhost localhost.localdomain ...............
to
127.0.0.1 localhost Steven ...............

Cannot block specific websites

I've been able to block Youtube and Facebook sites, but not amazon or google. Why? Seems these two websites have something different. Thanks
Bernardos-MacBook-Pro:~ bernardo$ sudo nano /etc/hosts
##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting. Do not change this entry.
##
127.0.0.1 localhost
255.255.255.255 broadcasthost
::1 localhost
127.0.0.1 www.youtube.com
127.0.0.1 http://www.amazon.es
127.0.0.1 https://www.google.es
127.0.0.1 www.facebook.com
try it without http:// like on facebook and youtube

How to redirect a website

Within the /etc/hosts file you can block traffic via
##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting. Do not change this entry.
##
127.0.0.1 localhost
255.255.255.255 broadcasthost
::1 localhost
fe80::1%lo0 localhost
# Block Adobe Activation
127.0.0.1 activate.adobe.com
127.0.0.1 practivate.adobe.com
127.0.0.1 ereg.adobe.com
127.0.0.1 activate.wip3.adobe.com
127.0.0.1 wip3.adobe.com
127.0.0.1 3dns-3.adobe.com
127.0.0.1 3dns-2.adobe.com
127.0.0.1 adobe-dns.adobe.com
127.0.0.1 adobe-dns-2.adobe.com
127.0.0.1 adobe-dns-3.adobe.com
127.0.0.1 ereg.wip3.adobe.com
127.0.0.1 activate-sea.adobe.com
127.0.0.1 wwis-dubc1-vip60.adobe.com
127.0.0.1 activate-sjc0.adobe.com
127.0.0.1 hl2rcv.adobe.com
#127.0.0.1 reddit.com
#127.0.0.1 www.reddit.com
However I want to redirect these websites to another website I have online informing the user this is blocked content
You cannot redirect to a website per se - the only think you can try is to get the ip address the website is hosted on and if the server is set to handle the request, it will work. That means it's not going to work on shared servers that has one IP.
For more sophisticated redirect, you have to use other solution.
Instead of setting those IPs to 127.0.0.1 set them to the IP of the "Sorry, blocked" server

Resources