Skip to contentSkip to conversation

Dual WAN setup redux

DISCUSSION Dimitri Yioulos 3 participants 11 messages Jan 27, 2012 – Feb 2, 2012

lore
Share & tools
lore
#0 lore raw

Hi, folks.

Well, here I am, again, asking for help setting up a dual WAN. With a kind nod to Lloyd and Andy, I'm simply not getting this to work. And, my deadline for getting to good is now. So, even though this is a bit off-topic, I'm appealing, once again, for your help.

Let me see if I can provide all of the information you might need to assist me:

LAN: 192.168.100.0/24
DMZ: 192.168.1.0/24
WAN1 (up and working for a long time): 65.x.x.160/27, gw 65.x.x.161 WAN2 (new connection): 75.x.x.24/29, gw 75.x.x.30

eth0 - WAN1: 65.x.x.162
eth0:0-eth0:6: 65.x.x.163, 164, etc.
eth1 - LAN: 192.168.100.1
eth2 - DMZ: 192.168.1.1
eth3 - WAN2: 75.x.x.25
eth3:0-eth3:1: 75.x.x.26, 27

SNAT current DMZ hosts WAN1 addresses

I want to use WAN2 for a new Web server and test server living in the DMZ.

I created a new routing table called WAN2. Here's the output of "ip route show table WAN2":

75.x.x.24/29 dev eth3 scope link src 75.x.x.25
default via 75.x.x.30 dev eth3

Netstat -ar produces the following ourput:

75.x.x.24   *               255.255.255.248 U         0 0          0 eth3
65.x.x.160  *               255.255.255.224 U         0 0          0 eth0
10.8.0.0        vpn.mydomain.c 255.255.255.0   UG        0 0          0 eth2
192.168.1.0     *               255.255.255.0   U         0 0          0 eth2
192.168.100.0   *               255.255.252.0   U         0 0          0 eth1
default         65.x.x.161. 0.0.0.0                UG        0 0          0 eth0

The following are probably stupid noob questions, but here goes:

I can ping the WAN2 gateway address from our firewall/router, but not from any other network device (I can ping the gateway address of WAN1 just fine). Don't I have to be able to do that first?

I'm not sure what internal ip addresses to give the new Web server and test server (192.100.1.x, or 75.x.x.26-29.

I'm thinking that once I can get the above straight, iptables rules will be relatively simple to set up(I'll probably regret having said that :-) ).

Thanks.

Dimitri

Signature · 3 lines
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
#1 lore raw
Quoted 24 lines · Dimitri Yioulos

Let me see if I can provide all of the information you might need to assist me:
LAN: 192.168.100.0/24
DMZ: 192.168.1.0/24
WAN1 (up and working for a long time): 65.x.x.160/27, gw 65.x.x.161 WAN2 (new connection): 75.x.x.24/29, gw 75.x.x.30
eth0 - WAN1: 65.x.x.162
eth0:0-eth0:6: 65.x.x.163, 164, etc.
eth1 - LAN: 192.168.100.1
eth2 - DMZ: 192.168.1.1
eth3 - WAN2: 75.x.x.25
eth3:0-eth3:1: 75.x.x.26, 27
SNAT current DMZ hosts WAN1 addresses
I want to use WAN2 for a new Web server and test server living in the DMZ. I created a new routing table called WAN2. Here's the output of "ip route show table WAN2":
75.x.x.24/29 dev eth3 scope link src 75.x.x.25
default via 75.x.x.30 dev eth3
Netstat -ar produces the following ourput:

75.x.x.24   *               255.255.255.248 U         0 0          0 eth3
65.x.x.160  *               255.255.255.224 U         0 0          0 eth0
10.8.0.0        vpn.mydomain.c 255.255.255.0   UG        0 0          0 eth2
192.168.1.0     *               255.255.255.0   U         0 0          0 eth2
192.168.100.0   *               255.255.252.0   U         0 0          0 eth1
default         65.x.x.161. 0.0.0.0                UG        0 0          0 eth0
Quoted 5 lines

