M
M
Maxim2014-12-18 14:37:26
Computer networks
Maxim, 2014-12-18 14:37:26

Mikrotik: how to assign external IPs to servers in the local network?

There is a server on freebsd, it is also used as a router. One cord comes from the provider, the provider issues one IP + /30 subnet. All these addresses are used by the server itself. The second lace goes to the local area for the distribution of the Internet.
The settings are:

defaultrouter="1.1.252.1"
gateway_enable="YES"
ifconfig_rl0="inet 1.1.252.244 netmask 255.255.255.0"
ifconfig_rl0_alias0="inet 2.2.138.172 netmask 255.255.255.252"
ifconfig_rl0_alias1="inet 2.2.138.173 netmask 255.255.255.252"
ifconfig_rl0_alias2="inet 2.2.138.174 netmask 255.255.255.252"
ifconfig_fxp0="inet 192.168.2.100  netmask 255.255.255.0"

ifconfig is like this:
rl0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
        options=8<VLAN_MTU>
        inet 1.1.252.244 netmask 0xffffff00 broadcast 1.1.252.255
        inet 2.2.138.172 netmask 0xfffffffc broadcast 2.2.138.175
        inet 2.2.138.173 netmask 0xfffffffc broadcast 2.2.138.175
        inet 2.2.138.174 netmask 0xfffffffc broadcast 2.2.138.175
fxp0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
        inet 192.168.2.100 netmask 0xffffff00 broadcast 192.168.2.255

In general, everything is simple and standard.
Suddenly, a Mikrotik RB951G-2HnD falls on me, along with the need to make a gateway on it.
The main IP goes to mikrotik. But with the subnet, I would like to do the following: assign 1 ip from the subnet to mikrotik, and the second - to the server in the local area. The remaining capacity of the subnet is not of interest.
Actually, the questions are:
1. How to assign one IP from the subnet to mikrotik to the same interface as the main IP?
2. How to assign another IP from the subnet to the server inside the local area?
3. Will it be necessary to connect the server with two cords for this, one for 192.168.2.x, the other for external (and, accordingly, occupy an extra port in mikrotik with this second cord), or is it possible on the server to get both IPs (both local and external) on one interface on one cord from the mikrotik LAN port?
There is a suspicion that all these things are basic for a network engineer, but unfortunately I am not. Using the method of poke and thoughtful reading, I think I will be able to set up everything I need sooner or later, but the piquancy of the situation is that you need to switch as quickly as possible, and the server downtime needs to be minimized.
In addition to questions - if someone is ready to help with network matters regarding mikrotik in private correspondence, please write in a personal, I will be very grateful.

Answer the question

In order to leave comments, you need to log in

5 answer(s)
A
Armenian Radio, 2014-12-18
@gbg

Option without using an additional line: Use VLAN. I don’t know how things are with the latest windows, but versions of XP and around - nothing, VLAN only worked on cards whose drivers supported it.
Linux has no problems with vlan.
You simply connect the socket with the provider cable and the vlan server to the bridge, and configure the bridge interface as a router connection to the Internet.
Without VLAN, you do everything the same, only not vlan will go to the bridge, but another socket on the router, into which an additional cable will go.

A
Archie Kuznetsov, 2014-12-21
@Wolf4ara

Good afternoon.
If there is only one link from the provider, then use the ip-ip/ tunnel Like
this:
netwild.ru/linuxipip
(if I understand the condition of your task correctly =))

V
Vasily, 2015-01-19
@CTpaHHoe

the interface is assigned the address of the local network and the address of the provider is forwarded to it. how to do this can be found here: www.lan23.ru/FAQ-Mikrotik-RouterOS-part2.html

A
alexnov66, 2015-02-11
@alexnov66

The provider issues an address with a mask of 30, which means that you are given one address and not two, the second address is used as a gateway for the first one.

K
Kirill Vasiliev, 2015-02-18
@vasilevkirill

If the provider allows you to shine several MAC addresses into its link, then look in the direction of arp-proxy or bridge the provider's interface, and wrap the LAN in vlan

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question