cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
241
Views
0
Helpful
2
Replies

How to route by gateway addresses NAT pools

rtwwpad
Level 1
Level 1

Hi All

I have a problem

We have a 192.168.1.0 network running as a class C. I want 192.168.1.1 as a gateway and 192.168.1.2 as a gateway.

I want machines who come to the 192.168.1.1 gateway to go out of one of our internet connections via ISP1.

I want machines that come to the 192.168.1.2 gateway to go out to the internet via ISP2.

I will simply overload the ISP interface address as a pool with NAT/PAT to go out.

The question is how to do make it make that choice?

I thought I might be able to do it as follows

Define Eth0 as 192.168.1.1

Define 192.168.1.2 as a secondary address on Eth0

Use a route map statement to select which pool they will go out of with a match and next hop statement.

However there is no way of defining a match on the gateway address. So how can I get around this?

The only thing I can think of is that I am going to have to put another ethernet card into the router and add another interface with the 192.168.1.2 address on it and run this on the network. But then I realised I am still in the same boat as I can only allocate a specific nat pool by host ip address and I am still only running the 192.168.1.0 network.

My final thought which may work is that I have to replace 192.168.1.0 and run the 192.168.2 and .3 network as a 255.255.254 network.

Eth0 has an ip of 192.168.2.1 and

a secondary address of 192.168.3.1

Then have a rule which says 192.168.2.x machines goto ISP1 nat pool 192.168.3.x machines goto ISP2 nat pool.

Thoughts anyone?

It seems annoying and terrible that I have to do it this way and there is no way to select by interface or ip address sent to.

Any help appreciated.

Kind regards

Phil

2 Replies 2

preddyi
Level 3
Level 3

If ur requirement is simply few machines to go via ISP1 link and remaining machines via ISP2 link for load sharing purpose.

1.Use only one IP on the Eth port of router.(192.168.1.1, this is GW for every body)

2.Use route-map for NAT (Based on the source address of the machine) overload with diffrent ISP pools/IP

Its something I have considered. However the machines have they're addresses allocated by DHCP so unless I fix them with a static ip to mac mapping in the DHCP server I cannot guarantee the source address. I am simply moving the problem off the Cisco routers and onto the DHCP server.

I thought I might be able to do something clever with loopback interfaces but I don't think I can know, as you cannot have two ports on the same router in the same subnet unless you bridge between them. Even loopback addresses.

I thought I could leave eth 1 unnumbered and then have two loopbacks 192.168.1.1 and 192.168.1.2 and this would resolve the issue but sadly not.

phil

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: