Server emulation on Windows 7

Discussions related to using VirtualBox on Windows hosts.
Post Reply
Luigi
Posts: 5
Joined: 14. Sep 2013, 19:38

Server emulation on Windows 7

Post by Luigi »

I trying to set up a test environment for pfSense firewall router (a BSD distro), taking this video as a reference
http://www.youtube.com/watch?v=pW99TOu6Hes

I'm using virtual machines inside a PC connected to a physical Netgar router running OpenWRT.

I don't know if this router is inside some private network, or if it gets its IP directly from the ISP. I just know it gets its IP from the WAN.
The WAN IP I see from the router interface is something like 77.246.193.24/26, which seems a pubblic IP.
On the LAN side, the router has a static addess, 192.168.1.1, and acts as a DHCP server.

Here are some screenshots with the settings
https://docs.google.com/file/d/0ByHwj03 ... sp=sharing

In my intentions, my router and what is connected to it should act as private network.
If my router is not connected directly to the ISP, but to an internal network with, say, some device which address is 192.168.1.1, it shouldn't create any conflicts.
I hope that's what "bridging" router LAN to external WAN means in OpenWRT.
If it doesn't, then the problem could be here.

I can navigate the internet just fine, however.

Now, let's go on.
The laptop I'm using for testing the virtual machines is connected to the router by an ethernet cable.
It gets a private IP address from the router's LAN DHCP.

I used VirtualBox to run multiple virtual machines a virtual network, like in the video I referenced a post earlier.
The pfSense 2.1 machine has 2 NICs:
- 1 bridged with my real network
- 1 connected on the virtual private network (static address 192.168.1.1, DHCP server)

In my situation:
- pfSense WAN gets its IP from the physical router DHCP, in the 192.168.1.x/24 range
- pfSense LAN has its IP set as static, 192.168.1.1

In the video:
- pfSense WAN got its IP from the physical router DHCP, in the 10.0.0.0 range
- pfSense LAN had its IP set as static, 192.168.1.1

Connected to the same virtual network I have a Knoppix virtual machine.
I used it to access 192.168.1.1 (of the virtual network) and configure pfSense.
Images provided.

I can't even connect to google.com from the Knoppix machine, so something is wrong.
1) Maybe it's the DNS.
2) Maybe it's the bridged network configuration of pfSense

1) I tried changing pfSense LAN address to 192.168.1.2, but then for some reasons I can't access it anymore from the web interface.
I tried various combinations of DHCP enabled/disabled on LAN, private LAN and gateway IPs.
No way.
I should also mention that the physical router has its own settings for DNS, and they work for the laptop.

2) Maybe I should try configuring the first pfSense NIC as "NAT" instead of "bridged".
Also, "NAT" is the default option in VirtualBox, but it's not the one I use.
I still have to try that, but I have little time, so I wanted your opinion first.

Maybe you know what to do.
BillG
Volunteer
Posts: 5106
Joined: 19. Sep 2009, 04:44
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows 10,7 and earlier
Location: Sydney, Australia

Re: Server emulation on Windows 7

Post by BillG »

Internal and external or WAN and LAN are relative terms, not absolutes. If the router is connected directly to the Internet, its external or WAN address will be a public IP. However if this is an internal router (ie behind an Internet router) it will be a private IP address if the Internet router is running as a NAT router (and the Netgear sounds like a NAT device) . That will not really affect the way your router works. You can run a NAT router inside another NAT router.

What is important is that the WAN and LAN addresses must be in different IP subnets. Routers route between subnets. If everything is in the same IP subnet you don't need any routing - traffic is delivered directly.

Leave the "public"adapter set to bridged, not NAT so that it gets its IP from the Netgear. Set both the "private" NIC of the router and the NIC in the other vm to use the internal network. Make sure they are in a different IP subnet to the "public" side of the PfSense router.
Bill
noteirak
Site Moderator
Posts: 5231
Joined: 13. Jan 2012, 11:14
Primary OS: Debian other
VBox Version: OSE Debian
Guest OSses: Debian, Win 2k8, Win 7
Contact:

Re: Server emulation on Windows 7

Post by noteirak »

Luigi wrote: In the video:
- pfSense WAN got its IP from the physical router DHCP, in the 10.0.0.0 range
- pfSense LAN had its IP set as static, 192.168.1.1
This is the key part - they are on different IP ranges!
If you have both interfaces on 192.168.1.x, it will not work.
Hyperbox - Virtual Infrastructure Manager - https://apps.kamax.lu/hyperbox/
Manage your VirtualBox infrastructure the free way!
Post Reply