Results 1 to 5 of 5

Thread: Gateway before router

  1. #1
    Join Date
    Sep 2003

    Gateway before router

    I'm trying to set up a gateway before my router, so it's between my modem and router. I've got it working with the external card, the one that's connected to the modem so I can acces the net from the linux gateway. The problem accures when I connect the other network card from the gateway to my routers WAN port. Both router and the second card in the gateway connected to the router have static ip's. But I can't ping the gateway from my router nor access the net. What have I done wrong?

  2. #2

    Re:Gateway before router

    Do you have your routes set up correctly in the gateway? If you can ping your second card from the router and vice versa, and you can ping the net from your first card, it sounds like you need to add a default gateway with the route command.

  3. #3
    Join Date
    Sep 2003

    Re:Gateway before router

    I'm not exactly sure of how to do this but is it something lik this;
    route add default gw XXX.XXX.XXX.XXX dev eth0
    route add -net XXX.XXX.XXX.0 netmask gw XXX.XXX.XXX.XXX dev eth0

    Where XXX.XXX.XXX.XXX is the gateway to the internet

    But still there's no connection between the router and the gateway..

  4. #4

    Re:Gateway before router

    Here's an example of how you want the routes setup:

    Gateway LAN:


    The routes to shoudl be automatically added, and the default should be set by whatever you are using for your connection.

    Router WAN:

    Router LAN:


    route add default gw

    Some routers don't like to play nice with two nets, but if you have both the router WAN and LAN set the same, it gets confused as to where to look for hosts on the network set.

  5. #5
    Join Date
    Sep 2003

    Re:Gateway before router

    Got it working now
    I used iptables and connected the gateway to the routers lan port instead of the wan

Similar Threads

  1. Unorthodox Network Setup: Ubuntu Gateway, Wireless Router, PCs
    By MRod in forum Linux - Hardware, Networking & Security
    Replies: 2
    Last Post: 12-20-2007, 09:08 AM
  2. Suse 10.2 as gateway
    By mahendraparanjpe in forum Suse
    Replies: 1
    Last Post: 03-04-2007, 02:37 PM
  3. OpenBSD gateway
    By Mor_gath in forum BSD
    Replies: 10
    Last Post: 08-20-2002, 09:49 PM
  4. Gateway PET?
    By BurntAsh in forum Linux - General Topics
    Replies: 6
    Last Post: 07-24-2002, 04:16 PM
  5. Question on setting router or gateway
    By wing328 in forum Linux - Hardware, Networking & Security
    Replies: 5
    Last Post: 06-11-2002, 08:24 PM


Posting Permissions

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