In Virtualbox, trying to make an Ubuntu work as a router using IPTables

خرید بک لینک

(NOTE: all the machines in here are VirtualBox machines. Also, excuse if my english fails sometimes, is not my main language)

Hello, I'm in the middle of a project and one of the things I need to do is allow the host computer to acces the webpage in the server located in my DMZ.

Thing is, while I can access the page in the DMZ while the eth0 is active, which is NAT and already has the ports bridge done, I want the connection to go through an Ubuntu that works as a router and firewall, so the DMZ has the eth0 down and only uses the eth1 which is connected to the Ubuntu.

The Ubuntu already has an inteal eth2 (the 1 is being used for something else) and a NAT eth0. I have a script that allows the DMZ machine to get to inteet:

*nat
:PREROUTING ACCEPT [0:0]
:POSTROUTING ACCEPT [0:0]
:OUTPUT ACCEPT [0:0] 

-A POSTROUTING -o eth0 -j SNAT --to-source 10.0.2.15

COMMIT

...so for now DMZ can have access to the inteet with lynx (none of the machines has GUI, I acces them with Putty), but my host browser can't acces it.

I've already tried with:

iptables -A FORWARD -i eth0 -p tcp --dport 80 -d 192.168.2.1 -j ACCEPT

and

iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j DNAT --to-destination 192.168.2.1:80

But none of them works. Any ideas would really be appreciated, thanks.

Recent Questions...

ما را در سایت Recent Questions دنبال می‌کنید

برچسب: نویسنده: استخدام کار بازدید: 229 تاريخ: پنجشنبه 23 ارديبهشت 1395 ساعت: 1:58

صفحه بندی