Find the answer to your Linux question:
Results 1 to 4 of 4
Hi All, I'm fighting with (what looks like) a simple routing problem that I'm not able to solve. Internet | ADSL modem (ip addr on subnet side 192.168.0.254) | | ...
  1. #1
    Just Joined!
    Join Date
    Oct 2006
    Posts
    2

    Simple routing problem

    Hi All,
    I'm fighting with (what looks like) a simple routing problem that I'm not able to solve.

    Internet
    |
    ADSL modem (ip addr on subnet side 192.168.0.254)
    | |
    | |
    | Windows xp(192.168.0.241-255.255.255.240-gateway:192.168.0.242)
    |
    linux PC (one nic eth0 192.168.0.41 and eth0:1 192.168.0.242/28 )

    So basically I have just one private subnet where I want my Windows xp computer to use the linux computer as gateway (I know that I shoud use my ADSL/router as default gateway, but I'm just experimenting).
    The linux computer has the routing table configured so that:
    default via 192.168.0.254
    I'm able to ping both computer but when I ping an external ip address from my Windows box I don't get any replay.
    If I do a:
    tcpdump -e -i eth0
    when I ping the external address (66.249.85.99) from the Windows xp box I would expect to see a packet being route from eth0 to 192.168.0.254 but I don't see anything.
    Any idea why?

    Thanks in advance.
    Alex

  2. #2
    Linux Enthusiast
    Join Date
    Dec 2004
    Posts
    637
    Two issues are readily apparent. First off, the Linux box that you want to act as a router only has one NIC and you have assigned more than one interface (IP aliasing) to your single NIC machine. Routing will not work with this setup, you will need two NIC's to properly route and NAT. In addition, both your external and internal networks (or soon to be networks) are using the same IP subnet - and this will not work. You will need two separate IP subnets for which to route in order for this setup to work. Why route if you are using the same subnet? See the problem?

  3. #3
    Just Joined!
    Join Date
    Oct 2006
    Posts
    2
    Hi gtmtnbiker98,
    yes You are right and I know that it doesn't make sense route on the same network.
    On the other side I was just wondering if the setup I was triyng will work.....
    If You look at the netmask (I forgot to mention that ADSL ethernet modem has 255.255.255.0) You will see that I make things so that the linux PC "think" the Windows PC is on a different network in order to route packet coming from Windows Xp to the 192.168.0.254 "real" router.
    It's just an "accademic exercise". The real reasons beyond that is that I'm triyng to make a tunnel (gre) between this LAN and a remote one (10.0.2.0/24):

    ip tunnel add netA mode gre remote [public ip address]
    ip link set neta up
    ip addr add 192.168.0.20 dev neta
    ip route add 10.0.2.0/24 dev neta

    This two scenario are similar (in both I'm triyng to route packets on the same phisical subnet because I'm using just one nic) but the first one seems more easy to debug. So I tried.

    Alex

    Note: I make a "echo 1 > /proc/sys/net/ipv4/ip_forward" on the linux router and now seems that things are working.

  4. #4
    Linux Enthusiast
    Join Date
    Dec 2004
    Posts
    637
    A poor man's VPN, novel idea; however, a little more difficult than I would prefer to implement.

Posting Permissions

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