Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

IP forwarding + Dynamic IP

Status
Not open for further replies.

cyberant

Programmer
Sep 21, 2003
44
ZA
Hey all

I'm trying to forward all incoming connections from the internet(port 4699) to a PC on my internal network. I think I have the fundamentals down pat, but my question is : I am running an ADSL connection with a dynamically assigned IP address. When I append this rule to IPTABLES will it take into account my changing IP address or will I need to restart the server each time the IP address changes?

Thanks so much for forum, it's a wonderful help!

CyberAnt
 
I believe that as long as your PC is running, your ISP will renew the lease time on the same IP address. So I wouldn't worry about it.

I have my server up (all the time) with Dynamic IP from my ISP, had the same IP address for months now. Running Iptables, IP forwarding.

Dan
 
Unfortunately I'm from SA and the ISP's here log you off the internet every 24 hours and then reconnect you, obviously with a new IP. Any ideas?
 

In your iptables script, check your IP address, set a variable to that value and use that variable throughout the script instead of the actual ip.
 
Like ericbrunson said. I use:

EXTIF="eth1"
PUB_IP="`ifconfig $EXTIF | grep 'inet addr' | awk '{print $2}' | sed -e 's/.*://'`"

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top