Community discussions

MikroTik App
 
tydannel
just joined
Topic Author
Posts: 2
Joined: Wed Nov 10, 2021 3:04 pm

Multiple public IP addresses on CHR VM

Wed Nov 10, 2021 3:23 pm

Hi there

My setup is as follows:
I have a CHR on a virtual machine with 2 public static IP addresses on the same interface (ether1)
Address1: 160.xxx.xxx.54/24
Address2: 160.xxx.xxx.55/24
Gateway: 160.xxx.xxx.1

I have setup l2tp and have 2 clients connected both on the same Mikrotik router (RB2011UiAS-RM):
Client1: local: 192.168.100.1 remote: 192.168.100.10
Client2: local: 192.168.101.1 remote: 192.168.101.10

I have 2 devices connected to the Mikrotik router:
Device1: interface: ether2, address: 192.168.88.254/24
Device2: interface: ether3, address: 192.168.88.253/24

My goal is to route traffic as follows
192.168.88.253 -> 160.xxx.xxx.54
160.xxx.xxx.54 -> 192.168.88.253

192.168.88.254 -> 160.xxx.xxx.55
160.xxx.xxx.55  -> 192.168.88.254
 
tydannel
just joined
Topic Author
Posts: 2
Joined: Wed Nov 10, 2021 3:04 pm

Re: Multiple public IP addresses on CHR VM  [SOLVED]

Fri Nov 12, 2021 8:57 pm

I managed to solve the issue by going over a bunch of solutions on the forum, most of the solutions I found say you must put he public IP address in the remote-address option of the ppp secret, however in my case the important piece required to get this to work is to add the addresses to /ip arp with the correct interface and the publish option set, here is the important part of the config, for my own future reference and for anyone else that might need it.

Also the reason I am doing this is because I have a number of devices that need a public static IP address with port forwarding (helium miners) on my network (I run a small WISP that offers free internet for hosting a miner) and our all the DSL providers in the area only offer 1 public static IP address per account, whereas I can get 16+ IP addresses from a VPS provider not far from our exchange so it adds a bit of latency but its manageable (from 35ms to 50ms). So if anyone else has issues like this, this is a pretty good solution :D
/interface list
add name=LAN
add name=WAN

/ppp profile
add interface-list=LAN name=pptp

/interface list member
add interface=ether1 list=WAN

/interface pptp-server server
set enabled=yes

/ip address
add address=4x.xx.xx.26/24 interface=ether1 network=4x.xx.xx.0

/ip arp
add address=4x.xx.xx.61 interface=ether1 published=yes
add address=4x.xx.xx.64 interface=ether1 published=yes
add address=4x.xx.xx.130 interface=ether1 published=yes
add address=4x.xx.xx.139 interface=ether1 published=yes
add address=4x.xx.xx.142 interface=ether1 published=yes
add address=4x.xx.xx.143 interface=ether1 published=yes
add address=4x.xx.xx.144 interface=ether1 published=yes
add address=4x.xx.xx.145 interface=ether1 published=yes

/ip dhcp-client
add add-default-route=no !dhcp-options interface=ether1 use-peer-ntp=no

/ip route
add distance=1 gateway=4x.xx.xx.1

/ip service
set telnet disabled=yes

/ppp secret
add local-address=192.168.200.1 name=xxx1 profile=pptp remote-address=4x.xx.xx.61 service=pptp
add local-address=192.168.200.2 name=xxx2 profile=pptp remote-address=4x.xx.xx.64 service=pptp
add local-address=192.168.200.3 name=xxx3 profile=pptp remote-address=4x.xx.xx.130 service=pptp
add local-address=192.168.200.4 name=xxx4 profile=pptp remote-address=4x.xx.xx.139 service=pptp
add local-address=192.168.200.5 name=xxx5 profile=pptp remote-address=4x.xx.xx.142 service=pptp
add local-address=192.168.200.6 name=xxx6 profile=pptp remote-address=4x.xx.xx.143 service=pptp
add local-address=192.168.200.7 name=xxx7 profile=pptp remote-address=4x.xx.xx.144 service=pptp
add local-address=192.168.200.8 name=xxx8 profile=pptp remote-address=4x.xx.xx.145 service=pptp

Who is online

Users browsing this forum: konradnh, NetworqAndy, zabloc and 77 guests