ok guys, i think i found this "way" i could call and i'd preffer to the OpenWrt coders to include some "iptables" stuff that can be controled via httpd/web
${IPTABLES} -t nat -A PREROUTING -d ${host} -j DNAT --to-destination ${destip}
${IPTABLES} -t nat -A POSTROUTING -s ${destip} -j SNAT --to-source ${host}
Like this would look a classical static nat one example:
iptables -t nat -A PREROUTING -d 192.168.1.5 -j DNAT --to-destination 212.114.65.19
iptables -t nat -A POSTROUTING -s 212.114.65.19 -j SNAT --to-source 192.168.1.5
this would look like:
root@openwrt:~# iptables -t nat -A PREROUTING -d 192.168.1.5 -j DNAT --to-destination 212.130.74.189
root@openwrt:~# iptables -t nat -A POSTROUTING -s 212.130.74.189 -j SNAT --to-source 192.168.1.5
root@openwrt:~# nvram commit
root@openwrt:~# iptables -L -t nat
Chain PREROUTING (policy ACCEPT)
target prot opt source destination
prerouting_rule all -- anywhere anywhere
DNAT all -- anywhere 192.168.1.5 to:212.130.74.189
Chain POSTROUTING (policy ACCEPT)
target prot opt source destination
postrouting_rule all -- anywhere anywhere
MASQUERADE all -- anywhere anywhere
SNAT all -- 212.130.74.189 anywhere to:192.168.1.5
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
Chain postrouting_rule (1 references)
target prot opt source destination
Chain prerouting_rule (1 references)
target prot opt source destination
root@openwrt:~#
im sure 100% that this thing will work, now my point is how do i have to setup my router in what mode coz i got options "Static IP" "DHCP" "PPPOE" and "NONE" so this will work?
I have 1 LAN Cable from my wireless Antenna, and i plug it into my "Internet" port on my WRT54G, so from that i get internet and 1 cable from my other 4 ports into switch anyone have an idea "how-would-this-work" ?
(Last edited by bx on 16 Nov 2005, 01:56)