Slackware This Forum is for the discussion of Slackware Linux.
|
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.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
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.
|
|
05-01-2014, 04:10 AM
|
#1
|
LQ Newbie
Registered: Apr 2014
Posts: 25
Rep:
|
Slackware 14.1 IP-Masquerading : On startup
Hi,
How configure IP-Masquerading on startup without firewall.
Add this stance :
Code:
iptables -t nat -A POSTROUTING -o eth* -s *.*.*.*/24 -j MASQUERADE
I would like to configure it in rc.local or rc.ip_forward, is it possible or the solution is somewhere else ?
Thanks.
|
|
|
05-01-2014, 04:38 AM
|
#2
|
Senior Member
Registered: Jul 2004
Location: Jogja, Indonesia
Distribution: Slackware-Current
Posts: 4,795
|
rc.local is a good place
|
|
|
05-01-2014, 04:56 AM
|
#3
|
Slackware Contributor
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 8,559
|
If you add your firewall commands in a (new) file "/etc/rc.d/rc.firewall" and make it executable, then Slackware will run that script on boot and you don't have to change anything - it's automatic.
Code:
cat <<EOF > /etc/rc.d/rc.firewall
#!/bin/sh
# Use full path to binaries in a r script:
/usr/sbin/iptables -t nat -A POSTROUTING -o eth* -s *.*.*.*/24 -j MASQUERADE
EOF
chmod +x /etc/rc.d/rc.firewall
Note that the above instructions will overwrite an existing rc.firewall file, so be careful! If the file exists already, just add your iptables commandline to the end.
Eric
Last edited by Alien Bob; 05-01-2014 at 04:57 AM.
|
|
|
05-01-2014, 05:17 AM
|
#4
|
LQ Newbie
Registered: Apr 2014
Posts: 25
Original Poster
Rep:
|
Thank you everybody for your replies
|
|
|
05-01-2014, 05:29 AM
|
#5
|
MLED Founder
Registered: Jun 2011
Location: Montpezat (South France)
Distribution: CentOS, OpenSUSE
Posts: 3,453
|
Don't forget to activate rc.ip_forward, by the way.
Code:
# chmod +x /etc/rc.d/rc.ip_forward
|
|
|
05-01-2014, 08:01 AM
|
#6
|
LQ Newbie
Registered: Apr 2014
Posts: 25
Original Poster
Rep:
|
It works on boot after have activated rc.ip_fordward and created/activated the rc.firewall file with Alien Bob's data.
But if I want to use the rc.local file only, I must just add the stance of my initial post and active rc.ip_forward file ?
Last edited by Shkel; 05-01-2014 at 08:02 AM.
|
|
|
05-01-2014, 09:11 AM
|
#7
|
MLED Founder
Registered: Jun 2011
Location: Montpezat (South France)
Distribution: CentOS, OpenSUSE
Posts: 3,453
|
Quote:
Originally Posted by Shkel
It works on boot after have activated rc.ip_fordward and created/activated the rc.firewall file with Alien Bob's data.
But if I want to use the rc.local file only, I must just add the stance of my initial post and active rc.ip_forward file ?
|
Yes, that's a possibility.
|
|
|
05-01-2014, 09:20 AM
|
#8
|
LQ Newbie
Registered: Apr 2014
Posts: 25
Original Poster
Rep:
|
Well fine, thank you kikinovak
|
|
|
All times are GMT -5. The time now is 07:38 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|