Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Private networks and DynDNS.
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
Extintor
Tux's lil' helper
Tux's lil' helper


Joined: 09 Oct 2004
Posts: 113
Location: Stockholm, Sweden

PostPosted: Mon Apr 23, 2007 1:00 pm    Post subject: Private networks and DynDNS. Reply with quote

Hi everyone.

I'm working on a Linux based firewall for a small company. At the moment are they using a Netgear "router" to do the NATing etc

Now everything works fine with the linuxbox except one small thing. They are using dyndns for some servers on the internal net. Now with the netgear router they can reach for example server1.mycompany.dyndns.org from the internal net ( work computers under the 192.168.1.0/24 network ) but something stops the linuxrouter from doing the same. A colleague of me mentioned something about UPnP but it seems a bit far fetched.

Some alternatives I've thought about.

A) What if i added ez-ipupdate and configured it for dyndns could that be a solution?
B) We do have a internal DNS, maybe just set up permanent mappings there instead?
C) Could it be done with iptables ? This is what I would prefer since I get headaches from configuring BIND.

I'm attaching my current iptables script beneath if you feel the need to see it.

Any help, ideas or suggestions are greatly appreciated.
Thank's in advance.


Code:

#!/bin/bash
# Lowe Schmidt, 2007.

# Aliases for some commands.
IPT="/sbin/iptables"
ECHO="/bin/echo"
# Aliases for the interfaces.
INT_IF="eth0" # Internal interface.
EXT_IF="ppp0" # External interface (Internet interface)
# Aliases for server ip adresses.
BENDER="x.x.x.x"
SONNY="x.x.x.x"
ENZO="x.x.x.x"
# Flush previous rules to ensure sanity.
$IPT -F
$IPT -X
# Make sure that IP forwarding is activated
$ECHO 1 > /proc/sys/net/ipv4/ip_forward
# Limit pings to 3 every second.
$IPT -A INPUT -p icmp --icmp-type echo-request -m limit --limit 3/s --limit-burst 10 -j ACCEPT
# Set up the network adress translation(NAT).
$IPT -t nat -A POSTROUTING -o $EXT_IF -j MASQUERADE
# Forward LAN traffic to internet.
$IPT -A FORWARD -i $INT_IF -o $EXT_IF -m state --state NEW,ESTABLISHED -j ACCEPT
# Accept Syslog connections from intranet.
$IPT -A INPUT -i $INT_IF -p tcp --dport 5149 -j ACCEPT
$IPT -A INPUT -i $INT_IF -p udp --dport 514 -j ACCEPT
# This whole section can be shortened with multiport.
# Forward port 22,80 and 443 to Bender.
$IPT -t nat -A PREROUTING -i $EXT_IF -p tcp --dport 22  -j DNAT --to $BENDER
$IPT -t nat -A PREROUTING -i $EXT_IF -p tcp --dport 80  -j DNAT --to $BENDER
$IPT -t nat -A PREROUTING -i $EXT_IF -p tcp --dport 443 -j DNAT --to $BENDER
# $IPT -t nat -A PREROUTING -i $EXT_IF -p tcp --dport 2401 -j DNAT --to $BENDER
# Forward port 8080 and 2222 to Sonny
$IPT -t nat -A PREROUTING -i $EXT_IF -p tcp --dport 8080 -j DNAT --to $SONNY
$IPT -t nat -A PREROUTING -i $EXT_IF -p tcp --dport 2222 -j DNAT --to $SONNY

_________________
Beerhazard | Nobelium | VIm | Perl | Ruby
Back to top
View user's profile Send private message
fangorn
Veteran
Veteran


Joined: 31 Jul 2004
Posts: 1886

PostPosted: Tue Apr 24, 2007 1:47 pm    Post subject: Reply with quote

for sub-sub-domains to work IIRC you have to provide a DNS on sub-domain level.

In your case mycompany.dyndns.org (the netgear router) has a DNS server running to address server1.mycompany.dyndns.org.

To replace the netgear you have to provide a local DNS lookup server where you provide the private ip addresses of the servers. And you have to setup a transparent mapping of any traffic for server1.mycompany.dyndns.org to your local server.

But don't ask me how to do this. :roll:
_________________
Video Encoding scripts collection | Project page
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum