title: how to network to and from local VM (fusion) with fixed IP on mac os host
body: <p>I am running a VM (Debian) on MacOs using VMware Fusion. The VM has fixed IP address (required) and the networking is bridged. It all works very well in my local network under 192.168.1.XXX ip range. The problem is when I leave home and connect to internet via 4G or some public wifi etc. In this situation my Host OS (Mac) obviously gets a different ip address and the VM (Debian) becomes inaccessible from the host mac os. I would really like to be able to keep the VM on the fixed 192.168.1.XXX address even outside of my home network. <strong>That is to be able to connect to the guest from the host and also to connect from the guest to the outside internet</strong> (as I am able to do when on the home network). Could you please advise on ways how to achieve that. Thank you.</p>
  
  <p><strong>EDIT1:</strong>
  More googling gained <a href="https://docs.vmware.com/en/VMware-Fusion/10.0/com.vmware.fusion.using.doc/GUID-C5837B81-9509-4F1B-9572-0EC0CFA87563.html?hWord=N4IghgNiBcIMICcCmYAuBLAdgcwARwFcBnVAewFtcA5JVAd1IQGsiQBfIA" rel="nofollow noreferrer">this link</a> .. I followed the steps and created adapter as per the <a href="https://i.stack.imgur.com/URY6x.png" rel="nofollow noreferrer">screenshot attached</a>. I am now able to ssh to the VM from the MacOs host (progress!), however the connectivity from the Debian VM to the internet still does not work. Ping 8.8.8.8 fails. My network setup on the Debian VM is:</p>
  
  <p>/etc/network/interfaces:</p>
  
  <pre><code>auto lo
  iface lo inet loopback
  allow-hotplug eth0
  iface eth0 inet static
      address 192.168.1.177
      netmask 255.255.255.0
      gateway 192.168.1.1
  </code></pre>
  
  <p>/etc/resolv.conf:</p>
  
  <pre><code>nameserver 192.168.1.1
  nameserver 8.8.4.4
  </code></pre>
  
  <p><strong>EDIT2:</strong></p>
  
  <p>netstat -nr on the host:</p>
  
  <pre><code>Destination        Gateway            Flags        Refs      Use   Netif Expire
  default            172.20.10.1        UGSc          141       64     en0
  127                127.0.0.1          UCS             0        0     lo0
  127.0.0.1          127.0.0.1          UH              5      420     lo0
  169.254            link#10            UCS             0        0     en0      !
  172.16.37/24       link#19            UC              2        0  vmnet1      !
  172.16.37.255      ff:ff:ff:ff:ff:ff  UHLWbI          0        9  vmnet1      !
  172.20.10/28       link#10            UCS             1        0     en0      !
  172.20.10.1/32     link#10            UCS             1        0     en0      !
  172.20.10.1        XXXXXXXXXXXXXXXXX  UHLWIir        56      440     en0   1192
  172.20.10.6/32     link#10            UCS             0        0     en0      !
  172.20.10.15       ff:ff:ff:ff:ff:ff  UHLWbI          0        9     en0      !
  192.168.1          link#20            UC              2        0  vmnet3      !
  192.168.1.177      0:50:56:35:35:b    UHLWIi          2      756  vmnet3   1180
  192.168.1.255      ff:ff:ff:ff:ff:ff  UHLWbI          0        9  vmnet3      !
  192.168.114        link#21            UC              2        0  vmnet8      !
  192.168.114.255    ff:ff:ff:ff:ff:ff  UHLWbI          0        9  vmnet8      !
  224.0.0/4          link#10            UmCS            2        0     en0      !
  224.0.0.251        1:0:5e:0:0:fb      UHmLWI          0        0     en0
  239.255.255.250    1:0:5e:7f:ff:fa    UHmLWI          0       54     en0
  255.255.255.255/32 link#10            UCS             1        0     en0      !
  255.255.255.255    ff:ff:ff:ff:ff:ff  UHLWbI          0      128     en0      !
  </code></pre>
  
  <p>According to the VMware <a href="https://pubs.vmware.com/workstation-9/index.jsp?topic=%2Fcom.vmware.ws.using.doc%2FGUID-A1D6B380-680B-46A8-A70D-572562EB935E.html" rel="nofollow noreferrer">docs here</a>, the ping from the guest to the outside should "just work" in this setup, but it does not.</p>