Cisco Support Community
Showing results for 
Search instead for 
Did you mean: 

Welcome to Cisco Support Community. We would love to have your feedback.

For an introduction to the new site, click here. If you'd prefer to explore, try our test area to get started. And see here for current known issues.

New Member

How to route by gateway addresses NAT pools

Hi All

I have a problem

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

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

I want machines that come to the 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

Define 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 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 network.

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

Eth0 has an ip of and

a secondary address of

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


New Member

Re: How to route by gateway addresses NAT pools

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.(, 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

New Member

Re: How to route by gateway addresses NAT pools

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 and and this would resolve the issue but sadly not.