Find the answer to your Linux question:
Results 1 to 5 of 5

Thread: Router setup

Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    Router setup


    I am trying to setup a linux box to act as a router for two different networks. I have two NICs in the machine and have enabled IP forwarding for the purpose of routing.

    I have eth0 setup as with a gateway of to reach the Internet. On my second NIC (eth1), I have it configured as I would like for the network to be able to reach the Internet via the network.

    What do I need to set the gateway to for eth1? Also here are the entries in my routing table:

    Dest. GW Netmask Iface * eth0 * eth1 eth0 eth1
    default eth0

    I have a laptop connected to eth1 and I have assigned it IP address of I can ping and but nothing else. From the router I can ping but not the laptop. Where are my problems?


  2. #2
    You will need to make sure that your network has a route to your default gateway & that the gateway has a route back to your network, if applicable.

    Here's a very simple lab with the steps you'll need to take to turn your system into a router.

    Hope this helped

  3. #3
    Thanks for the tip, I'll give it a try.

  4. $spacer_open
  5. #4
    Linux User cyberinstru's Avatar
    Join Date
    Jan 2007
    Obviously, Traffic is allowed from the laptop and till the WAN interface (eth0) of your router. But, when the packet moves out of the router, the external network may not be aware of the source (ur laptop's IP) from where it is coming.

    This could be solved either by making the next hop router aware of your laptop's network or use NAT.

  6. #5
    Thanks for the information. I added a route at my gateway and it all seems to be working perfectly now.

Posting Permissions

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