0

I am using RHEL 7.

I am trying to ssh my VM(built in virtual box) from my host (mac) and its not working. Host is getting IP from router and is in the format of 192.168.26.xxx.
I am trying to set static IP configuration. DHCP works fine but static IP is something I am having trouble with.
I have tried the following IPs but it isn't working:

 192.168.0.xxx;
 192.168.20.xxx

and what subnet should I use. I have tried 255.255.255.0 and 255.255.0.0.

Your help will be much appreciated!

1
  • What type of networking did you selected? NAT? if so, I suggest Bridged. That will cause both the host and the guest to be on your existing LAN (192.168.26.0/24). you can set the guest IP to either be static in the .26. network, or you can configure it for DHCP so it pulls an address from your router just like the host did. Sep 22, 2015 at 20:11

1 Answer 1

1

Playing with the netmask is the wrong way to go.

The netmask is what tells the operating system what IP range is directly connected (LAN) and what is not (routed via the gateway or some other route). The 192.168.0.xxx/255.255.255.0 address says that in order to talk to 192.168.20.xxx, the station needs to go via the default gateway. On the other hand, the 192.168.20.xxx/255.255.0.0 means that a 192.168.0.xxx address is on the same subnet, that is directly connected, and it talks to it directly and not via a gateway.

The result of this is, A talks to B via gateway C, but B replies to A directly. Likewise, when B starts to converse with A it does so directly, but A responds via gateway C. This breaks the rules, and so you have no communication.

What to do: fix your netmasks, i.e. 255.255.0.0 or 255.255.255.0 on both stations, and don’t use MacVTap for networking; use just a plain bridge and everything will connect.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .