Need advice on Network setup, for a small SOHO type setup
Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
I want to achieve the following:
a) Enable DynamicDNS (dynDNS based) for the GatewayBox, s.t. I can reach it from anywhere in the internet.
b) Use "ssh" to get to PC1,PC2,PC3 via GatewayBox from anywhere in the internet.
c) Reach external HTTP/HTTPS site from PC1,PC2,PC3 -- however, this is only desirable, not a must have. Must-have are (a) & (b).
I guess, I need to setup a Gateway with port-forwarding, using "iptables", however, dunno how to proceed ! The Netfilter and "iptables" documentation seems a bit daunting, and most examples are for "Firewall" type application only.
Since, my ADSL router itself has an inbuilt Firewall, so I don't need to enable Firewall feature on the GatewayBox.
Need help/advice in achieving the above.
thanks & regards,
bani
PS> Actually, I also want to replicate the exact same setup also inside a corporate setup, s.t. the ISP-router is to be replaced by a DHCP based connection on corporate LAN... and it's already secure.
I guess, I need to setup a Gateway with port-forwarding, using "iptables", however, dunno how to proceed ! The Netfilter and "iptables" documentation seems a bit daunting, and most examples are for "Firewall" type application only.
Here is a link to a HOWTO on using netfilter to create a gateway:
I did go through that link, but the part where I got stuck was, how do I do the gateway config, if eth0 doesn't have a static IP, but only one given by DHCP !
I did go through that link, but the part where I got stuck was, how do I do the gateway config, if eth0 doesn't have a static IP, but only one given by DHCP !
I reckon you need a bit of scripting to parse the IP address out of the result of "ifconfig eth0" and use it to re-create your iptables definitions.
My ISP uses a 12 hours DHCP lease refresh. While most of the time, I've seen that the lease extends, but sometimes, I've seen that the IP-address also changes for the new lease. I believe, the above snippet put in a script will then have to be wrapped into some kind of a cronjob run, periodically, checking change in IP-address as well, right ?
If so, this solution is fine, i.e. better than no solution, but I was hoping to find something which is a bit more seamless.
Quote:
Originally Posted by David1357
...
This assumes you need to use ipchains. If you can use iptables, it is a non-issue.
I use iptables, but I think I'd be able to convert it.
regards,
Banibrata
Last edited by bdutta; 08-23-2008 at 06:26 AM.
Reason: corrected typo
If so, this solution is fine, i.e. better than no solution, but I was hoping to find something which is a bit more seamless.
Once I get a cron job set up, they appear seamless to me. I usually put some logging in the script that gets run so I can verify that the cron job ran at the scheduled time. Once I know it is working, I usually forget all about it.
I used a cron job to keep the wireless USB adapter connected to my MythTV box up and running by pinging the gateway once per minute. It ran for months without any problems. Then my wife switched to DirecTV and a DVR. Now the MythTV box is mothballed. MythTV got the last laugh, though: My wife says the DVR is harder to use and it definitely doesn't store as many "Murder, She Wrote" episodes.
Once I get a cron job set up, they appear seamless to me. I usually put some logging in the script that gets run so I can verify that the cron job ran at the scheduled time. Once I know it is working, I usually forget all about it.
I used a cron job to keep the wireless USB adapter connected to my MythTV box up and running by pinging the gateway once per minute. It ran for months without any problems. Then my wife switched to DirecTV and a DVR. Now the MythTV box is mothballed. MythTV got the last laugh, though: My wife says the DVR is harder to use and it definitely doesn't store as many "Murder, She Wrote" episodes.
I did check out 'dhcp-options' and _boy_ are they many ! While it might have the more elegant solution, however - for the moment, I'd stick with the much more "quick yet functional" solution you proposed David.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.