LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices

Reply
 
Search this Thread
Old 05-01-2014, 03:10 AM   #1
Shkel
LQ Newbie
 
Registered: Apr 2014
Posts: 25

Rep: Reputation: Disabled
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.
 
Old 05-01-2014, 03:38 AM   #2
willysr
Senior Member
 
Registered: Jul 2004
Location: Jogja, Indonesia
Distribution: Slackware-Current
Posts: 2,551

Rep: Reputation: 422Reputation: 422Reputation: 422Reputation: 422Reputation: 422
rc.local is a good place
 
Old 05-01-2014, 03:56 AM   #3
Alien Bob
Slackware Contributor
 
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 5,238

Rep: Reputation: Disabled
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 03:57 AM.
 
Old 05-01-2014, 04:17 AM   #4
Shkel
LQ Newbie
 
Registered: Apr 2014
Posts: 25

Original Poster
Rep: Reputation: Disabled
Thank you everybody for your replies
 
Old 05-01-2014, 04:29 AM   #5
kikinovak
Senior Member
 
Registered: Jun 2011
Location: Montpezat (South France)
Distribution: ElementaryOS, Ubuntu LTS, Slackware
Posts: 1,555

Rep: Reputation: 721Reputation: 721Reputation: 721Reputation: 721Reputation: 721Reputation: 721Reputation: 721
Don't forget to activate rc.ip_forward, by the way.

Code:
# chmod +x /etc/rc.d/rc.ip_forward
 
Old 05-01-2014, 07:01 AM   #6
Shkel
LQ Newbie
 
Registered: Apr 2014
Posts: 25

Original Poster
Rep: Reputation: Disabled
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 07:02 AM.
 
Old 05-01-2014, 08:11 AM   #7
kikinovak
Senior Member
 
Registered: Jun 2011
Location: Montpezat (South France)
Distribution: ElementaryOS, Ubuntu LTS, Slackware
Posts: 1,555

Rep: Reputation: 721Reputation: 721Reputation: 721Reputation: 721Reputation: 721Reputation: 721Reputation: 721
Quote:
Originally Posted by Shkel View Post
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.
 
Old 05-01-2014, 08:20 AM   #8
Shkel
LQ Newbie
 
Registered: Apr 2014
Posts: 25

Original Poster
Rep: Reputation: Disabled
Well fine, thank you kikinovak
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Slackware crashes on every other startup tfnc99 Slackware 7 09-14-2012 09:21 AM
slackware 10 startup script jonc Linux - Newbie 2 12-04-2004 05:02 PM
Slackware 9.0 startup keystone Linux - Newbie 2 10-31-2003 03:02 PM
Slackware StartUp skate Linux - Newbie 2 10-14-2003 05:04 AM
Slackware Startup shortbill Linux - General 1 11-21-2002 02:16 PM


All times are GMT -5. The time now is 06:34 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration