Skip to contentSkip to conversation

simple router

LARTC Jeremiah Savage 2 participants 3 messages Jun 30, 2001

lore
Share & tools
lore
#0 lore raw

Hello,

I am attempting to construct a (simple?) router based on Linux 2.4 with iproute2.

I have 3 ethernet cards on the router, with eth0 connected to a host,eth1 connected to a server and eth2 connected to another computer.

                      xx.yy.88.101
                       +--------+
                       |        |
                       |  host  |
                       +---+----+
                           |
         xx.yy.zz.aa       |
             |             |eth0 - xx.yy.88.100
             |             |
+---------+  |      +----------------+
|another  | eth2    |                |
|computer +---------+  router        |
|         |         |                |
+---------+         +-------+--------+
xx.yy.zz.ab                 |
                            | eth1 - xx.zz.110.145
                            |
                        +---+-----+
                        |         |
                        | server  |xx.zz.110.148
                        |         |
                        +---------+

I am simply trying to get traffic through eth0 to eth1 so it can get to the server and get back out, but so far I can't ping the server through the router, although the router itself is capable of pinging the server (so the link eth1 is active). And I've verified that eth0 is also active as the router and the host can ping each other.

So how do I get the router to pass traffic through to the server?

I've tried

    # ip route add to unicast xx.zz.110.148 dev eth1
    RTNETLINK answers: File exists

and yet the host still can't ping the server.

And I've tried making eth0 "promiscuous"

        # ifconfig eth0 promisc
but that doesn't help either.

Anyone know the magic incantation that I need?

Signature · 10 lines
Jeremiah

__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail
http://personal.mail.yahoo.com/

_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://ds9a.nl/2.4Routing/
#1 lore raw

What's the routing table in host and server looks like ? if there is only one connection on both of them , the routing table in host only need one entry as : 0.0.0.0/0 -> xx.yy.88.100 and server need : 0.0.0.0/0 ->xx.zz.110.145

You don't need to add host route explicitly in the router becasue the subnet on network interface is included in routing table by default.

Another indication is "have you enabled iptable on router to block connection between
different subnet?"

James Shen

Quoted 58 lines

Hello,

I am attempting to construct a (simple?) router based on Linux 2.4 with iproute2.

I have 3 ethernet cards on the router, with eth0 connected to a host,eth1 connected to a server and eth2 connected to another computer.

                      xx.yy.88.101
                       +--------+
                       |        |
                       |  host  |
                       +---+----+
                           |
         xx.yy.zz.aa       |
             |             |eth0 - xx.yy.88.100
             |             |
+---------+  |      +----------------+
|another  | eth2    |                |
|computer +---------+  router        |
|         |         |                |
+---------+         +-------+--------+
xx.yy.zz.ab                 |
                            | eth1 - xx.zz.110.145
                            |
                        +---+-----+
                        |         |
                        | server  |xx.zz.110.148
                        |         |
                        +---------+

I am simply trying to get traffic through eth0 to eth1 so it can get to the server and get back out, but so far I can't ping the server through the router, although the router itself is capable of pinging the server (so the link eth1 is active). And I've verified that eth0 is also active as the router and the host can ping each other.

So how do I get the router to pass traffic through to the server?

I've tried

    # ip route add to unicast xx.zz.110.148 dev eth1
    RTNETLINK answers: File exists

and yet the host still can't ping the server.

And I've tried making eth0 "promiscuous"

        # ifconfig eth0 promisc
but that doesn't help either.

Anyone know the magic incantation that I need?

--
Jeremiah

Quoted 8 lines

__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail
http://personal.mail.yahoo.com/

_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://ds9a.nl/2.4Routing/

_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://ds9a.nl/2.4Routing/

#2 lore raw
In reply to Jeremiah Savage

Turns out that /proc/sys/net/ipv4/ip_forward was set to 0, as /etc/network/options had "ip_forward=no" (a debian thing). Enabling this option got the router working.

Signature · 10 lines
Jeremiah

__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail
http://personal.mail.yahoo.com/

_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://ds9a.nl/2.4Routing/