1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

HyperWrt request

Discussion in 'General Discussion' started by Anonymous, Oct 30, 2004.

  1. Anonymous

    Anonymous Guest

    Can you do two things for the next version please?

    (1) Give option for the version of RIP routing to be used (none, 1, 2, or both).
    (2) Turn on RIP routing, passive mode on lan ports when in gateway mode.

    I believe the combination of the above will make routing between home subnets easy. with multiple WRT devices.
     
  2. Anonymous

    Anonymous Guest

    How to configure HyperWRT 2.0b2 to connect wired subnets -P1

    How to configure HyperWRT 2.0b2 to connect wired subnets together.
    or
    How to fix the Router in Gateway mode for the WRT

    First we make two assumptions about the connections between the networks.
    (1) There is one and only one connection to the Internet and that box will be labeled "G"
    (2) The only connection between boxes is the hardwired Wan (Internet) port on a WRT54 to a LAN (or numbered) port on another WRT54 box.

    With these two assumptions (and because there is only one WAN [Internet] port per box), you can conclude that there is one and only one route between any two points on the network. Now the WRTs running as routers will be labeled "R1", "R2", etc in the diagrams below.

    Some possible configurations are

    Four routers connected to one Gateway unit like this:

    <Internet>
    |
    G
    -------------
    | | | |
    R1 R2 R3 R4

    OR

    Linear string of routers connected to each other like this:

    <Internet>
    |
    G
    -------------
    | | | |
    |
    R1
    -------------
    | | | |
    |
    R2
    -------------
    | | | |
    |
    R3
    -------------
    | | | |
    |
    R4
    -------------
    | | | |

    Or any mixture of the above like this:

    <Internet>
    |
    G
    -------------
    | | | |
    | R3
    R1
    -------------
    | | | |
    | R4
    R2


    Now we want to turn on the RIP routing protocol, so that we do not need static routes between our networks. However, by default or design, Linksys does not give us the option to turn on RIP when in gateway mode, and in router mode they turn on both RIP version 1 and RIP version 2 protocols. Since RIP version 1 does not contain the network mask information, the result is a contaminated router database which appears to lead to a broken RIP version 2. We therefore need to turn off RIP version 1 (actually turn on only RIP version 2) to get a working RIP version 2 router which handles the network masks properly.

    Looking at the posible configurations you can see that the Gateway unit should not send RIP packets to the Internet Gateway (192.168.x.x IP addresses are not legal there) and does not need any RIP packets from the Internet since it only needs to know about the internal networks. It needs to get RIP packets from the routers attached to its LAN ports. It however does not need to send RIP packets to the routers on the LAN ports since they can see the packets from each other.

    Looking at a router, we notice that it needs to send/recieve RIP packets from its WAN port, and recieve RIP packets from the routers attached to it. Again, it does not need to send packets to the routers on it's LAN ports, since they can see each other.

    This leads to the two parts of the configuration.
    The LAN side can always be passive, that is recieving RIPv2 packets, but never sending out any.
    The WAN side depends on whether it is configured as a router or the gateway box

    So looking at the contents of the HyperWRT software, we see that the routing is handled by "zebra" and "ripd" which are controled by the contents of the "ripd.conf" configuration file.
    There is some documentation for a newer version of ZEBRA at http://www.zebra.org/

    Now looking at the LAN side of both types of boxes, the configuration file needs to contain the

    following lines

    (a) network br0
    (b) interface br0
    (c) ip rip receive version 2
    (d) distribute-list private out br0
    (e) access-list private deny any

    Comments on above lines:
    (a) defines the network associated with br0 to be added to the RIP tables.
    (b) selects interface br0 for the next commands
    (c) tells ripd to recieve version 2 packets on br0
    (d/e) tell ripd to not send anything out br0 interface (passive mode)

    Now for the WAN side of the Gateway, we want nothing in/out

    (f) no network eth1
    (g) distribute-list private in eth1
    (h) distribute-list private out eth1
    (i) access-list private deny any

    Maybe you have already guessed that (f) is to not include the network associated with eth1 in the routing tables. (g/h/i) tell ripd not to send or recieve on eth1.

    For the WAN side of the routers, we want RIPv2 in and out.

    (j) network eth1
    (k) interface eth1
    (l) ip rip send version 2
    (m) ip rip receive version 2

    Comments on above lines:
    (j) defines the network associated with eth1 to be added to the RIP tables.
    (b) selects interface eth1 for the next commands
    (l/m) tells ripd to send and recieve version 2 packets on eth1
    Note that there is no distribute-list, since we do not want to restrict the packets.

    Add a few required things, like "router rip" and starting zebra before ripd, and we have the tools we need to put all this together.

    Now for the choice of the subnets to use. Up to this point, any network or subnet will work, but there is a constraint made by the GUI that may limit our choice. Notice that within the GUI, to avoid unnecessary typing, the first 3 parts of the IP number is tied to the local IP address. This means that if we want to use those features from the gateway, over the whole network, the subnets had better start with the same 3 numbers.
    I decided to split my network into 4 subnets with a mask of 255.255.255.192.
    Router IP=192.168.1.2, DHCP starting IP 192.168.1.11, maxusers=52
    Router IP=192.168.1.65, DHCP starting IP 192.168.1.75, maxusers=52
    Router IP=192.168.1.129, DHCP starting IP=192.168.1.139, maxusers=52
    Router IP=192.168.1.193, DHCP starting IP 192.168.1.203, maxusers=52

    That leaves me with 9 IP addresses in each subnet reserved for static IPs. In the first range, I put the router at 192.168.1.2 rather than .1 so that I always have a place for a freshly reset box to connect.

    Note I only have WRT54GV1.1 and WRT54GV1.0 boxes, so these instructions may need to be modified for other versions of the boxes.

    Implementation is in part 2 (so that those that don't like theory, can skip this part)
     
  3. Anonymous

    Anonymous Guest

    How to configure HyperWRT 2.0b2 to connect wired subnets -P2

    How to configure HyperWRT 2.0b2 to connect wired subnets together - part2.

    Any non-overlaping network or subnet will work with this configuration, but there is a constraint made by the GUI that may limit your choice. Notice that within the GUI, to avoid unnecessary typing, the first 3 parts of the IP number is tied to the local IP address. This means that if we want to use those specific features from the gateway, over the whole network, the subnets had better start with the same 3 numbers.
    I decided to split my network into 4 subnets with a mask of 255.255.255.192.
    Gateway IP=192.168.1.2, DHCP starting IP 192.168.1.11, maxusers=52
    Router IP=192.168.1.65, DHCP starting IP 192.168.1.75, maxusers=52
    Router IP=192.168.1.129, DHCP starting IP=192.168.1.139, maxusers=52
    Router IP=192.168.1.193, DHCP starting IP 192.168.1.203, maxusers=52

    That leaves me with 9 IP addresses in each subnet reserved for static IPs. In the gateway range, I put the router at 192.168.1.2 rather than .1 so that I always have a place for a freshly reset box to connect.

    Note I only have WRT54GV1.1 and WRT54GV1.0 boxes, so these instructions may need to be modified for other versions of the boxes.

    I will only cover the part of the WRT setup that implements the wired routing. Skipping the wireless parts, except to mention to use different SSID and channel for each one.

    For one gateway box that is connected to the internet I have the following setup:
    Setup - Basic setup
    Internet is DHCP
    Router IP=192.168.1.2, mask=255.255.255.192
    DHCP server enabled, Starting IP 192.168.1.11, maxusers=52
    Setup - Advanced Routing
    Operating mode=Gateway
    No static routes defined
    Security - Firewall
    Enabled
    Not checked NAT redirection
    Applications & Gaming - Port range forward
    Application=I2eyeTCP, start=1720, end=1720, protocol=TCP, IP address=192.168.1.130
    Application=I2eyeUDP, start=15328, end=15333, protocol=Both, IP address=192.168.1.130
    Administration - Mamagement
    Remote Management disabled

    In the Administration - Mamagement - startup configuration for the gateway box I have stored

    sleep 10
    touch /tmp/zebra.conf
    echo router rip >/tmp/ripd2.conf
    echo network br0 >>/tmp/ripd2.conf
    echo no network eth1 >>/tmp/ripd2.conf
    echo interface br0 >>/tmp/ripd2.conf
    echo ip rip receive version 2 >>/tmp/ripd2.conf
    echo router rip >>/tmp/ripd2.conf
    echo distribute-list private out br0 >>/tmp/ripd2.conf
    echo distribute-list private in eth1 >>/tmp/ripd2.conf
    echo distribute-list private out eth1 >>/tmp/ripd2.conf
    echo access-list private deny any >>/tmp/ripd2.conf
    /usr/sbin/zebra -d -f /tmp/zebra.conf
    /usr/sbin/ripd -d -f /tmp/ripd2.conf

    =====================
    For the router box I have the following setup
    Setup - Basic setup
    Internet is DHCP (and the Internet port is wired to a LAN port on the gateway box)
    Router IP=192.168.1.129, mask=255.255.255.192
    DHCP server enabled, Starting IP=192.168.1.139, max users=52
    Setup - Advanced
    Operating mode=Router
    RIP = WAN
    Security - Firewall
    Disabled
    Not checked NAT redirection
    Administration - Mamagement
    Remote Management enabled, port 8080, HTTPS checked

    In the Administration - Mamagement - startup configuration for the router box(s) I have stored

    sleep 10
    kill -15 `cat /var/run/ripd.pid`
    echo router rip >/tmp/ripd2.conf
    echo network br0 >>/tmp/ripd2.conf
    echo network eth1 >>/tmp/ripd2.conf
    echo redistribute connected >>/tmp/ripd2.conf
    echo interface br0 >>/tmp/ripd2.conf
    echo ip rip receive version 2 >>/tmp/ripd2.conf
    echo interface eth1 >>/tmp/ripd2.conf
    echo ip rip send version 2 >>/tmp/ripd2.conf
    echo ip rip receive version 2 >>/tmp/ripd2.conf
    echo router rip >>/tmp/ripd2.conf
    echo distribute-list private out br0 >>/tmp/ripd2.conf
    echo access-list private deny any >>/tmp/ripd2.conf
    /usr/sbin/ripd -d -f /tmp/ripd2.conf

    Connect the gateway's Internet port to your ISP modem (Internet connection).
    Connect the routers Internet port to a Gateway's Lan ports.
    Reboot the WRT boxes, and wait for a few minutes for the RIP to finish passing the information between the routers and Gateway and you should have a working network.

    To confirm that all the routing information is being passed correctly, on the gateway box go to

    Setup - Advanced Routing - Show Routing Table
    You should see routes for all the parts of your network with the correct subnet masks.
     

Share This Page