The following are probably stupid noob questions, but here goes:
I can ping the WAN2 gateway address from our firewall/router, but not from any other network device (I can ping the gateway address of WAN1 just fine). Don't I have to be able to do that first?

I don't see why you can't ping the eth3 interface address from other points in your network. Your routing table looks OK to me. Are you sure there are not firewall rules interfering? And yes, I think that until you get that to work, it's useless to try to go forward.

Quoted 2 lines

I'm not sure what internal ip addresses to give the new Web server and test server (192.100.1.x, or 75.x.x.26-29.

I'm not experienced at this, but I expected a DMZ to have public IP addresses, not to be natted just like your internal LAN. But anyway, of course you will need to assign some address in the 192.100.1.0/24 network to your web server in the DMZ, and use DNAT to allow it to respond to queries from the Internet. If you assign 192.168.1.3 to your web server, I think you would do something like this:

iptables -A PREROUTING -i eth3 -p tcp -dport 80 -j dnat --to-destination 192.168.1.3

For the test server, I assume you don't need for it to be accessible from outside your LANs, so no DNAT necessary. Just assign a LAN address to it like 192.168.1.5.

Others here will be much more able to help you, I think.

Signature · 1 line
Lloyd
#2 lore raw
In reply to Dimitri Yioulos
Quoted 1 line · Dimitri Yioulos

Well, here I am, again, asking for help setting up a dual WAN.

Any chance of an ascii diagram? It's a bit difficult to understand what you have and what you are trying to achieve without it.

Andy

#3 lore raw
Quoted 9 lines · Andrew Beverley
Quoted 1 line · Dimitri Yioulos

Well, here I am, again, asking for help setting up a dual WAN.

Any chance of an ascii diagram? It's a bit difficult to understand what you have and what you are trying to achieve without it.

Andy

Lloyd, Andy, and others,

Let me see what I can do here:

                                                                WAN2                       
                                ___________   75.x.x.24/29, gw 75.x.x.30
                                |              |---------eth3 (75.x.x.25) 
                                |              |      (eth0:0=75.x.x.26, ...)
Local network           |              |                   
192.168.100.0/22 ----|fw/router|                 WAN1
eth1 (192.168.100.1) |              |   65.x.x.160/27, gw 65.x.x.161
                                |__________|--------eth0 (65.x.x.162)
                                       |             (eth0:0=65.x.x.163, ... )
                                       |                     
                                    DMZ  
                           192.168.1.0/24             
                         eth1 (192.168.1.1)    
                                       |                                       |               
                                       |                      
                                       |
          ___________________|_____________________               
          |                   |                   |                   |
        box1            box2             box3            box4
   192.168.1.2  192.168.1.3   192.168.1.4   192.168.1.5
   (65.x.x.163    (65.x.x.164   
      eth0:0)          eth0:1)

I'd like for boxes 3 and 4 to use WAN2.

The above probably looks like an unholy mess (and it may be; a discussion for another day, though), but hope it helps clarify things. That's what I'm after.

Thanks.

Dimitri

Signature · 3 lines
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
#4 lore raw
Quoted 10 lines · Dimitri Yioulos
Quoted 5 lines · Andrew Beverley
Quoted 1 line · Dimitri Yioulos

Well, here I am, again, asking for help setting up a dual WAN.

Any chance of an ascii diagram? It's a bit difficult to understand what you have and what you are trying to achieve without it.

Lloyd, Andy, and others,

Let me see what I can do here:

<snip>

Hmmm, did you *compose* that in a fixed-width font? When *viewed* in a fixed-width font it's unreadable. It's slightly more readable when viewed in another font, but it would be worth sending again better-formatted if you can.

Andy

#5 lore raw
Quoted 19 lines · Andrew Beverley
Quoted 10 lines · Dimitri Yioulos
Quoted 5 lines · Andrew Beverley
Quoted 1 line · Dimitri Yioulos

Well, here I am, again, asking for help setting up a dual WAN.

Any chance of an ascii diagram? It's a bit difficult to understand what you have and what you are trying to achieve without it.

Lloyd, Andy, and others,

Let me see what I can do here:

<snip>

