I have a host machine in Windows 7 that have a virtual box installed.
In virtual box I create a debian8 virtual machine and set a static Ip for it with the following configuration: IP: 192.168.56.101 Bcast: 192.168.56.255 Mask: 255.255.255.0 Gateway: 192.168.56.1 Network: 192.168.56.0
In the virtual machine I set the network as host only network to allow the host and virtual machine communication. The virtual box host-only network connection have the following configuration: IP: 192.168.56.1 Mask: 255.255.255.0
I think with this configurations the host and virtual machine should communicate. But I can't ping between them. When ping from one to another I always get:
Destination host unreachable.
I also have a web server in the debian8 virtual machine that is running but it also can't be used by the windows7 host machine.
There is something wrong with my networks configuration?
The IP of the debian machine is 192.168.56.101 and the subnet mask is 255.255.255.0. That means that it can directly reach addresses in the range 192.168.56.0-192.168.56.255. The gateway is at 192.168.52.1, so it can't reach it.
Nevertheless, since both machines are in the same subnet, they should be able to communicate with each other without a gateway. Check for firewalls that might block pings on both machines.
Related
I'm in the midst of a project that made to convert an existing VOIP legacy system into a dockerized form. The existing system consists of 5 different Linux machines, each machine is having 2 different network interfaces - one exposed to the public WAN, and the other is a private Lan network. I plan on creating a docker compose file for setting up the orchestration.
The network roughly looks like this:
Server #1 Eth0: IP 192.168.0.200/24 Eth1: IP X.X.X.65/27
Server #2 Eth0: IP 192.168.0.201/24 Eth1: IP X.X.X.66/27
Server #3 Eth0: IP 192.168.0.202/24 Eth1: IP X.X.X.87/27
Server #4 Eth0: IP 192.168.0.203/24 Eth1: IP Y.Y.Y.240/27
Server #5 Eth0: IP 192.168.0.204/24 Eth1: IP Y.Y.Y.241/27
Servers 1-3 are part of the same subnet, so are servers 4-5.
I am trying to find the best way to convert this network setup into docker networks, I want every container to preserve his public IP (the one on Eth1, meaning that traffic generated from the container will keep the same public IP it had on the original server), but also to be able to communicate with every other docker container on the same private net, while also keeping it easily managable and having the least overhead possible.
I've created 3 macvlan networks and 1 bridge network using docker-compose, but the problem is that DNS resolution provides every container with the IP address I gave it in the Macvlan network it belongs to, say 2 dockers were assigned to the bridge network and to the same Macvlan network, resolving each other container name will provide with their Macvlan address rather than the Bridge IP address. I would like to force communication between all containers over the BRIDGE network only (essentialy setting the Macvlan network into private mode). How can I acheieve that?
Consider using --alias with "docker network connect". Like having a dedicated name for a container within the bridge network and use that name for the internal communications
I'm looking for a way to access containers that are running on server in our company lan by domain names. By far I only managed to access them by IPs
So the setup is. Docker (for windows) is running on server srv1.ourdomain.com (Windows Server 2019), network for container is configured with l2bridge driver, container's dns name, as specifiedn in run command, is cont1. It is accessible by dns name on the docker host (srv1) and by IP from my machine.
What can I do to access the container by dns name cont1.ourdomain.com from my local machine located in the same lan?
I tried to use proxy (traefik) but it cant rewrite urls in the content, so web applications running inside the container are failing. Bacause of this I can't host multiple web application behind that proxy.
I know that it is possible to map container's port to host port and then it will be accessible from lan through the host name and host port, but applications I'm running are requiring many ports to be mapped (like 8 ports for each container) and with those containers being short-lived developer's environments it will be a hell to find a port pool when running new container.
So again if I can access container and its' ports by IP, is there a way to do the same by DNS name?
UPD1. Container host is a virtual server running on vmware. I tried to follow those recommendations and configure promiscuous mode. Thise doesn't help with dns though.
UPD2. I tried transparent network as well. For some reason DHCP can never assign propper IP and container ends up with autoconfigured ip from 168.x.x.x subnet.
You could create a transparent network and make the container discoverable on the network just like host. However, using host ports is what's recommended.
Did you try PathStrip or PathPrefixStrip with Traefik? That should let you rewrite the URLs for the backend.
Sorry for the newbie question.
I just installed Vmare workstation and created a windows server 2012 virtual machine(Set up remote desktop on the server 2012)
The virtual machine is hosted on the below Ip.
The virtual machine Ip.
Adapter settings
Nat Settings
When remote desktop from 192.168.2.120(virtual machine host) to 192.168.88.128 the remote desktop work fine , but when trying from a different PC on the same network(192.168.2.107) to remote desktop to (192.168.88.128) then remote desktop can be access.
The problem in your case is the adapter option you are using in VMWare for your Windows Server. Rather than using a NAT adapter use the Bridged option.
Your answer ends above but if you need a bit insight of your problem then you can read the further part. The NAT IP of Windows server which is the guest machine (192.168.88.128) is reachable from the host machine(192.168.2.120) just because your host machine is internally connected (via a virtual switch) to the guest machine. If you check the network adapters in your host machine then you will find an adapter which will have an IP (192.168.88.1). Your host machine is communicating with your guest machine via this adapter.
The NAT option hides your virtual machine from the physical network. If you want to reach your machine then you have to configure some routing table entries to route packets (heading towards your VM) to your host machine and then again in your host machine you have to write a static route so that the packet received on 192.168.2.120 is forwarded to 192.168.88.0/24
I would like to deploy multiple applications via docker. Some of them are using the same port.
An alternative port mapping (Port 80->5080) is not an option, so my way to handle the problem is a network bridge which should allow me to assign an ip address from my internal network to each container.
The answer from this post does not work for me
Assign LAN IP address to Docker container different from host's IP address
i am able to assign an ip to the docker container, but it also gets the host ip address so i can not map ports.
I'm running VirtualBox on a ubuntu (host), the VM i'm using is fedora (guest). VirtualBox is setup to use the NAT network adapter, and I'm able to get to the internet.
i use Port Forwarding to access ssh and the rails web server
port Forwarding Rules
<NAT>
<DNS pass-domain="true" use-proxy="false" use-host-resolver="false"/>
<Alias logging="false" proxy-only="false" use-same-ports="false"/>
<Forwarding name="Rule 1" proto="1" hostport="5679" guestport="22"/>
<Forwarding name="Rule 2" proto="1" hostport="3080" guestport="3000"/>
</NAT>
now i can access internet on guest machine , and i can logging through ssh
but i cannot access the Rails web server on port 3080
i tried :
localhost:3080
10.0.2.15:3080 #the guest IP
what i can do all i need is SSH and internet connection and open the web site i host on gust machine by Browser in host machine
thanks
Just a stab in the dark here but this might be your issue...
When you provision a new Linux Virtual Machine in VirtualBox, the Network settings for that VM are set to 'NAT'. This results in your new VM being assigned a 10.x.x.x address.
Change this setting to Bridged mode, which will assign your VM an address within the same subnet as your host (most likely 192.168.x.x).
Try to connect to the site running on your host.
If you're still not able to access the site running on localhost, confirm the app isn't blocking connections from your new VM. Add a rule in to your access list (possible iptables) permitting tcp port 80 traffic from your VM's address (found using ifconfig).
Happy hunting!
In your VB you have to set network only with host. It is in preferences->network.
Then you can access your virtual machine via 192.168.56.101 from ubuntu. Port forwarding set on this network card. List it with ifconfig. I recommend to use iptables for port redirects.