Archive for the ‘Wrt54gl’ Category

How to connect to bridged modem via wan-port

Wednesday, February 20th, 2008

My current configuration is:

{internal network 192.168.0.0/24} - [Linksys WRT54gl] - [A-Link RR44C] - {8/1 ADSL}

where A-Link is running in bridged mode (transparent) and thus doesn’t have a public IP. It can be managed via management IP (or LAN IP as it is identified in a config) which is by default 10.0.0.2.

The Linksys WRT54gl is acting as a firewall and a WLAN access point. It’s WAN-port is connected to A-Link’s LAN and it receives it’s public IP address directly from my ISP. Linksys’s LAN uses 192.168.0.0/24 subnet.

Linksys is running OpenWrt and X-Wrt.

To connect to the A-Link, previously I had to hook up a laptop to A-Link’s LAN-port and manually set the laptop’s IP-address to 10.0.0.10 (or anything else from 10.0.0.0/8 subnet) and then browse to 10.0.0.2, which is A-Link’s default management address.

To be able to connect to the A-Link from my internal network without hassling with a laptop and IP configurations, I had to add a IP alias to Linksys’s WAN-port (which is labeled by default as vlan1):
# ifconfig vlan1:0 10.0.0.10

Now Linksys WAN-port had two IP address’s. One that it received from isp (public) and 10.0.0.10. This command add a default route which works by default, so additional route configuration is not needed. However, if you wish to add a specific route, you can do it.

First remove the old route which routes all 10.0.0.0/8 traffic to wan-interface:
# route del -net 10.0.0.0 netmask 255.0.0.0

and then add a specific route, which routes only traffic to 10.0.0.2 via wan-interface:
# route add -host 10.0.0.2 dev vlan1:0