VMWare on Windows - Disabling Internet for CentOS7 VM without disabling network access - network-programming

I need two things:
Disabled Internet access on my VM.
Enabled local network access from my VM.
I'm currently trying to replicate a bug on my CentOS7 VM which requires that I have no direct internet access, only able to connect to the web through a proxy on my local network. I've taken two paths to this so far:
Disable the Internet on my Windows machine. Why this didn't work: My VM just...froze until the internet was turned back on. Currently considering looking into the possibility of a daemon and disabling it.
Disable Internet access only on my VM. This hasn't worked yet. It's the path I'm taking right now, but everything I've tried has done the same as the above: frozen my VM, only this time in order to get it back I need to shut it down completely and restart it. Given that I have to mount drives on it to do what I need to do, it's understandable that this is a less than ideal approach. Below are images of my NAT settings and the in-VM Network UI.
I've also gone in and turned on Airplane Mode, disabled the IPv4 and IPv6 manually, and went through all the network settings to see what there was. A Google search turned up nothing except an OSX-specific workaround which I couldn't replicate on my system.
Does anybody have any suggestions?
EDIT:
The above still applies, but I'm trying to take another route to #2. What I'd like to do is shut down all traffic to my VM except from the proxy and network. However, my network is accessible only through my host machine, so I don't want to shut my host machine out entirely, just internet coming from it. Any thoughts?

You could achieve the desired effect by disabling the nameserver configuration.
Just empty the /etc/resolv.conf file (of course after making a backup for later).

Related

How do I check why my internet is only half working?

My internet is only working for heavily cached sites. Reddit, Gmail, Facebook, etc. The odd thing is, sites like Reddit make queries to non-reddit sites to import the images and they pop up fine when viewing from there, but when I get sent to out.reddit.com and then if I go elsewhere to other non-heavily cached sites, I get timed out connection error.
I can't even visit SpeedTest.net because it times out. I also can't even post a question on StackExchange because of it. What could possibly be going on and how to I debug?
EDIT: I had an inclination that it had to do with Docker. I removed all traces using a powershell script and through remove programs and still didn't work.
user3654055 are friends IRL and we debugged this in person.
It's always best to start from layer 1 and work our way up.
user3654055's computer could connect to wireless networks. This tells us layers 1 and 2 are working
.
user3654055's computer received a DHCP lease. Further testing of layer 3 showed inconsistent results with pinging local IP addresses.
I ran route print to print all routes. This produced a huge amount of output.
Normal output for a Windows computer connected to a flat LAN should produce perhaps 3 routes.
user3654055 had recently installed Docker and attempted to set up a private
internal network for the containers on their PC.
user3654055 had created two virtual networks (one internal vEthernet switch, one external vEthernet switch), a NAT interface, and bridged the wireless adapter to one of those interfaces and had not set up routing correctly for any traffic.
This produced the above scenario where certain traffic was routed correctly or hit the cache and the page would load, but most traffic was routed incorrectly and resulted in a timeout.
Disabling all the vEthernet switches and the NAT interface and removing the wireless adapter from the bridge let the user use their wireless card again.
The above configuration could work if the user set up routing correctly by hand, but we can save that for a later date.
Sounds like a DNS issue...do you know what you are using as a DNS address? You could try using Google's which is 8.8.8.8 for primary and 8.8.4.4 for secondary. Failing that does it get better following a router reboot?
To debug your internet connection, I would at first check what happens with tracert.
Traceroute command shows you the path taken by your packets and its latency from hop to hop.
From console (linux) or from cmd (windows)
tracert stackoverflow.com
this shows you where you are lagging, the first entry may be your router IP. If the first entry appears with high latency try to reboot your router.
Checking for DNS Issues
Try to use nslookup. This is what you should get:
nslookup stackoverflow.com
Server: UnKnown
Address: 192.168.1.1
Risposta da un server non autorevole: //italian comment
Nome: stackoverflow.com.home
Address: 54.72.52.58
if this fails or replies with high latency try to change your DNS to Google DNS.
Primary DNS: 8.8.8.8
Secondary DNS: 8.8.4.4

