Guest User!

You are not Sophos Staff.

This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

new to astaro, NAT problems

hi there

I have the following config and seem to be having routing/DNAT problems. I was hoping someone would be so kind as to enlighten me.

Astaro Linux on a machine with quad network card, eth0, eth1, eth2, eth3.

eth0 is say 211.211.211.210 and goes to my leased line router 

eth1 is 192.168.1.1
eth2 is 192.168.2.1
eth3 is 192.168.3.1

on eth3 I have one machine 192.168.3.2, real IP i want to NAT is say 211.211.211.211, and say the only service I need is SSH.


I have added a static route that goes from 211.211.211.211 to 192.168.3.1
and a DNAT that says 211.211.211.211-SSH to 192.168.3.2-SSH
and my packet filter says Any Any Any Allow

but i can't seem to ssh or ping to 211.211.211.211 from outside the firewall.
I can SSH and ping from the firewall itself to 192.168.3.2 (although i can't seem to SSH from the firewall to that IP since SSH was updated in 1.812 or so)

Any light shed would be greatly appreciated.

Thanks

emma ^..^


This thread was automatically locked due to age.
Parents
  • Hi Emma,

    methinks that the problem here goes deeper that NAT or packetfilter rules. 

    eth0 has IP 211.211.211.210, and it will answer for that (and only that) IP. If someone just sends packets to 211.211.211.211 on the net connected to eth0, it won't react.

    Basically the cleanest option would be a route set on the leased line router to route this IP (or, optimally, your whole set of official IPs) directly on the IP of the Interface eth0.

    If you don't have this option, you could use interface aliases (yet unsupported, but soon a 'regular' feature in ASL) to make your Interface answer for your official IPs.

    To ssh from your ASL, you've got to make a 'network' consisting of your ASL-Interface-IP that is the source ip of your ssh connection and the hostmask 255.255.255.255. Then create a packetfilter rule allowing ssh from this network to your destination host, and you're done. 

    Hope that brings light into the darkness  [:)]

    andreas
  • hi andy

    thanks for that.

    I thought when i added a interface route, it would mean that linux would "advertise" that IP on eth0 as well as it's assigned IP. or is this IP aliasing?

    emma ^..^
  • Hi Emma,


    just to clarify: on ASL, an interface route is a route going from a net or host to an interface (as in 

    192.168.2.0     0.0.0.0         255.255.255.0   U     0      0        0 eth0

    A static route is a route going from net or host to an IP Address (of the gateway you want to get the packets).

    10.10.10.10     192.168.2.1    255.255.255.255 UGH   0      0        0 eth0

    From what you had written, I supposed that you set a static ip route from your official IP address 211.211.211.211 to your inofficial IP on your eth3:

    211.211.211.211 192.168.3.1 255.255.255.255 eth3

    If that's the case, you're on the right way   [;)]
    But I'm sorry to say that your routing table just gets something to work after your TCP/IP stack got the packets, and without the modifications in my last post they won't get so far. Linux isn't intelligent enough to 'advertise' this IP automatically when used in a route.
    The point where 'automagically' would work would be proxy arp, but that won't work with DNAT.

    IP aliasing might well be the solution you search for. Try it on your console with :

    ifconfig eth0:0 211.211.211.211 netmask 255.255.255.0

    That will add an alias interface eth0:0 with your official ip. But watch out, since this isn't officially supported (yet    ), the WebAdmin won't detect that and your alias interface will be lost if your interface eth0 is going down.

    Hope that solves your problems. Nice to help you, though   [;)]

    andreas

    [ 20 June 2001: Message edited by: andreas ]
  • thanks Andy,

    Am I hopeful in thinking IP aliasing will be supported in version 1.9?
    In the mean time where do you think is the best place to put an IP alias line in astaro start-up scripts?
    I thought IP aliasing was "depreciated" in 2.4 kernels anyway  [:)]

    Also, will ASL be able to NAT IP/IP-range to IP/IP-range in the future to avoid having to add a DNAT for each service?

    Finally, im getting strange ping times from

    PING 192.168.3.1 (192.168.3.1) from 192.168.3.2 : 56(84) bytes of data.
    64 bytes from 192.168.3.1: icmp_seq=0 ttl=255 time=1.1 ms
    64 bytes from 192.168.3.1: icmp_seq=1 ttl=255 time=79000.8 ms
    64 bytes from 192.168.3.1: icmp_seq=2 ttl=255 time=158000.5 ms

    192.168.3.1 is eth3 on the firewall and 192.168.3.2 is the machine attached to it and  these results are form 3.2 to 3.1
    The other way is fine

    I wonder what that might be  [:(]

    many thanks for your kind patience

    Emma ^..^
  • Hi Emma  [:)],

    after a nice speak with main techie Gert  [;)]

    If I were you, I would write my own Startup-Script, put it in /sbin/init.d and create a symlink to it from /sbin/init.d/rc2.d/S95myownscript .

    Whats wrong with DNAT'ing services? You can create services & service groups, and since 1.810 you can map port ranges (with the limitation that you can only map the same range - so, for example, you can map ports 500-600 to 500-600 but not 500-600 to 300-400).

    Finally, your ping problem seems strange. Does that only happen to pings? Do the ping times grow constantly (10 pings, 100 pings, 1000 pings, ..)? I, too, wonder what that might be ...

    Hope I have helped you, although I'm not the right person to ask about release information and the what and when's - I am just a humble techie, not a sales person  [;)]

    andreas
Reply
  • Hi Emma  [:)],

    after a nice speak with main techie Gert  [;)]

    If I were you, I would write my own Startup-Script, put it in /sbin/init.d and create a symlink to it from /sbin/init.d/rc2.d/S95myownscript .

    Whats wrong with DNAT'ing services? You can create services & service groups, and since 1.810 you can map port ranges (with the limitation that you can only map the same range - so, for example, you can map ports 500-600 to 500-600 but not 500-600 to 300-400).

    Finally, your ping problem seems strange. Does that only happen to pings? Do the ping times grow constantly (10 pings, 100 pings, 1000 pings, ..)? I, too, wonder what that might be ...

    Hope I have helped you, although I'm not the right person to ask about release information and the what and when's - I am just a humble techie, not a sales person  [;)]

    andreas
Children
  • Hi Andy

    Thanks for your reply.

    I'll try NATing ip-ranges when I sort ping out.
    The problem seems to be with DNS.
    I can't query my DNS servers from 162.168.3.2 
    I have a rule that says Any DNS 192.168.3.2 allow and I have a DNAT that says
    211.211.211.211 DNS 192.168.3.2 DNS but i presume when 192.168.3.2 makes a request, replies are sent to 192.168.3.2
    How do i make this work? masquerading? SNAT? I'm not sure here. Any help would be appreciated. 

    Emma ^..^
  • Hi Emma,

    I can't quite make a sense of this.
    You're trying to announce 192.168.3.2 as official nameserver on IP 211.211.211.211 using DNAT, right?

    Should'nt that host, configured as nameserver, contact itself first when trying to resolve names? 

    Or did I get it totally wrong and you're trying to reach an external nameserver with which IP address and how's it connected to your net?

    Sorry, but it's early in the morning, and I can't grasp it (yet  [;)] )

    andreas
  • Good morning Andy

    Yes, you are correct about the DNS NAT, but the DNS server should contact another Machine on the internet when i can't reply.
    There is a better discription of the problem in a post called DNS proxy problem? that I posted last night.

    thanks

    Emma ^..^