[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

iptables, virtualbox and port forwarding



Hello list.

I am trying to build a virtual network exposing servers accessible from the LAN. I have done a lot of searches on the web and it worked last week, but since then, I have restarted my computer and had the nice surprise to learn that the iptables command does not save it's configuration. I tried to retrieve my configuration, but am failing ( I tried to understand what I did with the history command, but sadly I am always working with tons of terminals and so, I suspect that it is not the correct history... ), and same to find anew the articles which actually make things working.

I had some network knowledge in the past, but never really practiced it, so I have lost almost everything. I already have used some firewalls, but those were some Windows ones ( I was not a linux user at that time ) and so I have never played with iptables.

So I ask for 2 things:
_ help on this particular problem
_ if someone knows about resources to learn and understand how exactly iptables work, this would help me a lot in the future

For my particular problem.

I have an eth0 interface, the real one, on ip 172.20.14.0/24.
I made a vlan in my /etc/network/interfaces, like this:
##############################
auto eth0.1
iface eth0.1 inet static
	address 10.10.10.1
	netmask 255.255.255.0
	vlan-raw-device eth0
##############################

On that network, I have some VMs with static IPs, and the one on which I try to make the configuration for testing and learning purpose have an apache2 server running and up ( I can query on it from my physical computer ). It is using 2 network interfaces, a NAT one and a bridge one, but for others I would like to remove the NAT one, since I need them to simulate the production servers ( which are VMs too, but my company does not control the system on which they are running. Otherwise it would have be far easier: I would have read how it does to understand things ) which only have one interface ( eth0 ).

Both LANs ( the physical one and the virtual one ) works perfectly, but now I would like to allow 2 things: _ VMs to access the physical LAN, so that they could access the apt proxy I have installed there for installing softwares and updates _ physical computers accessing VMs through some ports of my computer. For example, redirecting "172.20.14.XX:80" to "10.10.10.30:80". I will do that port forwarding for ssh ( port 22 ), http ( port 80 ) and postgresql ( port 5432 ) connections in a first time.

Thanks


Reply to: