Re: iptables? issue

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

 



 
   
This is what I did some time ago. I've not tried it with the latest iptables.
(I spun my own firewall.) REDIR is the local IP to be redirected to. And
REDIRPORT is the port to be redirected. EXTIF and INTIF are probably
obvious. (If they aren't you may need some reading time.)

/sbin/iptables -A FORWARD -p tcp -i $EXTIF -o $INTIF -d $REDIR --dport 
$REDIRPORT -j ACCEPT

/sbin/iptables -t nat -A PREROUTING -p tcp -i $EXTIF -d $EXTIP --dport 
$REDIRPORT -j DNAT --to $REDIR
/sbin/iptables -t nat -A PREROUTING -p udp -i $EXTIF -d $EXTIP --dport 
$REDIRPORT -j DNAT --to $REDIR

{^_^}


Hi JD,

That would work for incoming packets but what about outgoing packets?
i'm using

/sbin/iptables -t nat -A POSTROUTING -i $INTIF -s $REDIR -o $EXTIF -j SNAT --to $WANIP 

where $WANIP is my public ip but my machine is not connecting.
however, if i use 

/sbin/iptables -t nat -A POSTROUTING -i $INTIF -s $REDIR -o $EXTIF -j MASQUERADE

i get connected. The problem is masquerading only used the default public ip (ttbomk) and i want to use certain public ips for only certain clients and masquerading doesn't offer me that.
???

Thanks  
-- 
users mailing list
users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
Have a question? Ask away: http://ask.fedoraproject.org


[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [EPEL Devel]     [Fedora Magazine]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Desktop]     [Fedora Fonts]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Fedora Sparc]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux