Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Hello,
I had a gateway linux, my other PC runs mailserver ,
at the local network, when I go to http://192.168.10.10 I get the login to webmail,
the gateway had public IP, I want users over Internet which go to http://PUBLICIP:3000 or any other port to be able to view this mail server.
Any help?
Thanks
echo " External interface: $EXTIF"
echo " External interface IP address is: $EXTIP"
echo " Loading proxy server rules..."
# Clearing any existing rules and setting default policy
iptables -P INPUT ACCEPT
iptables -F INPUT
iptables -P OUTPUT ACCEPT
iptables -F OUTPUT
iptables -P FORWARD DROP
iptables -F FORWARD
iptables -t nat -F
# FWD: Allow all connections OUT and only existing and related ones IN
iptables -A FORWARD -i $EXTIF -o $INTIF -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A FORWARD -i $INTIF -o $EXTIF -j ACCEPT
# Enabling SNAT (MASQUERADE) functionality on $EXTIF
iptables -t nat -A POSTROUTING -o $EXTIF -j MASQUERADE
if [ $? -eq 0 ]
then
echo " Proxy server rule loading complete"
fi
If you want to config the same as the script of user 'cbtshare' does.
Edit /etc/sysconfig/iptables
and /etc/sysconfig/ip6tables
If your IP tables have been generated, use system-config-firewall or other system rather then modify those files directly.
Also tools like system-config-firewall or system-config-firewall-tui have GUI or TUI interface to easy set up NAT.
also modify /etc/sysctl.conf
if ip_forwarding is not enable by default
net.ipv4.ip_forward = 1
...
# FWD: Allow all connections OUT and only existing and related ones IN
iptables -A FORWARD -i $EXTIF -o $INTIF -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A FORWARD -i $INTIF -o $EXTIF -j ACCEPT
# Enabling SNAT (MASQUERADE) functionality on $EXTIF
iptables -t nat -A POSTROUTING -o $EXTIF -j MASQUERADE
if [ $? -eq 0 ]
then
echo " Proxy server rule loading complete"
fi
else
echo "You need to enter two names,your internal connection name eg(etho) first, then your external connection eg(eth1), example ./scrptname eth0 eth1
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.