How to get to cable modem?

Post new topic   Reply to topic    DD-WRT Forum Index -> Generic Questions
Author Message
pazuzu
DD-WRT Novice


Joined: 04 Jul 2006
Posts: 44

PostPosted: Fri Jul 21, 2006 2:16    Post subject: How to get to cable modem? Reply with quote
Given a WRT54GS in AP mode, set to DHCP client at the WAN side, 192.168.1.5/16 is its local IP addr and "gateway" is left at 0.0.0.0. How do I configure it so the computers can access the cable modem's web GUI at 192.168.100.1? Right now, I can't ping 192.168.100.1 from the WRT54GS.

Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
68.xx.xx.0 * 255.255.255.0 U 0 0 0 vlan1
192.168.0.0 * 255.255.0.0 U 0 0 0 br0
127.0.0.0 * 255.0.0.0 U 0 0 0 lo
default c-68-xx-xx-1.hs 0.0.0.0 UG 0 0 0 vlan1

I tried adding this in Advanced Routing, but it doesn't appear in routing table at all
destination: 192.168.100.1
mask: 255.255.0.0
gateway: 192.168.1.5
interface: WAN

_________________
D-link DI-524 -> DD-WRT v23sp1 WRT54GS v2 client bridge -> DD-WRT v23sp1 WRT54GS v1 AP and Apple AirPort Graphite base station bridge
Sponsor
pazuzu
DD-WRT Novice


Joined: 04 Jul 2006
Posts: 44

PostPosted: Fri Jul 21, 2006 17:44    Post subject: Reply with quote
After adding the following, now I can ping the cable modem from the WRT54GS, but still can't from any computer on the LAN side.

route add -net 192.168.100.1 gw 68.xx.xx.xx netmask 255.255.255.255 dev vlan1

Is this because the WRT54GS sees br0 as the outgoing interface for 192.168.0.0/16 traffic, before it reads the static route above?

Is there any way to keep the gateway IP addr updated in the static route, so I don't have to redo when I get a new IP from the ISP?

_________________
D-link DI-524 -> DD-WRT v23sp1 WRT54GS v2 client bridge -> DD-WRT v23sp1 WRT54GS v1 AP and Apple AirPort Graphite base station bridge
CaScAdE
DD-WRT Guru


Joined: 18 Jun 2006
Posts: 1110
Location: Kiel (54.4247,10.1721)

PostPosted: Mon Jul 24, 2006 11:07    Post subject: Reply with quote
You read http://www.dd-wrt.com/wiki/index.php/Access_To_Modem_Configuration did you?

User save startup and save firewall like mentioned there...

_________________
DD-WRT F.A.Q.

Webcam Kiel
pazuzu
DD-WRT Novice


Joined: 04 Jul 2006
Posts: 44

PostPosted: Fri Jul 28, 2006 15:29    Post subject: Reply with quote
So in my case, I'd want to:

ip addr add 192.168.100.1/32 dev vlan1 brd +
and click on Save Startup

/usr/sbin/iptables -t nat -I POSTROUTING -o vlan1 -d 192.168.100.1/32 -j MASQUERADE
and click on Save Firewall

richtige?

Is "-I POSTROUTING" used rather than "-A POSTROUTING" so the iptables rule takes precedent in front of "192.168.0.0 * 255.255.0.0 U 0 0 0 br0"? How does iptables figure out the right spot to inject this rule?

_________________
D-link DI-524 -> DD-WRT v23sp1 WRT54GS v2 client bridge -> DD-WRT v23sp1 WRT54GS v1 AP and Apple AirPort Graphite base station bridge
Bird333
DD-WRT Guru


Joined: 07 Jun 2006
Posts: 809

PostPosted: Fri Jul 28, 2006 20:41    Post subject: Reply with quote
You want to assign an IP to vlan1 that is on the same subnet as your default cable modem IP address. I think 'I' puts the rule in the first position if you don't specify a line number.
pazuzu
DD-WRT Novice


Joined: 04 Jul 2006
Posts: 44

PostPosted: Fri Jul 28, 2006 23:00    Post subject: Reply with quote
But vlan1 is the WAN port, how do I assign it another IP addr when it already has one assigned by Comcast DHCP?