Hmmm, did you *compose* that in a fixed-width font? When *viewed* in a fixed-width font it's unreadable. It's slightly more readable when viewed in another font, but it would be worth sending again better-formatted if you can.

Quoted 7 lines

Andy

--
To unsubscribe from this list: send the line "unsubscribe netfilter" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

Sorry, I'm apparently not a very good ascii artist. :-)

At the risk of ticking the list off, I've attached the scheme as a png.

Dimitri

Signature · 3 lines
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
#6 lore raw
Quoted 1 line · Dimitri Yioulos

Sorry, I'm apparently not a very good ascii artist. :-)

Nope, you're artistic skills are fine. If your attachment is anything to go by, then you didn't compose in a fixed-width font. If you're writing/reading plain text, it's best to use Courier or similar.

Quoted 1 line

At the risk of ticking the list off, I've attached the scheme as a png.

Oh well, doesn't bother me, and that makes a lot more sense now.

Stand by for a reply to your original email.

Andy

#7 lore raw
In reply to Dimitri Yioulos
Quoted 8 lines · Dimitri Yioulos

I want to use WAN2 for a new Web server and test server living in the DMZ.

I created a new routing table called WAN2. Here's the output of "ip route show table WAN2":

75.x.x.24/29 dev eth3 scope link src 75.x.x.25
default via 75.x.x.30 dev eth3

In which case you need to force traffic from/to your new webserver to use the routing table above.

Quoted 1 line

75.x.x.24 * 255.255.255.248 U 0 0 0 eth3

This is saying any traffic for 75... should go via eth3.

Quoted 4 lines

65.x.x.160 * 255.255.255.224 U 0 0 0 eth0

10.8.0.0        vpn.mydomain.c 255.255.255.0   UG        0 0          0 eth2
192.168.1.0     *               255.255.255.0   U         0 0          0 eth2
192.168.100.0   *               255.255.252.0   U         0 0          0 eth1

Likewise for these.

Quoted 1 line

default 65.x.x.161. 0.0.0.0 UG 0 0 0 eth0

And anything else should go via 65...

So, at the moment, there's nothing making traffic use eth3, unless it happens to be on that same subnet.

Quoted 4 lines

The following are probably stupid noob questions, but here goes:

I can ping the WAN2 gateway address from our firewall/router, but not from any other network device (I can ping the gateway address of WAN1 just fine).

See point above.

Quoted 2 lines

Don't
I have to be able to do that first?

Yes.

Quoted 2 lines

I'm not sure what internal ip addresses to give the new Web server and test server (192.100.1.x, or 75.x.x.26-29.

You could do either. If you've been issued with a 'spare' public IP address, then you might as well use that, as it saves SNAT.

If you're not using 75.x.x.26-29 then you could use one of these. But you should not be assigning them all to eth3 as aliases (as per your diagram). You only need one there.

In summary, if I understand your setup correctly, you should be able to assign *one* of your public IP addresses to eth3, and then assign another one to the web server, assuming they're all in the same subnet and you get the subnets correct.

Once you've done that, as long as IP forwarding is enabled and you ACCEPT the packets in iptables then it should work.

Andy

#8 lore raw
Quoted 61 lines · Andrew Beverley
Quoted 8 lines · Dimitri Yioulos

I want to use WAN2 for a new Web server and test server living in the DMZ.

I created a new routing table called WAN2. Here's the output of "ip route show table WAN2":

75.x.x.24/29 dev eth3 scope link src 75.x.x.25
default via 75.x.x.30 dev eth3

In which case you need to force traffic from/to your new webserver to use the routing table above.

Quoted 1 line

75.x.x.24 * 255.255.255.248 U 0 0 0 eth3

This is saying any traffic for 75... should go via eth3.

Quoted 5 lines

65.x.x.160 * 255.255.255.224 U 0 0 0 eth0
10.8.0.0 vpn.mydomain.c 255.255.255.0 UG 0 0 0
eth2 192.168.1.0 * 255.255.255.0 U 0 0
0 eth2 192.168.100.0 * 255.255.252.0 U 0 0

      0 eth1

Likewise for these.

Quoted 2 lines

