Monday, August 20, 2007

Mac + Parallel + Ubuntu + wm6 net access

My major web development platform is Kubuntu, which I installed inside Parallels. Since I want to freely test the web application in any of my machines, I choose bridged networking (both macbook and Kubuntu are set to using static IP addresses). On the other hand, my Macbook can access the net through shared networking of my U1000, which provides the HSDPA connectivity to it. I have two problems to solve for the above setup:

1. When I am on the go, since my ethernet is unplugged, my Macbook cannot ssh to my Kubuntu.

2. And of course, my Kubuntu can't access the net, even my Macbook is connected with my U1000.

Recently, I have found a solution. But before this, I need to say something about my home networking configuration first. I have Linux server at home, acting as NAT gateway for all the machines inside my house. The Linux server has 2 ethernet cards, one connected with modem from ISP, the other connected to internal LAN. I don't have DHCP server setup, as I want to have more control on IP on each machine. Say my network is 192.168.0.0, my Linux server is having IP 192.168.0.1. So every machine in my LAN is setting 192.168.0.1 as gateway and DNS server. This includes the setting for my Macbook and the Kubuntu VM.

You may wonder why I need to setup my home networking this way instead of all set to DHCP. The major reason is this setup is exactly the same as in my working area. So my Macbook (or whatever mobile devices that I brought between my working area and home) doesn't need to change anything for joining the network of two places. Another reason is I usually like to remote access any other machine from another machine at home (mostly due to my physical laziness). So I don't want my home computers to change IP time to time.

Anyway, Below is my solution on the go:

1. During on the go, change the Kubuntu networking inside Parallels from "bridge networking" to "host guest".

2. In Macbook -> Preference -> Network, Create a new location profile, say "OnTheGo". In this profile, edit the "Parallels Host-Guest" device to have the IP address of the gateway address being used by Kubuntu. (In my case, it is 192.168.0.1)

3. In Macbook -> Preference -> Sharing -> Internet, set

Share your connection from "Bluetooth PAN" to ethernet Adaptor (en?) of "Parallels host-guest"adapter.

After the above is set, you should already be able to perform any networking operations from Macbook to the Kubuntu. After you have connected the Macbook with wm6 through BT PAN, the Kubuntu will be able to access the net also.

When I am back to home, I just need to change the Location setting back to default (or whatever used at home), and Parallels setting back to "bridge networking". This way, the "Parallels host-guest" adapter's IP address won't get conflict with my Linux server.

No comments: