LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 04-09-2012, 10:55 PM   #1
cilbuper
Member
 
Registered: Mar 2008
Posts: 141

Rep: Reputation: 0
Question /etc/network/interfaces for a Linux router - have question-Also DHCP & DNS questions


I want to thank anyone who can help in advance for any advice they can give!
I'm running Ubuntu 10.04LTS BTW
I know most of what I need to do to set up my router but I am stuck at the point of /etc/network/interfaces. I am setting up the external NIC as DHCP as it will get an IP from the modem (192.168.254.254) it assigns 192.168.254.1. I am setting the internal NIC to static with the following settings IF THE ARE CORRECT:
auto eth1
iface eth1 inet static
address 192.168.1.2
netmask 255.255.252.0
network 192.168.1.0
broadcast 192.168.1.255
gateway ???.???.???.???

Now I currently have a Linksys router that is set to IP address 192.168.1.1. I would like to make my linux router the same address so I know I will need to change the 192.168.1.2 address when I do the hardware change over.

Now here is where I am confused. My Linksys is set as the DNS server, gateway and DHCP server. I don't know what to set as the gateway on the internal NIC (the one above with the question marks). If this box is going to be the gateway/router/DNS/firewall/etc for the network do I set the gateway for the internal NIC (eth1) to point to the address 192.168.1.1 (once I do the hardware change and set/change the Linux box static IP from 192.168.1.2 to 192.168.1.1) or do I set the gateway to the modem address?
I'm using this guide to set things up and it is pretty good but it is still a little unclear. http://www.jonathanmoeller.com/screed/?p=1669

Finally I want to make sure I have DHCP server setup properly before I make the switch (I guess I could just make my computers static if it doesn't work) What can I do to make sure it is setup and running. In Webmin I see this: http://images.tuprox.com/dhcp.jpg

I also don't know if this is all setup for DNS as well. This is the pic from webmin
http://images.tuprox.com/binddns.jpg
Is there a way to check to see if DNS and DHCP are going to work when I do the switchover?

Last edited by cilbuper; 04-09-2012 at 11:01 PM.
 
Old 04-10-2012, 04:08 AM   #2
fukawi1
Member
 
Registered: Apr 2009
Location: Melbourne
Distribution: Fedora & CentOS
Posts: 854

Rep: Reputation: 193Reputation: 193
I have seen a number of people doing this recently and being confused by the same thing..

The confusing part in this situation is what you call the "modem". These are usually modems, routers, dhcp/dns/firewall/etc as well. What this does, is effectively create a whole subnet (possibly multiple) that exists for no reason.

My preferred method, is to run the modem in "bridged" mode, assuming the modem supports it.
Bridging the modem will essentially make the modem simple maintain the hardware connection, and pass it on to the gateway machine, (i use gateway, since it serves many roles aside from router or firwall).

The gateway machine then creates a pppoe connection and authenticates it, with the ISP. Usually, this will create a new network interface "ppp0", or something similar, which uses the physical interface (eth0 in my case).

I find this to be the simplest way to set up a linux router/NAT/firewall/etc type machine.

Quote:
Finally I want to make sure I have DHCP server setup properly before I make the switch (I guess I could just make my computers static if it doesn't work) What can I do to make sure it is setup and running. In Webmin I see this: http://images.tuprox.com/dhcp.jpg
According to the screenshot, there is no subnets defined, which would indicate that no, DHCP is not set up properly. Also, setting static IP's on anything other than a DHCP server itself, is a bad idea (IMHO), it is better to assign static DHCP leases to hosts you want to guarantee will get a persistent address.

The second screenshot means very little to me, what are you trying to use bind for? A caching nameserver? or to host your own domains?

You may find this link beneficial.
http://www.linuxhomenetworking.com/
 
Old 04-11-2012, 04:58 AM   #3
nikmit
Member
 
Registered: May 2011
Location: Nottingham, UK
Distribution: Debian
Posts: 178

Rep: Reputation: 34
Quote:
Originally Posted by cilbuper View Post
auto eth1
iface eth1 inet static
address 192.168.1.2
netmask 255.255.252.0
network 192.168.1.0
broadcast 192.168.1.255
gateway ???.???.???.???
A netmask of 255.255.252.0 is for a class B network (e.g. 172.16.0.0) and the broadcast address for 172.16.1.0/22 would be 172.16.3.255
You most likey intended to type 255.255.255.0. You don't need to specify a default gateway unless you have more complex routing on the inside network than usual.

You don't need to set up DNS unless you are hosting your own domain. Just configure DHCP to provide the ISPs DNS server IP addresses to clients.
With the Linksys router, you can use it as a switch and disable routing, DHCP and NAT on it. That is what I am doing - the linux box has only one internal interface and I need to connect a few computers.

Last edited by nikmit; 04-11-2012 at 05:18 AM. Reason: didn't read entire question initially :s :)
 
  


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
Some questions on DNS & DHCP on a LAN BrianK Linux - Networking 3 07-26-2005 03:33 PM
Linux router (DHCP, DNS) + Win XP homa2001 Linux - Networking 5 02-22-2005 10:23 PM
Manually specify network interfaces for DHCP NetAX Linux - Networking 1 04-22-2004 04:03 AM
Questions around a home webserver DHCP and using Linux as Router hiplainsdrifter Linux - Networking 23 03-25-2004 03:29 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 07:00 PM.

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