default 65.x.x.161. 0.0.0.0 UG 0 0
0 eth0

And anything else should go via 65...

So, at the moment, there's nothing making traffic use eth3, unless it happens to be on that same subnet.

Quoted 5 lines

The following are probably stupid noob questions, but here goes:

I can ping the WAN2 gateway address from our firewall/router, but not from any other network device (I can ping the gateway address of WAN1 just fine).

See point above.

Quoted 2 lines

Don't
I have to be able to do that first?

Yes.

Quoted 2 lines

I'm not sure what internal ip addresses to give the new Web server and test server (192.100.1.x, or 75.x.x.26-29.

You could do either. If you've been issued with a 'spare' public IP address, then you might as well use that, as it saves SNAT.

If you're not using 75.x.x.26-29 then you could use one of these. But you should not be assigning them all to eth3 as aliases (as per your diagram). You only need one there.

In summary, if I understand your setup correctly, you should be able to assign *one* of your public IP addresses to eth3, and then assign another one to the web server, assuming they're all in the same subnet and you get the subnets correct.

Quoted 6 lines

Once you've done that, as long as IP forwarding is enabled and you ACCEPT the packets in iptables then it should work.

Andy

Andy,

Thanks for your efforts, especially as you're dealing with someone as dense as me.

On the test machine (call it box 3 in the diagram), I changed the ip to be 75.x.x.28, netmask 255.255.255.248, network 75.x.x.24. I set the gateway to be 75.x.x.25 (eth3 address on the firewall/router). I can't ping anything.

At this point, is it a firewall rule issue? If so, what is/are the rule(s) I need to add?

If I had my choice, though, I'd rather assign an address of 192.168.1.x to the test machine (as with the rest of the devices in the DMZ), and make it use the WAN2 connection instead of WAN1 that the other devices are using.

Hope I'm not being too much of a pita here.

Dimitri

Signature · 3 lines
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
#9 lore raw
Quoted 11 lines · Dimitri Yioulos
Quoted 4 lines

In summary, if I understand your setup correctly, you should be able to assign *one* of your public IP addresses to eth3, and then assign another one to the web server, assuming they're all in the same subnet and you get the subnets correct.

Thanks for your efforts, especially as you're dealing with someone as dense as me.

On the test machine (call it box 3 in the diagram), I changed the ip to be 75.x.x.28, netmask 255.255.255.248, network 75.x.x.24. I set the gateway to be 75.x.x.25 (eth3 address on the firewall/router). I can't ping anything.

What are your actual IP addresses?

Quoted 2 lines

At this point, is it a firewall rule issue? If so, what is/are the rule(s) I need to add?

You'll need something like "iptables -A FORWARD -o eth3 -j ACCEPT", assuming that your default policy is DROP. Plus the associated inbound connection ("iptables -A FORWARD -i eth3 -j ACCEPT"). Of course, you should tighten these up, but I'd get it working first.

Quoted 2 lines

If I had my choice, though, I'd rather assign an address of 192.168.1.x to the test machine (as with the rest of the devices in the DMZ),

I suggest you get it working with the public IP address first, as it's less things to configure.

Andy

#10 lore raw
In reply to Dimitri Yioulos
Quoted 3 lines · Dimitri Yioulos

On the test machine (call it box 3 in the diagram), I changed the ip to be 75.x.x.28, netmask 255.255.255.248, network 75.x.x.24. I set the gateway to be 75.x.x.25 (eth3 address on the firewall/router). I can't ping anything.

I wasn't very clear in my last post. You'll need to separate out that small block into different subnets, as they're on different interfaces.

Quoted 3 lines

If I had my choice, though, I'd rather assign an address of 192.168.1.x to the test machine (as with the rest of the devices in the DMZ), and make it use the WAN2 connection instead of WAN1 that the other devices are using.

Actually, it's probably as easy to do this. Set the 192.168.1.x IP address on the test machine, then try pinging eth3's IP address from the test machine. That should work. Then try the gateway on the same subnet. That should also work.

Once that's working, then you should be able to do a DNAT on the firewall to send packets coming in on eth3 to the test machine (192.168.1.x).

Andy