Linux host networking script

Discussion in 'Parallels Workstation for Windows and Linux' started by wvaladez, Apr 20, 2006.

  1. wvaladez


    I've been playing with parallels for the past few days getting it setup right. The only problem I experienced was getting networking to function correctly across multiple networks. To simplify the process and to make it easier for others in my organization to use parallels at work and home I wrote a quick bash script that automatically adds an ip forwarding rule for your current IP address so that host-only networking gets passed through to the outside world.

    Basically you just run this script instead of the parallels executable and it sets up networking for your guest OS to work properly. This is for Linux and for host only networking, not bridged. You can download the script here: (it's a .sh script)

    remember to chmod +x virtualServer to make it executable. Also, you will want to use a public DNS server in your guest OS's so you aren't having to switch your dns settings every time you switch networks. I am using but you can get a lot more if you google for public dns.

    Some caveats: This works for a machine with two network interfaces and uses the first IP that shows up in ifconfig. If you have two nics going at once you may have to edit the script to get it to work on the interface you want. The script also assumes that you have started the parallels init script. I have tested it on Gentoo and CentOS and it works great. You may have to change the host only network subnet in the script if you are using a subnet that is different from Lastly, if you are using this on a machine that uses the nat table in iptables for something other than parallels this script will flush the rules in the nat table to keep from adding identical rules every time your start up parallels. So don't go running it on your corporate linux firewall or anything.

    Keep in mind that this is a dirty hack so your mileage may vary, but it has saved me a lot of time configuring things when switching networks or trying to set somone else up with parallels.

  2. tacit_one

    tacit_one Kilo Poster

    Great script!
    Thank you!

Share This Page