I'm very new to the networking side of the house and am trying to set up SSH on my new Ubuntu machine. I have my DD-WRT router working with DDNS now and can log in to the router page -- but I'm not sure how to go about forwarding it to my server machine. I realize I would forward port 22 over (or a unique port) -- but to forward, DD-WRT wants to know the IP I'm pointing at. But that IP will change, won't it? How do I make the router point to the machine rather than the current IP? Or am I asking the wrong question?
As long as the DD-WRT router is also the DHCP Server for the network, you can set up a static DHCP lease for the server in DD-WRT in Services > DHCP Server under the Static leases section. This will make sure that the DHCP server always hands out the same IP address for your server when it asks for a DHCP lease.
In order to do this, you need to know the MAC address for the server. You can determine this with the command
ip addr on the server by looking at the
link/ether entry for the interface connected to the router (most likely
wlan0 in your case).
Alternatively, you can also get the MAC address with
ifconfig (run with
/sbin/ifconfig as regular user on Ubuntu,
/sbin is most likely not in your
PATH). In that case look at the
HWaddr entry for the relevant interface.
Fill in the MAC Address, hostname for the server and the desired IP address to the list of static leases in DD-WRT, Save, and Apply Settings. Note that if the IP address you set up for the static lease is not the one currently assigned to the server, you'll need to have the server give up its current lease and request a new lease from the DHCP server in order for it to get the permanent IP address.