LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 01-31-2011, 04:10 AM   #16
Noway2
Senior Member
 
Registered: Jul 2007
Distribution: Gentoo
Posts: 2,125

Rep: Reputation: 781Reputation: 781Reputation: 781Reputation: 781Reputation: 781Reputation: 781Reputation: 781

Quote:
Ya I you are right. Plse tell me how to configure DNS as a router
There are three steps to doing this.

1 - Enable IP Forwarding. Look for a file called ip_forward and the it's contents to 1. For example:
bash -c "echo 1 > /proc/sys/net/ipv4/ip_forward"

2 - Enable NAT Take the packets that originate from the 192.168.1.0/255.255.255.0 network and are going to be routed the eth1 card, and change them so it looks like the IP address they came from *is* the eth1 IP address as follows:
iptables -t nat -A POSTROUTING -s 192.168.1.0/255.255.255.0 -o eth1 -j MASQUERADE

3 - on your 'local' machines that need access, you need to set them to use 192.168.1.7 as their gateway / default route.

There is an alternative method, called bridging, where you can set your two NIC cards to "bridge" to the same network. It effectively accomplishes the same thing, but at a lower level. Using NAT with IP tables is emulating a layer 3 switch which bridging emulates a layer 2 switch. Here is a link to a how-to that also has information about the method above.
 
Old 02-02-2011, 09:58 PM   #17
Febi881
Member
 
Registered: Jun 2009
Location: India
Distribution: Fedora,Redhat
Posts: 111

Original Poster
Blog Entries: 1

Rep: Reputation: 17
Thanks all. Is there is any other way a linux mahine can be configure as a router

Last edited by Febi881; 02-02-2011 at 10:00 PM.
 
Old 02-03-2011, 04:12 AM   #18
Noway2
Senior Member
 
Registered: Jul 2007
Distribution: Gentoo
Posts: 2,125

Rep: Reputation: 781Reputation: 781Reputation: 781Reputation: 781Reputation: 781Reputation: 781Reputation: 781
Quote:
Is there is any other way a linux mahine can be configure as a router
This is a very broad topic and even a basic search for "linux as a router" returns many pages of how to documents for just about every distribution imaginable, including ones oriented towards small 'embedded' PCs. For the most part, they all come down to the same thing as described in this thread: turn on ip forwarding and configuring your firewall. Some go into a lot of detail regarding customization and security, which depending on your needs may be important to you.

This makes your question very difficult to attempt to answer. Do you have a specific question, are you running into trouble with a procedure, or are you getting an error message?

Honestly, I think the easiest and likely best approach would be to simply buy an inexpensive switch rather than trying to route all of your traffic through your server. You will probably get better, more reliable performance overall.
 
Old 02-07-2011, 09:50 PM   #19
Febi881
Member
 
Registered: Jun 2009
Location: India
Distribution: Fedora,Redhat
Posts: 111

Original Poster
Blog Entries: 1

Rep: Reputation: 17
Why I am trying this DNS server, we have a squid proxy sever as well in a different machine. So the http request from all users should go to that proxy as well as they should ping from their local machine to the internet. How I can configure a Dns server that my client from the 192.168.0.0/24 network can ping to the Internet.

Last edited by Febi881; 02-08-2011 at 02:37 AM.
 
Old 02-11-2011, 10:08 PM   #20
amonamarth
Member
 
Registered: Dec 2009
Location: Los Angeles
Distribution: Fedora ,CentOS, RHEL
Posts: 59

Rep: Reputation: 17
Agreed:

You should just buy a simple router for $30 to better accomplish NAT. Configuring a 'muli-homed' Linux server are a router will take various attempts to tweak a probably long firewall script.
 
Old 02-14-2011, 08:17 AM   #21
Febi881
Member
 
Registered: Jun 2009
Location: India
Distribution: Fedora,Redhat
Posts: 111

Original Poster
Blog Entries: 1

Rep: Reputation: 17
Thumbs up

Finally Every thing seems to be in a right path. I installed smoothwall on a box having two NICs. so my dns server resolves everything and forwards to the internet.Thanks all guys supported this thred.
 
  


Reply



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
DNS/MX issue xunil321 Linux - Networking 5 11-10-2008 01:17 AM
DNS issue - DNS works perfect on server but not on any other computer jtneal Linux - Networking 3 03-15-2008 03:30 PM
help need it... issue with dns golpemortal Linux - Server 1 01-28-2008 07:40 AM
dns issue Paxmaster Linux - Security 2 08-20-2005 02:17 PM
DNS issue or caching issue? AZDAVE Linux - Networking 7 10-02-2004 12:28 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 10:15 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
Open Source Consulting | Domain Registration