How to create a gateway

Hi Forum

I have just got a /22 ipv4 range from ripe and have a downstream carrier that is announcing my IP’s.

The downstream providor has given me a public ip and route to use on our router for peering and this works fine, we can access the net, i can also issue public ip’s to customers can these are present and show the correct public ip.

The issue im having is that i have nat pool for some customers and want them to be presented over just one of our public ip’s, what i need to know is what route rule should i add and how.

I have the 1st public from our /22 range sat on the WAN int, if i add a rule to say 0.0.0.0/0 via 185.32.xxx.x then traffic stops.

Adrian

Typically for the NATed customers their default route would be sending traffic towards the NAT point and there you would be using a SRC NAT rule to create the NATed traffic.

Can you show the config that you have tried?

I only have Masq rules for the nat so all 172.16.x.x go out via the set interface i.e wan

can you give me a example

my public ip 185.32.10x.xxx and my nat range is 172.16.x.x

Adrian

If you want certain traffic to head out the WAN interface using a different specific public IP different from that which the Masquerade rule will use then place a SRC NAT rule with suitable selectors (e.g. SRC Address) above the Masquerade rule and use Action SRC NAT - e.g.:

add action=src-nat chain=srcnat out-interface=etherX src-address=E.F.G.H-J.K.L.M to-addresses=A.B.C.D

That worked great thanks, I just added ctp and udp srcnat rule

thanks Adrian