Access To Modem Configuration

From DD-WRT Wiki

(Difference between revisions)
Jump to: navigation, search
Revision as of 02:53, 11 December 2006 (edit)
Mickdo (Talk | contribs)
(The way to follow)
← Previous diff
Revision as of 20:31, 5 March 2007 (edit) (undo)
Meller (Talk | contribs)
(The way to follow)
Next diff →
Line 35: Line 35:
''N.B. Not all dd-wrt hardware uses vlan1 as the WAN port. For a listing of network interface names for most models you can go here'' [http://wiki.openwrt.org/OpenWrtDocs/Configuration] ''N.B. Not all dd-wrt hardware uses vlan1 as the WAN port. For a listing of network interface names for most models you can go here'' [http://wiki.openwrt.org/OpenWrtDocs/Configuration]
[[Category:English documentation]] [[Category:English documentation]]
 +
 +A alternative (and better) way to execute the above commands on startup is the following:
 +* Log in via ssh
 +* create a file with the following content:
 + #!/bin/sh
 + ip addr add 10.0.0.1/24 dev vlan1 brd +
 + /usr/sbin/iptables -I POSTROUTING -t nat -o vlan1 -d 10.0.0.0/24 -j MASQUERADE
 +* save it as "/jffs/etc/config/modem.wanup"
 +* make it executable:
 + chmod +x /jffs/etc/config/modem.wanup

Revision as of 20:31, 5 March 2007

Contents


Case of a Bridged modem

Presentation

In this case the router itself creates the PPPoE connection to the ISP server; but to work, the connection between the modem and the router must have an IP address. Usually the modem gives an address to the client; but this address will never be used except to access the configuration interface of the modem.

My modem is a Speedtouch 510, is IP address is 10.0.0.138 and it gives the 10.0.0.1 address to the device connected to it. The easiest way to know these addresses is to connect the modem directly to your computer and take a look at your network card configuration. The default gateway is the Modem address and the Card address is the one provided by the modem. It should be noted that a lot of modems come preconfigured to use the 192.168.1.x IP range. This will need to be changed for this to work.

So it looks like this.

   |<---------- PPPOE link ---------->|    
   |                                  |    |====== 
  ISP ======= bridged ============== WRT ========= PCs
               modem |              |   |  |======
                     |              |   |
                     |<- 10.0.0.x ->|   |<-- 192.168.1.x -->>

By default if you type the IP address of the modem you have an "Impossible to contact the server" error.

The way to follow

Eventually replace the 10.0.0.x by your addresses

  • Go to Administration -> Diagnostics and click on run
  • Enter
ip addr add 10.0.0.1/24 dev vlan1 brd +

OR

ifconfig vlan1 10.0.0.1 netmask 255.255.255.0 broadcast 10.0.0.255

and click on Save Startup

  • Enter
/usr/sbin/iptables -I POSTROUTING -t nat -o vlan1 -d 10.0.0.0/24 -j MASQUERADE

and click on Save Firewall


N.B. Not all dd-wrt hardware uses vlan1 as the WAN port. For a listing of network interface names for most models you can go here [1]

A alternative (and better) way to execute the above commands on startup is the following:

  • Log in via ssh
  • create a file with the following content:
#!/bin/sh 
ip addr add 10.0.0.1/24 dev vlan1 brd +
/usr/sbin/iptables -I POSTROUTING -t nat -o vlan1 -d 10.0.0.0/24 -j MASQUERADE
  • save it as "/jffs/etc/config/modem.wanup"
  • make it executable:
chmod +x /jffs/etc/config/modem.wanup