Here's the new output after doing what I posted above. Now 192.168.100.1 seems answer from a LAN machine, except it gets redirects to 192.168.1.5--the WRT54GS itself.

Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.100.1 c-68-xx-xx-xx. 255.255.255.255 UGH 0 0 0 vlan1
68.xx.xx.0 * 255.255.255.0 U 0 0 0 vlan1
192.168.0.0 * 255.255.0.0 U 0 0 0 br0
127.0.0.0 * 255.0.0.0 U 0 0 0 lo
default bu-10-ubr01.upp 0.0.0.0 UG 0 0 0 vlan1

_________________
D-link DI-524 -> DD-WRT v23sp1 WRT54GS v2 client bridge -> DD-WRT v23sp1 WRT54GS v1 AP and Apple AirPort Graphite base station bridge
pazuzu
DD-WRT Novice


Joined: 04 Jul 2006
Posts: 44

PostPosted: Mon Aug 14, 2006 19:08    Post subject: Reply with quote
Bump. Still unsolved. I don't want to change my IP addressing scheme (192.168.0.0/16) if there's any other way.
_________________
D-link DI-524 -> DD-WRT v23sp1 WRT54GS v2 client bridge -> DD-WRT v23sp1 WRT54GS v1 AP and Apple AirPort Graphite base station bridge
CaScAdE
DD-WRT Guru


Joined: 18 Jun 2006
Posts: 1110
Location: Kiel (54.4247,10.1721)

PostPosted: Mon Aug 14, 2006 22:11    Post subject: Reply with quote
pazuzu wrote:
So in my case, I'd want to:

ip addr add 192.168.100.1/32 dev vlan1 brd +
and click on Save Startup

/usr/sbin/iptables -t nat -I POSTROUTING -o vlan1 -d 192.168.100.1/32 -j MASQUERADE
and click on Save Firewall

richtige?

Is "-I POSTROUTING" used rather than "-A POSTROUTING" so the iptables rule takes precedent in front of "192.168.0.0 * 255.255.0.0 U 0 0 0 br0"? How does iptables figure out the right spot to inject this rule?


Oh hell no.
the first command would give the router at its WAN interface the same IP as you modem.

try Administration -> Commands -> Run Commands (just to test them)
Code:
ip addr add 192.168.100.2/24 dev vlan1 brd +
/usr/sbin/iptables -I POSTROUTING -t nat -o vlan1 -d 192.168.100.0/24 -j MASQUERADE

this should work for you case.

_________________
DD-WRT F.A.Q.

Webcam Kiel
pazuzu
DD-WRT Novice


Joined: 04 Jul 2006
Posts: 44

PostPosted: Fri Aug 18, 2006 17:58    Post subject: Reply with quote
So vlan1--the WAN uplink--will have two IP addrs assigned? One by Comcast DHCP--68.x.x.x, and one statically by myself--192.168.100.2?

If so, is this single-link multi-homing? So vlan1 is treated as a physical interface?

_________________
D-link DI-524 -> DD-WRT v23sp1 WRT54GS v2 client bridge -> DD-WRT v23sp1 WRT54GS v1 AP and Apple AirPort Graphite base station bridge
pazuzu
DD-WRT Novice


Joined: 04 Jul 2006
Posts: 44

PostPosted: Sun Aug 20, 2006 3:26    Post subject: Reply with quote
Update:

~ # ip route
192.168.100.0/24 dev vlan1 proto kernel scope link src 192.168.100.2
68.xx.xx.0/23 dev vlan1 proto kernel scope link src 68.xx.xx.219
192.168.0.0/16 dev br0 proto kernel scope link src 192.168.1.5
127.0.0.0/8 dev lo scope link
default via 68.xx.xx.1 dev vlan1

I still think the problem is "192.168.0.0/16 dev br0 proto kernel scope link src 192.168.1.5" gets processed before "192.168.100.0/24 dev vlan1 proto kernel scope link src 192.168.100.2".

_________________
D-link DI-524 -> DD-WRT v23sp1 WRT54GS v2 client bridge -> DD-WRT v23sp1 WRT54GS v1 AP and Apple AirPort Graphite base station bridge
Display posts from previous:    Page 1 of 1
Post new topic   Reply to topic    DD-WRT Forum Index -> Generic Questions All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum