Присвоить белый IP для подсети из пула.

Обсуждение ПО и его настройки
Ответить
shvedoff
Сообщения: 11
Зарегистрирован: 26 апр 2019, 11:53

Добрый вечер.
Провайдер выдает несколько белых адресов, допустим с 37.10.23.12 до 37.10.23.28
По умолчанию у меня определяется у всех к примеру 37.10.23.13.
Как мне сделать так, чтобы пользователю из второй подсети 192.168.10.X (те которые из VLAN4) присваивался другой внешний IP, к примеру 37.10.23.19.
За ранее спасибо.

Ниже конфиг:

/interface bridge
add admin-mac=B8:69:F4:BD:FA:9F auto-mac=no comment=defconf name=bridge
/interface vlan
add arp=reply-only interface=ether2 name=vlan4 vlan-id=4
/interface list
add comment=defconf name=WAN
add comment=defconf name=LAN
/interface wireless security-profiles
set [ find default=yes ] supplicant-identity=MikroTik
/ip dhcp-server
add add-arp=yes authoritative=after-2sec-delay disabled=no interface=vlan4 name=vlan4
/ip pool
add name=dhcp ranges=10.0.0.2-10.0.0.254
add name=dhcp-vlan4 ranges=192.168.10.2-192.168.10.254
/ip dhcp-server
add address-pool=dhcp disabled=no interface=bridge name=defconf
/interface bridge port
add bridge=bridge comment=defconf interface=ether2
add bridge=bridge comment=defconf interface=ether3
add bridge=bridge comment=defconf interface=ether4
add bridge=bridge comment=defconf interface=ether5
add bridge=bridge comment=defconf interface=ether6
add bridge=bridge comment=defconf interface=ether7
add bridge=bridge comment=defconf interface=ether8
add bridge=bridge comment=defconf interface=ether9
add bridge=bridge comment=defconf interface=ether10
add bridge=bridge comment=defconf interface=sfp-sfpplus1
/interface bridge settings
set use-ip-firewall=yes
/ip neighbor discovery-settings
set discover-interface-list=LAN
/interface list member
add comment=defconf interface=bridge list=LAN
add comment=defconf interface=ether1 list=WAN
add interface=vlan4 list=LAN
/ip address
add address=10.0.0.1/24 comment=defconf interface=bridge network=10.0.0.0
add address=192.168.10.1/24 interface=vlan4 network=192.168.10.0
/ip arp
add address=192.168.10.23 interface=vlan4 mac-address=F0:76:1C:B9:08:BA
/ip dhcp-client
add comment=defconf dhcp-options=hostname,clientid disabled=no interface=ether1
/ip dhcp-server network
add address=10.0.0.0/24 comment=defconf dns-server=10.0.0.1 gateway=10.0.0.1 netmask=24
add address=192.168.10.0/24 dns-server=192.168.10.1 gateway=192.168.10.1 netmask=24
/ip dns
set allow-remote-requests=yes
/ip dns static
add address=10.0.0.1 name=router.lan
/ip firewall filter
add action=accept chain=input dst-port=8291 protocol=tcp
add action=accept chain=input comment="defconf: accept established,related,untracked" connection-state=established,related,untracked
add action=drop chain=input comment="defconf: drop invalid" connection-state=invalid
add action=accept chain=input comment="defconf: accept ICMP" protocol=icmp
add action=drop chain=input comment="defconf: drop all not coming from LAN" in-interface-list=!LAN
add action=accept chain=forward comment="defconf: accept in ipsec policy" ipsec-policy=in,ipsec
add action=accept chain=forward comment="defconf: accept out ipsec policy" ipsec-policy=out,ipsec
add action=fasttrack-connection chain=forward comment="defconf: fasttrack" connection-state=established,related
add action=accept chain=forward comment="defconf: accept established,related, untracked" connection-state=established,related,untracked
add action=drop chain=forward comment="defconf: drop invalid" connection-state=invalid
add action=drop chain=forward comment="defconf: drop all from WAN not DSTNATed" connection-nat-state=!dstnat connection-state=new in-interface-list=WAN
/ip firewall nat
add action=masquerade chain=srcnat comment="defconf: masquerade" ipsec-policy=out,none out-interface-list=WAN
add action=dst-nat chain=dstnat dst-port=13074 protocol=tcp src-address-list="" to-addresses=10.0.0.4 to-ports=80
add action=dst-nat chain=dstnat dst-port=13077 protocol=tcp to-addresses=10.0.0.7 to-ports=13077
add action=masquerade chain=srcnat out-interface=ether1 src-address=10.0.0.0/24
add action=masquerade chain=srcnat out-interface=ether1 src-address=192.168.10.0/24
/ip service
set winbox address=0.0.0.0/0
/system clock
set time-zone-name=Asia/Almaty
/system routerboard settings
set silent-boot=no
/tool mac-server
set allowed-interface-list=LAN
/tool mac-server mac-winbox
set allowed-interface-list=LAN


anad
Сообщения: 185
Зарегистрирован: 24 ноя 2016, 21:14

честно не читал конфиг.
Если "присвоить" это выпустить в сеть интернет через nat с src ip таким-то, но примерно так
/ip firewal nat add chain=srcnat action=src-nat to-addresses=31.31.31.31 src-address=192.168.100.0/24 log=no log-prefix=""
разместить соотв до умолчания
само собой что у Вас на интерфейсе должен висеть и 31.31.31.31


Ответить