Guest User!

You are not Sophos Staff.

network design help, please?

Ok, I'm trying to setup my home network with Astaro as my firewall.  My old setup was simple, a class C routed to the one IP of the cablemodem.  I've lost the class C and now just have 10 IPs which arrive at the cablemodem. (not routed to a single IP)

So, what I'd like to do is have some of the machines inside have real IPs and others have just local ones. (and the ones with real IPs would also have local ones so they can access the services of the local machines)

What I'm trying to wrap my mind around is who gets what IP, and how to route the packets right.

There's two methods that I can think of for this.. 
1. Every box just gets a local IP, and all packets to it's public IP get translated to it's local IP.
(24.108.158.227 is the win2k box's public IP, and all it has is 192.168.42.5, the firewall translates everything coming and going from/to those IPs)
The problem I see with this is things like FTP which would use the 192 IP and mess things up.

2. Give the publically accessed servers the public IP directly and just have astaro route to the server. (like a normal router)
The problem I have with this is just trying to figure out how to do this.  The public IPs are just sitting at the cablemodem.  I can do an IP alias on the FW's public interface, but how do I get the packets inside to another server with the same ip?
(I'm guessing proxy ARP might be involved, but not sure how to set it up)  A further problem with this one will be getting the public machines to talk to the private ones(I don't know if win2k likes multiple IPs on an interface) 

I hope this isn't too muddled, just trying to wrap my mind around all this is causing me to lose more hair than I can afford.   [:)]

Greg
  • hi greg !

    get the latest beta, it supports proxy ARP in webadmin (and you will need it).
    assign one of the official IPs to the ASL's external interface. distribute the rest behind the ASL.

    define all "official" hosts with netmask 255.255.255.255.

    set a route to these hosts, pointing to the internal interface.

    activate proxy ARP on ext. interface. (or both)

    define your 192.168.x.x network and masq. it over the external iface.

    poof. done. !      

    for some more insight, read the last post in this thread:
     http://www.astaro.org/cgi/ultimatebb.cgi?ubb=get_topic&f=2&t=000313 

    UPDATE: thought about it. some more points:
    1. define the cable modem ip also as a host.2
    2. set a route to the cable modem on ext. iface.
    3. enable proxy ARP on BOTH ifaces
    4. let internal "offical" clients use cable modem IP as default gw.

    and tell me if it worked ... ;D

    /tom

    [ 12 July 2001: Message edited by: tom ]
  • Ok, so far, almost so good.   [:)]

    I've defined the hosts, the routes, proxy arps.(on both internal and external)

    I can reach the machine from the outside.. (for the moment I've totally opened up the rules)
    But when I try to reach something from within, I get:
    IP-SPOOFING Drop: IN=eth0 OUT= MAC=00:a0:4b:02:eb:71:00:10:a4:aa:9c:76:08:00 SRC=24.108.158.229 DST=205.200.78.71 LEN=48 TOS=0x00 PREC=0x00 TTL=128 ID=7267 DF PROTO=TCP SPT=2280 DPT=80 WINDOW=16384 RES=0x00 SYN URGP=0

    .229 is the real IP, and assigned to an internal machine.  I've got it's default route set to the real IP of the firewall(which is on the outside, but proxy arped inside)

    So, How do I get it to stop killing the packets?

    Thanks for all the help so far, BTW, I've almost got this working.   [:)]

    Greg
  • hi greg,

    please post a list of the official IPs and

    1. ip/netmask on cable modem
    2. ip/netmask on ext. ASL iface
    3. ip/netmask on int. ASL iface

    also, maybe try to use the cable modem IP as def. gw for the internal clients (but I guess that won't remove the problem)

    /tom
  • Ok, here's the start of the IPs.
    24.108.158.225
    24.108.158.226
    .
    .
    24.108.158.235
    netmask is 255.255.255.128
    gateway is 24.108.158.129
    (this is all the info from the cable company.)

    So, here's what I have set on the FW.
    network/interfaces:
    default gateway: 24.108.158.129
    hostname: gw2.gawd.mb.ca(not in DNS yet)

    network card eth0
    name intern
    IP 192.168.42.1
    subnet 255.255.255.0
    ProxyARP is checked.

    Network card eth1
    Name: cablemodem
    IP: 24.108.158.225
    subnet: 255.255.255.128
    Proxyarp is checked.

    There are no IP aliases.

    The win2k box I'm testing this with has this in ipconfig:
    DNS suffix: gawd.mb.ca
    IP: 24.108.158.229
    Subnet: 255.255.255.128
    Gateway: 24.108.158.225

    Now, under definitions/network:
    Name: spiff
    IP: 24.108.158.229
    Subnet: 255.255.255.255

    And under network/routing:
    Interface route:
    spiff -> intern

    Routing table:
    Kernel IP routing table
    Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
    24.108.158.227  0.0.0.0         255.255.255.255 UH    0      0        0 eth0
    24.108.158.226  0.0.0.0         255.255.255.255 UH    0      0        0 eth0
    24.108.158.229  0.0.0.0         255.255.255.255 UH    0      0        0 eth0
    24.108.158.228  0.0.0.0         255.255.255.255 UH    0      0        0 eth0
    24.108.158.128  0.0.0.0         255.255.255.128 U     0      0        0 eth1
    192.168.42.0    0.0.0.0         255.255.255.0   U     0      0        0 eth0
    0.0.0.0         24.108.158.129  0.0.0.0         UG    0      0        0 eth1

    packet filter/rules:
    Any  Any  Any  Allow

    And as I said earlier, when I try from the Net to the 229 IP, it works.
    When I try to get out, I get the errors mentioned above.

    Greg
  • ok, do this:

    1. change the netmask on eth1 to 255.255.255.255

    2. define host "gateway" as xx.xx.xx.129/255.255.255.255 on set a route to it on the eth1

    3. continue to use eth1 ip as default gw. (cable modem does proxy ARP itself, it seems) 

    I did not know that the "loose" IPs are in the same network, and that the ISP actually gave you a netmask to use. The IP-spoofing occurs because the firewall expects the IPs to be on the eth0 side, because of the .128 netmask.  [:)]
    /tom
  • Ok, I set it up as netmask 255.255.255.255 on eth1.
    But, it's complaining about it's network...
    Here's the routing table.. (I put in .225 to eth1 myself)
    gw2:/home/login # route -n
    Kernel IP routing table
    Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
    24.108.158.227  0.0.0.0         255.255.255.255 UH    0      0        0 eth0
    24.108.158.129  0.0.0.0         255.255.255.255 UH    0      0        0 eth1
    24.108.158.226  0.0.0.0         255.255.255.255 UH    0      0        0 eth0
    24.108.158.225  0.0.0.0         255.255.255.255 UH    0      0        0 eth1
    24.108.158.229  0.0.0.0         255.255.255.255 UH    0      0        0 eth0
    24.108.158.228  0.0.0.0         255.255.255.255 UH    0      0        0 eth0
    192.168.42.0    0.0.0.0         255.255.255.0   U     0      0        0 eth0
    127.0.0.0       0.0.0.0         255.0.0.0       U     0      0        0 lo

    and her's the ifconfig:
    gw2:/home/login # ifconfig -a
    eth0      Link encap:Ethernet  HWaddr 00:A0:4B:02:EB:71
              inet addr:192.168.42.1  Bcast:192.168.42.255  Mask:255.255.255.0
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              RX packets:1417 errors:0 dropped:0 overruns:0 frame:0
              TX packets:1451 errors:0 dropped:0 overruns:0 carrier:0
              collisions:3 txqueuelen:100
              Interrupt:11 Base address:0xe800

    eth1      Link encap:Ethernet  HWaddr 00:A0:4B:04:AE:1C
              inet addr:24.108.158.225  Bcast:24.108.158.225  Mask:255.255.255.255
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              RX packets:1087 errors:0 dropped:0 overruns:0 frame:0
              TX packets:5 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:100
              Interrupt:10 Base address:0xec00

    Oh yes, and the error:
    gw2:/home/login # ping 154.11.89.162
    PING 154.11.89.162 (154.11.89.162): 56 data bytes
    ping: sendto: Network is unreachable
    ping: wrote 154.11.89.162 64 chars, ret=-1

    This is probably something silly, but I can't see it.

    Greg
  • Figured this one out...
    No default route..
    Seems it's getting confused on startup and not putting the default route in..
    Throwing it in get's me a working system.
    (at least a packet passing system, haven't made up any rules yet)

    So, why is it confused about the default route?

    Greg
  • the core problem is the fucked-up way that your ISP hands out its IPs:

    they give you a default gateway and a netmask of a half class C, but you only get a handful of IPs out of that.

    If you use their netmask on the ext. interface, and put the hosts on the int. interface, the ASL has 2 routes for each IP address and that results in the spoofing messages. We fixed that by removing the offending netmask. 

    Now we have the problem that the ASL does not recognize the default gateway IP as valid because it does not have it as a member in networks on its interfaces !

    If your ISP would do things right, he would give you a regular 16-IP network (13 IPs useable), that you could split and use properly.

    You will need to add the default route setup to a middleware script. Look here:
     http://www.astaro.org/cgi/ultimatebb.cgi?ubb=get_topic&f=10&t=000010 

    put it in the packet filter script. that way it will never get lost.  [:)]

    /tom