Community discussions

MikroTik App
 
aamikro
just joined
Topic Author
Posts: 9
Joined: Tue Dec 15, 2009 5:36 pm

Multiple Public IPs

Tue Dec 15, 2009 5:43 pm

Hello,

I have a MikroTik 4.2 working as PPPoE.

I'm forwarding port 80 from the public IP that gets assigned to the PPPoE port to a web server
inside. Everything works great.

Now I need to install another web server "inside" with another public ip which is already been routed
to the same PPPoE connection. How do I configure the MikroTik?

Thanks!
 
User avatar
astounding
Member Candidate
Member Candidate
Posts: 121
Joined: Tue Dec 16, 2008 12:17 am

Re: Multiple Public IPs

Tue Dec 15, 2009 10:51 pm

Assuming a very simple network;
Internet===<PPPoE>===[MikroTik]===LAN (including host you want 2nd public IP routed to)
assuming that you will NOT be doing filtering or NAT/Masquerading on any packets with the 2nd public IP as either SOURCE or DESTINATION address;

assuming your ISP has correctly routed the 2nd public IP to your 1st public PPPoE IP;

AND assuming the internal (LAN) host to which you want the 2nd IP routed has BOTH a local LAN IP address that won't change AND also is configured with the 2nd public IP;


THEN the solution is as simple as adding a single static route:

/ip route add dst-address=2ND.PUB.LIC.IP/32 gateway=LAN.IP.OF.HOST

If on the other hand, the internal LAN host ONLY has a private LAN IP, then you will need to set up NAT rules.

Aaron out.
 
Pada
Member Candidate
Member Candidate
Posts: 150
Joined: Tue Dec 08, 2009 11:37 pm
Location: South Africa, Stellenbosch

Re: Multiple Public IPs

Wed Dec 16, 2009 1:25 am

I'm guessing your situation would look like:
Internet===<PPPoE 1>===[MikroTik]===LAN: Server 1 & Server 2
        ===<PPPoE 2>===
And you want it in such a way that if someone access PPPoE 1's IP:80, it should forward to Server 1, and PPPoE 2:80 should forward to Server 2?

For this setup, you would simply need 2 separate dstnat NAT entries:
  • One with the the In Interface=PPPoE1 and the To Address & Port pointing to Server 1,
  • and one with the In Interface=PPPoE2 and the To Address & Port pointing to Server 2
The code would look something like:
/ip firewall nat
 add chain=dstnat action=dst-nat to-addresses=10.0.0.100 to-ports=80 protocol=tcp in-interface=pppoe1 dst-port=80
 add chain=dstnat action=dst-nat to-addresses=10.0.0.101 to-ports=80 protocol=tcp in-interface=pppoe2 dst-port=80
 
aamikro
just joined
Topic Author
Posts: 9
Joined: Tue Dec 15, 2009 5:36 pm

Re: Multiple Public IPs

Wed Dec 16, 2009 6:53 pm

Thanks astounding. It worked!

I just added NAT so I didn't need to change the server settings.

GREAT HELP! thanks again.

Who is online

Users browsing this forum: MarkusT and 72 guests