Gateway VM
-
mashcaster
- Posts: 39
- Joined: 25. Dec 2008, 15:06
Gateway VM
Is it possible to setup a gateway VM in VirtualBox which will serve as a gateway server for all other VMs?
-
Sasquatch
- Volunteer
- Posts: 17798
- Joined: 17. Mar 2008, 13:41
- Primary OS: Debian other
- VBox Version: VirtualBox+Oracle ExtPack
- Guest OSses: Windows XP, Windows 7, Linux
- Location: /dev/random
Why not start yourself? If you know how to setup a gateway on a physical machine, it's not that hard to do it on a virtual one.mashcaster wrote:Please post back if you figure this out.
If you want it for your physical machines, you need HIF. Else internal networking is what you need. There are plenty of tutorials on the web which describe exactly what to do.
Read the Forum Posting Guide before opening a topic.
VirtualBox FAQ: Check this before asking questions.
Online User Manual: A must read if you want to know what we're talking about.
Howto: Install Linux Guest Additions
Howto: Use Shared Folders on Linux Guest
See the Tutorials and FAQ section at the top of the Forum for more guides.
Try searching the forums first with Google and add the site filter for this forum.
E.g. install guest additions site:forums.virtualbox.org
Retired from this Forum since OSSO introduction.
VirtualBox FAQ: Check this before asking questions.
Online User Manual: A must read if you want to know what we're talking about.
Howto: Install Linux Guest Additions
Howto: Use Shared Folders on Linux Guest
See the Tutorials and FAQ section at the top of the Forum for more guides.
Try searching the forums first with Google and add the site filter for this forum.
E.g. install guest additions site:forums.virtualbox.org
Retired from this Forum since OSSO introduction.
-
mashcaster
- Posts: 39
- Joined: 25. Dec 2008, 15:06
I have tried, but I can't get it to work.Sasquatch wrote:Why not start yourself? If you know how to setup a gateway on a physical machine, it's not that hard to do it on a virtual one.mashcaster wrote:Please post back if you figure this out.
If you want it for your physical machines, you need HIF. Else internal networking is what you need. There are plenty of tutorials on the web which describe exactly what to do.
-
Sasquatch
- Volunteer
- Posts: 17798
- Joined: 17. Mar 2008, 13:41
- Primary OS: Debian other
- VBox Version: VirtualBox+Oracle ExtPack
- Guest OSses: Windows XP, Windows 7, Linux
- Location: /dev/random
Then you can at least post what you have tried.
Read the Forum Posting Guide before opening a topic.
VirtualBox FAQ: Check this before asking questions.
Online User Manual: A must read if you want to know what we're talking about.
Howto: Install Linux Guest Additions
Howto: Use Shared Folders on Linux Guest
See the Tutorials and FAQ section at the top of the Forum for more guides.
Try searching the forums first with Google and add the site filter for this forum.
E.g. install guest additions site:forums.virtualbox.org
Retired from this Forum since OSSO introduction.
VirtualBox FAQ: Check this before asking questions.
Online User Manual: A must read if you want to know what we're talking about.
Howto: Install Linux Guest Additions
Howto: Use Shared Folders on Linux Guest
See the Tutorials and FAQ section at the top of the Forum for more guides.
Try searching the forums first with Google and add the site filter for this forum.
E.g. install guest additions site:forums.virtualbox.org
Retired from this Forum since OSSO introduction.
-
mashcaster
- Posts: 39
- Joined: 25. Dec 2008, 15:06
No prob
I installed debian etch in a VM with 2 NICs and changed the /etc/network/interfaces file to the following:
eth1 for internal connections
ifconfig returns this
returns nothing
I can connect to the internet and I can ping to this server from another VM, but I cannot get the other VM to connect to the internet via this gateway VM.
What I am doing wrong?
I installed debian etch in a VM with 2 NICs and changed the /etc/network/interfaces file to the following:
eth0 for external connectionsauto lo
iface lo inet loopback
auto eth0
iface eth0 inet dhcp
auto eth1
iface eth1 inet static
address 192.168.1.1
netmask 255.255.255.0
eth1 for internal connections
ifconfig returns this
cat /etc/resolv.conf returns:eth0
Link encap:Ethernet Hwaddr 08:00:27:6A:B4:9A
inet addr:10.0.2.15 Bcast 10.0.2.255 Mask 255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets 2 errors:0 dropped:0 overruns:0 frame:0
TX packets:2 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txquenelen:1000
RX bytes:1180 (1.1 KiB) TX bytes:684 (684.0 b)
Interrupt:11 Base address:0xc020
eth1
Link encap:Ethernet Hwaddr 08:00:27:34:99:41
inet addr:192.168.1.1 Bcast 192.168.1.255 Mask 255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets 0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txquenelen:1000
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
Interrupt:11 Base address:0xc060
lo
Link encap:Local Loopback
inet addr127.0.0.1 Mask 255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets 0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txquenelen:0
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
echo 1 > /proc/sys/net/ipv4/ip_forwardnameserver 10.0.2.3
returns nothing
I can connect to the internet and I can ping to this server from another VM, but I cannot get the other VM to connect to the internet via this gateway VM.
What I am doing wrong?
-
Sasquatch
- Volunteer
- Posts: 17798
- Joined: 17. Mar 2008, 13:41
- Primary OS: Debian other
- VBox Version: VirtualBox+Oracle ExtPack
- Guest OSses: Windows XP, Windows 7, Linux
- Location: /dev/random
What are the network settings on the other VM? How are the two VMs connected with each other?
Read the Forum Posting Guide before opening a topic.
VirtualBox FAQ: Check this before asking questions.
Online User Manual: A must read if you want to know what we're talking about.
Howto: Install Linux Guest Additions
Howto: Use Shared Folders on Linux Guest
See the Tutorials and FAQ section at the top of the Forum for more guides.
Try searching the forums first with Google and add the site filter for this forum.
E.g. install guest additions site:forums.virtualbox.org
Retired from this Forum since OSSO introduction.
VirtualBox FAQ: Check this before asking questions.
Online User Manual: A must read if you want to know what we're talking about.
Howto: Install Linux Guest Additions
Howto: Use Shared Folders on Linux Guest
See the Tutorials and FAQ section at the top of the Forum for more guides.
Try searching the forums first with Google and add the site filter for this forum.
E.g. install guest additions site:forums.virtualbox.org
Retired from this Forum since OSSO introduction.
-
mashcaster
- Posts: 39
- Joined: 25. Dec 2008, 15:06
-
chronoboy
- Posts: 89
- Joined: 21. Jul 2008, 07:11
- Primary OS: Debian other
- VBox Version: VirtualBox+Oracle ExtPack
- Guest OSses: Linux, Windows
- Location: Canada
On the Gateway VM there is more to do than just enabling the ip forwarding in the kernel. You will need to change some iptables. Read this very simple HowTo on TLDP.org for configuring your iptables on the Gateway VM:
http://www.tldp.org/HOWTO/Masquerading- ... index.html
Next, on your client VMs, the VMs which connect through the gateway, be sure to assign them each a static IP address and set their gateway IP to your Gateway VM's IP.
Some simple troubleshooting steps would be:
Good luck.
http://www.tldp.org/HOWTO/Masquerading- ... index.html
Next, on your client VMs, the VMs which connect through the gateway, be sure to assign them each a static IP address and set their gateway IP to your Gateway VM's IP.
Some simple troubleshooting steps would be:
- Can you ping the Gateway VM from the client?
When you do a ping to an outside IP address rather than domain name, does it respond?
What DNS servers are set on the client VMs?
Have you attempted a traceroute to the Host?
Good luck.
-
mashcaster
- Posts: 39
- Joined: 25. Dec 2008, 15:06