LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-16-2010, 10:30 AM   #1
linuxuser2010
LQ Newbie
 
Registered: May 2010
Posts: 4

Rep: Reputation: 0
Using DNS in iptables


I need to use hostnames in my iptables. When I go to restart iptables, it works fine but when I am rebooting the Linux server it fails during startup since the name service is started up after the iptables. Does anybody have recommendations to get around that? Should I set up a script to run the iptables after everything the server comes back up fully?
 
Old 08-16-2010, 10:46 AM   #2
suprstar
Member
 
Registered: Aug 2010
Location: Atlanta
Distribution: ubuntu, debian
Posts: 142
Blog Entries: 2

Rep: Reputation: 22
Well, if you bring your network up before the firewall, then there's a small window of time where your network is wide open. You COULD bring up ip tables after the network is up, but it's probably bad practice to do so. If you were to do that, check the rc[345].d directory:

lrwxr-xr-x 1 root root 18 Jun 2 2008 S08iptables -> ../init.d/iptables
lrwxr-xr-x 1 root root 17 Jun 2 2008 S10network -> ../init.d/network

Those 'S' scripts are the things run at startup. They run in order from S00 - S99. You could rename the scripts

lrwxr-xr-x 1 root root 17 Jun 2 2008 S08network -> ../init.d/network
lrwxr-xr-x 1 root root 18 Jun 2 2008 S10iptables -> ../init.d/iptables

to force network to start first.

A better idea is probably to leave the scripts in the original order, and put required entries in /etc/hosts so iptables can resolve what it needs to.
 
  


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
iptables and dns dedexes Linux - Networking 3 02-19-2008 12:01 AM
iptables - for dns rickylim Linux - Security 3 11-17-2006 03:20 AM
Iptables and DNS IBall Linux - Security 6 03-03-2006 06:08 AM
iptables and DNS ujotne Linux - Security 8 09-12-2005 08:49 AM
DNS and IPTABLES cuco76 Linux - Networking 9 02-07-2004 10:12 PM


All times are GMT -5. The time now is 04:57 AM.

Main Menu
Advertisement
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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration