* [HELP] forward ppp0 to eth1
@ 2009-11-05 13:32 Sandy Sumitro
2009-11-06 15:59 ` Gáspár Lajos
0 siblings, 1 reply; 2+ messages in thread
From: Sandy Sumitro @ 2009-11-05 13:32 UTC (permalink / raw)
To: netfilter
Dear All,
My current situation:
I have one computer:
- eth0 -> connected to and dial DSL modem (pppoe), no IP
- eth1 -> connected to LAN, IP: 192.168.1.251
- ppp0 -> up after dialup (dynamic IP)
I have another computer with IP: 192.168.1.252
What i want is:
- i want to redirect all request to ppp0 to eth1, which will forward
to another computer (192.168.1.252).
I am using these rules, but not working:
iptables -F INPUT
iptables -F OUTPUT
iptables -F FORWARD
iptables -P INPUT ACCEPT
iptables -P OUTPUT ACCEPT
iptables -P FORWARD ACCEPT
iptables -t nat -F
iptables -t nat -A PREROUTING -i ppp0 -j DNAT --to-destination 192.168.1.252
iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE
iptables -t nat -A POSTROUTING -s 192.168.1.252 -o ppp0 -j MASQUERADE
PS: i have set /proc/sys/net/ipv4/ip_forward to 1
(echo 1 > /proc/sys/net/ipv4/ip_forward)
Please help.
Best regards,
Sandy
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [HELP] forward ppp0 to eth1
2009-11-05 13:32 [HELP] forward ppp0 to eth1 Sandy Sumitro
@ 2009-11-06 15:59 ` Gáspár Lajos
0 siblings, 0 replies; 2+ messages in thread
From: Gáspár Lajos @ 2009-11-06 15:59 UTC (permalink / raw)
To: Sandy Sumitro; +Cc: netfilter
Hi,
Sandy Sumitro írta:
> iptables -F INPUT
> iptables -F OUTPUT
> iptables -F FORWARD
> iptables -P INPUT ACCEPT
> iptables -P OUTPUT ACCEPT
> iptables -P FORWARD ACCEPT
> iptables -t nat -F
> iptables -t nat -A PREROUTING -i ppp0 -j DNAT --to-destination 192.168.1.252
> iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE
> iptables -t nat -A POSTROUTING -s 192.168.1.252 -o ppp0 -j MASQUERADE
>
>
Seems good... Except the last rule is not going to get hit by any
packet... :D
> PS: i have set /proc/sys/net/ipv4/ip_forward to 1
> (echo 1 > /proc/sys/net/ipv4/ip_forward)
>
>
Good... :D
1. Check the default gateway setting on the DMZ (1.252)
2. Check the routing on gateway (1.251)
3. Setup a firewall on DMZ too !!!
Swifty
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-11-06 15:59 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-05 13:32 [HELP] forward ppp0 to eth1 Sandy Sumitro
2009-11-06 15:59 ` Gáspár Lajos
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).