Can you please tell me how I can get this to work please? I am
using one nic card on each computer and I can ping all the ip
address on the local network.
modprobe iptable_nat
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -A PREROUTING -t nat -p tcp -d 127.0.0.1 --dport 80 -j DNAT --to
192.168.1.100:8080
iptables -A PREROUTING -t nat -p tcp -d 192.168.1.5 --dport 80 -j DNAT --to
192.168.1.100:8080
iptables -A PREROUTING -t nat -p tcp -d 127.0.0.1 --dport 53 -j DNAT --to
192.168.1.100:8080
iptables -t nat -A PREROUTING -p tcp --dport 80 -i eth0 -j DNAT --to
192.168.1.100:8080
--- Synchronet 3.15a-Win32 NewsLink 1.85
- telnet://sbbs.cyberchatnet.com:23 -
port forwading requires two rules per port, plus optional logging,
for example:
# the NAT bit
iptables -t nat -A PREROUTING -p tcp -i $xf_world \
--dport $torrent_port \
-j DNAT --to-destination $torrent_host
# the port-forward, logging
iptables -A FORWARD -p tcp -m state --state NEW \
--dport $torrent_port \
$limit_rate_log "JLE:fwd:okay ingress "
# the port-forward, action
iptables -A FORWARD -p tcp -m state --state NEW \
--dport $torrent_port -j ACCEPT
Grant.
--
http://bugsplatter.id.au
> From Newsgroup: alt.os.linux
>
> On Mon, 26 Oct 2009 21:32:46 -0400, "phil" <ph...@sbbs.cyberchatnet.com.remov
>
> --- Synchronet 3.15a-Win32 NewsLink 1.85
Can you please give me a example that I can paste and use in my script that
will work with the example that I have above?
I was reffering to a example that I can use this is script so all I have to do
is copy and paste it without making modifications to it.
modprobe iptable_nat
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -A PREROUTING -t nat -p tcp -d 127.0.0.1 --dport 80 -j DNAT --to
192.168.1.100:8080
iptables -A PREROUTING -t nat -p tcp -d 192.168.1.5 --dport 80 -j DNAT --to
192.168.1.100:8080
iptables -A PREROUTING -t nat -p tcp -d 127.0.0.1 --dport 53 -j DNAT --to
192.168.1.100:8080
iptables -t nat -A PREROUTING -p tcp --dport 80 -i eth0 -j DNAT --to
192.168.1.100:8080
Thanks
phil a ᅵcrit :
> I am trying to forward port 80 on 192.168.1.5 and 127.0.0.1 to
> 192.168.1.100:8080.
That is not very clear. Please explain what is the source host, the
original destination and the forwarding host.