eth1 and eth0 different networks and not accessible

Discussion in 'Linux Networking' started by H. S., May 20, 2005.

  1. H. S.

    H. S. Guest

    Hi,

    I am connecting to an ADSL connection through a linux box(CompR below)
    used as a router with two NICs. Here is the setup:

    CompR
    ,-----------.
    (INTERNET) -->ppp0--->eth1 eth0-----> LAN (192.168.0.xyz)
    `-----------'


    I have my iptables script and have enables masquerading and my LAN
    computers can browse the web and connect to external VPN servers and all
    is well.

    However, after just talking to Bell Sympatico's help centre, I have
    discovered that the ADSL modem has an internal IP address (of the
    network interface that connects to my eth1 above) of 192.168.2.1. I have
    given the eth1 an address of 192.168.2.10.

    But I am not sure how to access that config page. "lynx 192.168.2.1" (or
    browsing through firefox) times out. I was wondering if anybody can
    suggest which iptables rules to use to accomplish this (192.162.0.x
    network is able to talk to 192.168.2.x network and vice versa).

    Here is my /etc/network/interfaces file:
    #----------------------------------------------------------------------
    # cat /etc/network/interfaces
    # This file describes the network interfaces available on your system
    # and how to activate them. For more information, see interfaces(5).

    # The loopback network interface
    auto lo
    iface lo inet loopback

    # The primary network interface
    auto eth0
    iface eth0 inet static
    address 192.168.0.1
    netmask 255.255.255.0
    network 192.168.0.0
    broadcast 192.168.0.255
    #gateway 192.168.2.10
    dns-nameservers 192.168.0.1

    auto eth1
    iface eth1 inet static
    address 192.168.2.10
    netmask 255.255.255.0
    network 192.168.2.0
    broadcast 192.168.2.255

    auto dsl-provider
    iface dsl-provider inet ppp
    provider dsl-provider
    # please do not modify the following line
    pre-up /sbin/ifconfig eth1 up # line maintained by pppoeconf
    up /etc/iptables-hs/fw-masq.sh start
    #----------------------------------------------------------------------


    thanks,
    ->HS
     
    H. S., May 20, 2005
    #1
    1. Advertisements

  2. H. S.

    Unruh Guest

    As root do

    route add -host 192.168.2.1 eth1
    Now anything for that ip will go out eth1, and thus to the router.
     
    Unruh, May 20, 2005
    #2
    1. Advertisements

  3. H. S.

    H. S. Guest

    Apparently, _Unruh_, on 19/05/05 20:51,typed:
    hmm .. seems like I already have this:

    # route -n
    Kernel IP routing table
    Destination Gateway Genmask Flags Metric Ref Use Iface
    64.230.197.68 0.0.0.0 255.255.255.255 UH 0 0 0 ppp0
    192.168.2.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1
    192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
    0.0.0.0 64.230.197.68 0.0.0.0 UG 0 0 0 ppp0

    and something else seems to be lacking.

    ->HS
     
    H. S., May 20, 2005
    #3
  4. If the router Ethernet interface is configured not to respond to
    ARP requests then only a host route will succeed. It may not be
    the problem but seems worth a try. AIUI, the PPPoE client Ethernet
    interface is not meant be configured with an IP address.
     
    Clifford Kite, May 20, 2005
    #4
  5. H. S.

    Bit Twister Guest

    Guessing you are running slackware.
    On Mandriva (mandrake) I have to enable ip_forward in /etc/sysctl.conf
    and add masquarding rules in iptables to allow lan pcs access to wan.
     
    Bit Twister, May 20, 2005
    #5
  6. H. S.

    H. S. Guest

    Apparently, _Bit Twister_, on 20/05/05 14:12,typed:

    Debian Sarge, kernel 2.6.10.

    IP forwarding works perfectly. LAN (192.168.0.0) computers are able to
    browse the internet. They are able to talk to each other. I am just not
    able to ping the LAN port the of the ADSL modem which seems to have an
    IP address of 192.168.2.1 (according to Bell Sympatico's tech support)
    which gives access to its web interface.

    So ADSL LAN 192.168.2.1 is not visible to my eth1 (192.168.2.10), but
    ppp0 works okay for all my LAN comps through eth0.

    ->HS
     
    H. S., May 20, 2005
    #6
  7. H. S.

    Unruh Guest

    routers do not respond to pings. Connect to them with a web browser.

    HOw do you know it is not visible? ping is NOT a good test.

     
    Unruh, May 20, 2005
    #7
  8. H. S.

    H. S. Guest

    Apparently, _Unruh_, on 20/05/05 17:07,typed:
    I did (see my first post in this thread).

    see above.

    ->HS
     
    H. S., May 20, 2005
    #8
  9. H. S.

    Unruh Guest

    "Above" says that you tried ping.
    So, to see if your routing is OK, at a time when all y our other computers
    are switched off or at least network inactive, ping 192.168.2.1 and see if
    the light on the eth1 card flashes about once a second. If it does, you
    know that the ping is being routed out to the router. If it does not, then
    you know your routing has problems.

    If your routing is OK, it is still possible that the router address you
    were given is wrong. 192.168.2.1 seems a strange address for the router. I
    would try 192.168.1.1 or .0.1 instead. Put in a temp entry into the
    routing table routing just thos host addresses out on eth1. and see if
    either of them respond to http requests.

    Or find the name of the modem and look on the manufacturer's web site to
    see if there is a manual which gives the IP of the router.
    It is also possible that someone changed the ip address the router responds
    to. In that case you would have to reset it to factory defaults.
     
    Unruh, May 21, 2005
    #9
  10. Routers *do* respond to pings.

    Some of them also happen to have a web server, but that isn't guaranteed
    either.
     
    Floyd L. Davidson, May 21, 2005
    #10
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.