Dom Latter
2012-12-07 10:28:39 UTC
Hi, first post here...
I'm using Attitude Adjustment (12.09-beta, r33312) on a TP-LINK WR-842ND.
The main thing to note is that I am using it "behind" an existing router.
The aim is to be able to "drop" it into a domestic network set up and
have it automatically configure itself to make itself visible / available
to me, on the outside, on port 1234, with minimal (or no) configuration [1].
Three stages to make this happen:
1. Connect to LAN with DHCP
2. Dynamic DNS client to set up a known hostname
3. UPnP to set up port forwarding on existing router
Stage 1 is straightforward, set to DHCP, everything works.
Stage 2 - I've set "option interface 'lan'" inside a fairly normal
/etc/config/ddns, seems to work fine with no-ip.com
Stage 3 has been more interesting. I've installed miniupnpc through
opkg. At first I tried to hook the upnpc commands into the dhcp exit
(i.e to run them after obtaining an IP address). Then I tried rc.local.
Finally I ended up with an /etc/rc.local that looks a bit like:
sleep 10
IP=$(ifconfig | grep 'inet addr:'| grep -v '127.0.0.1' | cut -d: -f2 | awk '{ print $1}')
date > /tmp/dhcp-log
echo "++++++ ADD 1234 for $IP" >> /tmp/dhcp-log
upnpc -a $IP 1234 1234 tcp >> /tmp/dhcp-log 2>&1
Without the "sleep 10" it doesn't work - for some reason upnp doesn't seem
to work until things have had time to settle down. Does anyone know why?
Is there a way of knowing *when* the existing router is ready?
A couple of other questions:
Will this distro be out of beta soon?
I am logging in to /tmp, as above - what's the right way of doing it?
[1] - yes, many domestic routers will need to have UPnP enabled first,
but it should be reasonably easy to walk / talk someone through that.
I'm using Attitude Adjustment (12.09-beta, r33312) on a TP-LINK WR-842ND.
The main thing to note is that I am using it "behind" an existing router.
The aim is to be able to "drop" it into a domestic network set up and
have it automatically configure itself to make itself visible / available
to me, on the outside, on port 1234, with minimal (or no) configuration [1].
Three stages to make this happen:
1. Connect to LAN with DHCP
2. Dynamic DNS client to set up a known hostname
3. UPnP to set up port forwarding on existing router
Stage 1 is straightforward, set to DHCP, everything works.
Stage 2 - I've set "option interface 'lan'" inside a fairly normal
/etc/config/ddns, seems to work fine with no-ip.com
Stage 3 has been more interesting. I've installed miniupnpc through
opkg. At first I tried to hook the upnpc commands into the dhcp exit
(i.e to run them after obtaining an IP address). Then I tried rc.local.
Finally I ended up with an /etc/rc.local that looks a bit like:
sleep 10
IP=$(ifconfig | grep 'inet addr:'| grep -v '127.0.0.1' | cut -d: -f2 | awk '{ print $1}')
date > /tmp/dhcp-log
echo "++++++ ADD 1234 for $IP" >> /tmp/dhcp-log
upnpc -a $IP 1234 1234 tcp >> /tmp/dhcp-log 2>&1
Without the "sleep 10" it doesn't work - for some reason upnp doesn't seem
to work until things have had time to settle down. Does anyone know why?
Is there a way of knowing *when* the existing router is ready?
A couple of other questions:
Will this distro be out of beta soon?
I am logging in to /tmp, as above - what's the right way of doing it?
[1] - yes, many domestic routers will need to have UPnP enabled first,
but it should be reasonably easy to walk / talk someone through that.