Docker: get access to wifi interface

I am pretty new to docker. At the moment I want to maintain a network of different Rapsberry PIs. Each PI should have the same OS with exactly the same system running. To handle deployment and updates of Software, I want to handle these things by docker.
Currently I am using HypriotOS, which offers docker on their Images.
My Main goal is to run an applocation in the docker containers, which need to access the wifi interface directly. The pure network access won't be enough, there needs to be deeper access like changing the wifi mode (Monitor Mode).
Long Story short: is it possible to passthrough an USB WiFi card directly to the docker Container, that it appears as wlan0 interface? Or are there other ways that you can think of?
Thanks for your answers in advance!
Take a look at the privileged flag for your container, it will give you full access to the devices on the system. See the Docker Run Documention for more information.

How can Wireshark effect network traffic?

On our team we have a standardized development setup where we have a Win8 workstation with various VMs running on Hyper-V. All development takes place on a VM.
I was having an issue where I couldn't check out a project from a Team Foundation Server using VS2012, it would start checking out, but then the connection drops. I fired up Wireshark to check what's happening, but then it worked fine. I double checked:
When Wireshark(or rather WinPcap which is doing the actual capture), running on the workstation, is capturing packets from the VM's virtual NIC, everything works fine.
As soon as I stop the capture, TFS can't check out.
So I can't even properly inspect the network traffic to diagnose the issue, because the act of inspecting traffic changes it. Heisenberg would be proud!
I thought it might be an issue with Wireshark overriding some check-sum offloading settings, but it seems not to be the case.
So what else can be affected by running Wireshark? I rather thought that the point of packet sniffers is that they don't change the packets as they capture them.
That means you are picking traffic that normally would not be picked by the vmnic.
Try to check on mac address level what is happening. Maybe mac address conflict between VMs ?
ps. You can whireshark without promiscuous mode. The the Heisenberg rule should not apply :)

Accessing a local system from outside

I have a local network at my home and have a system addressed at 192.168.2.2 in the local network. I want to access this local system from outside(of course I am aware of the Global IP) using both ssh and using URL. How can I do it? (Apache is installed in my system.)
There are few posiblities.
First if you are targeting specific computer outside your home network and this computer has known IP you can initiate connection from your home PC to this computer using some program like Putty.
If you want to access your computer from anywhere at any time, than some kind of service should be used, google for "dynamic DNS free". Depending on your Internet connection you will make changes on your PC on your Router.
To acces SSH from outside you need to portforward that port.
See http://en.wikipedia.org/wiki/Port_forwarding for more information

Sharing localhost with ipad over wifi

I really have no idea how to ask this, so with that have no idea where to search either. So.. I have a unique situation I think.
I have virtual box installed, with a local running server on it. I access it through my windows machine the host machine rather. via 127.0.0.1:3001. So I am here developing an app that can only be hosted on the virtual machine, as there are a lot of moving parts specific to it that can't be hosted on a WAMP or even a typical web-server elsewhere. The vm OS is Ubuntu. So here I am with a slight issue I want to see how this looks on my iPad, and a couple other tablets as the software being built into the VM is browser based as far as the GUI goes.
So theres the pretense. Heres the delima I want to use the built in browser on ipad to navigate to the browser based portion of my app on the VM like I can do through the Host machine. But Im not entirely sure how to achieve that. Its gotta be done over Wifi but what would I need to do to set that up accordingly?
Host Machine is Windows 7 Ultimate, VM is Ubuntu 10.x. This is not a screen sharing notion either. I don't want a to remote view the PC I want to type in the equivilant of 127.0.0.1:3001 into my ipad browser and view the service like I do vm to host machine.
Change network virtual card on virtual machine parameters. You should select 'bridget' card insteat NAT or Host only. In this way virtual machine get a network IP and you can connect to this IP from your IPAD.
Forward works great for things like this https://forwardhq.com/

Resources