[HELP] forward ppp0 to eth1

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

 



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
--
To unsubscribe from this list: send the line "unsubscribe netfilter" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Netfilter Development]     [Linux Kernel Networking Development]     [Netem]     [Berkeley Packet Filter]     [Linux Kernel Development]     [Advanced Routing & Traffice Control]     [Bugtraq]

  Powered by Linux