Find the answer to your Linux question:
Results 1 to 7 of 7
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 ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Apr 2012
    Posts
    4

    /etc/network/interfaces for a Linux router & DHCP & DNS Question.


    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.

    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:

    I also don't know if this is all setup for DNS as well. This is the pic from webmin

    Is there a way to check to see if DNS and DHCP are going to work when I do the switchover?

  2. #2
    Linux Newbie
    Join Date
    Apr 2012
    Posts
    112
    If I understood correctly, you are aiming to use a linux box as a router instead of a linksys router/modem?.

    Are you planning to access the internet? if so how will it connect outside (to the internet). At the moment I imagine that this is via the linksys router, which would explain the DNS/gateway settings. The router also has a dhcp server.

  3. #3
    Just Joined!
    Join Date
    Apr 2012
    Posts
    4
    Quote Originally Posted by manyrootsofallevil View Post
    If I understood correctly, you are aiming to use a linux box as a router instead of a linksys router/modem?.

    Are you planning to access the internet? if so how will it connect outside (to the internet). At the moment I imagine that this is via the linksys router, which would explain the DNS/gateway settings. The router also has a dhcp server.
    Yes I want to use the linux server as the router (along as a firewall/proxy/DHCP/DNS server).

    I connect with a modem (speedstream 4200 DSL modem) and I think it is PPPoE but the modem takes care of all of that. I have a standard linksys router which is where I get the 192.168.1.1 as the default gateway/IP address on the LAN and the WAN port is set to DHCP which pulls down an IP address of 192.168.254.1. My DSL modem is 192.168.254.254

    So what I need to know is if I remove the Linksys what do I set my internal LAN (eth1) configuration to? I especially want to know what the gateway should be for the LAN port (eth1) as this isn't shown in my Linksys router setup.

    Thanks for any help you can provide!

  4. $spacer_open
    $spacer_close
  5. #4
    Linux Newbie
    Join Date
    Apr 2012
    Posts
    112
    Quote Originally Posted by tuprox View Post
    Yes I want to use the linux server as the router (along as a firewall/proxy/DHCP/DNS server).

    I connect with a modem (speedstream 4200 DSL modem) and I think it is PPPoE but the modem takes care of all of that. I have a standard linksys router which is where I get the 192.168.1.1 as the default gateway/IP address on the LAN and the WAN port is set to DHCP which pulls down an IP address of 192.168.254.1. My DSL modem is 192.168.254.254

    So what I need to know is if I remove the Linksys what do I set my internal LAN (eth1) configuration to? I especially want to know what the gateway should be for the LAN port (eth1) as this isn't shown in my Linksys router setup.

    Thanks for any help you can provide!
    If you connect the modem to the linux box, then the linux box should get the ip address from the modem, so it will be whatever your isp decides for eth0 I imagine (it's been over 7 years since I've configured a modem directly)

    Regarding your second nic, you don't actually need two gateways. The gateway is the last port of call when trying to find an ip address, so if the routing table can lead the packets where they want to go, then fine, otherwise send them to the gateway and hope that it can deal with them.

  6. #5
    Just Joined!
    Join Date
    Apr 2012
    Posts
    4
    Quote Originally Posted by manyrootsofallevil View Post
    If you connect the modem to the linux box, then the linux box should get the ip address from the modem, so it will be whatever your isp decides for eth0 I imagine (it's been over 7 years since I've configured a modem directly)

    Regarding your second nic, you don't actually need two gateways. The gateway is the last port of call when trying to find an ip address, so if the routing table can lead you where you want to go, then fine, otherwise send it to the gateway and hope that it can deal with it.
    No, eht0 will get 192.168.254.254. The ISP has nothing to do with my internal IP addresses. Their modem is set to 192.168.254.254 and if my eth0 is set to dhcp (as it should) I will get 192.168.254.1.

    So about the second NIC that still really doesn't answer my question - it's really kind of tricky (IMHO) when you think about it. Is the gateway listed under eth1 in the interfaces file where the interface will find it's IP or is it where the rest of the computers on the network will get the IP?

  7. #6
    Linux Newbie
    Join Date
    Apr 2012
    Posts
    112
    the gateway is defined in the routing table.

    Code:
    route -n
    will tell you what your gateway is. The entry with the flag UG.

    If you need two gateways, you'll need iproute2. have a look at this: kindlund.wordpress.com/2007/11/19/configuring-multiple-default-routes-in-linux/

    Can't post links yet

    I'm confused about your setup as 192.168.1.0/24 is traditionally reserved for internal networks, so it does not make much sense for your isp to give you an internal ip address but like I said it's been a looong time since I configured a usb modem.

  8. #7
    Just Joined!
    Join Date
    Apr 2012
    Posts
    4
    Quote Originally Posted by manyrootsofallevil View Post
    the gateway is defined in the routing table.

    Code:
    route -n
    will tell you what your gateway is. The entry with the flag UG.

    If you need two gateways, you'll need iproute2. have a look at this: kindlund.wordpress.com/2007/11/19/configuring-multiple-default-routes-in-linux/

    Can't post links yet

    I'm confused about your setup as 192.168.1.0/24 is traditionally reserved for internal networks, so it does not make much sense for your isp to give you an internal ip address but like I said it's been a looong time since I configured a usb modem.
    Thanks again for the reply. I think you helped me out a lot with that route -n command.

    My modem has an external IP of something like 72.132.78.103 but the address I go to in my web browser to access my modem is 192.168.254.254 and the modem is running in bridged mode, if that matters. As far as the 192.168.1.0/24 range that is the default for linksys and yes it is only on my internal network.

    Here is my traceroute on the current setup with the Linksys router, if this helps.
    traceroute.jpg and it shows the first two hops: Linksys -> modem -> internet-somewhere.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •