Glad to write in the forum again after long time .
i have a case need to do , i tried to program it but it failed at last .
what i need to do as follow :
1. i have RB493AH , i am marking the connection , packet and the route for my clients working with the wireless and wire networks which they are in bridge1 .
i mark the traffic ports and then let that traffic to my first public1 interface .
also i mark the traffic coming from groups of users and route them to internet so each group use one IP of my internet .
and mark traffic of ports like 443 coming from a group of users , route them to access internet through IP of my internet .
also mark traffic of ports 5000-5061 coming from another group of users , route them to access internet through another IP of my internet .
i used the RB and a pc to do this as follow :
1. mark connection , packet , and route of traffic coming from group A , route it to go through ether2 from the RB to the pc
the users IP's like 192.168.0.0/24 masquraded and by routing mark send them to IP like 100.100.100.2 .
at the pc this ip 100.100.100.2 src-nat to another ip which it the ISP ip like , 192.168.4.2
the same for the group B and c etc as follow , 192.168.0.0/24 to 100.100.101.2 and 192.168.0.0/24 to 100.100.102.2 respectively .
all these going out from RB by one ether NIC and enter the pc from one ether NIC .
at the pc i src-nat the ip 100.100.100.2 to 192.168.4.2 and the ip 100.100.101.2 to 192.168.4.3 and so on .
so the ether NIC at RB have the ip's : 100.100.100.2 , 100.100.101.2 , 100.100.102.2 , 100.100.103.2 and so on with GW 100.100.100.1 , 100.100.101.1 , 100.100.102.1 , 100.100.103.1 and so on .
at the pc the ether NIC ip's will be 100.100.100.1 , 100.100.101.1 , 100.100.102.1 , 100.100.103.1 and so on for incoming traffic and the ISP ip's like , 192.168.4.2 , 192.168.4.3 , 192.168.4.4 with GW 192.168.4.1 .
what happen is when the RB connect to the PC , the DAC ip on the routing table of the pc showing that only one ip of the ISP is active and all the traffic going to the internet will be through that ip . while i need each group of my user or port as above to use IP of the ISP ip's and the traffic will not be conjusted .
my question are :
can i do this only with the RB ? , how to manage this ?
if not and i have to use the pc or another RB with mine RB493AH how to do it ?
below are the seetings i did on the RB and the pc for this topology , some settings i will remove because it is un necciesary here :
first the RB :
IP :
Code: Select all
/ip address
add address=192.168.0.1/24 broadcast=192.168.0.255 comment="" disabled=no \
interface=bridge1 network=192.168.0.0
add address=100.100.100.2/24 broadcast=100.100.100.255 comment="" \
disabled=no interface=ether2 network=100.100.100.0
add address=100.100.101.2/24 broadcast=100.100.101.255 comment="" \
disabled=no interface=ether2 network=100.100.101.0
add address=100.100.102.2/24 broadcast=100.100.102.255 comment="" \
disabled=no interface=ether2 network=100.100.102.0
add address=100.100.104.2/24 broadcast=100.100.104.255 comment="" \
disabled=no interface=ether2 network=100.100.104.0
add address=100.100.105.2/24 broadcast=100.100.105.255 comment="" \
disabled=no interface=ether2 network=100.100.105.0
add address=100.100.106.2/24 broadcast=100.100.106.255 comment="" \
disabled=no interface=ether2 network=100.100.106.0
add address=100.100.103.2/24 broadcast=100.100.103.255 comment="" \
disabled=no interface=ether2 network=100.100.103.0
Code: Select all
/ip route
add check-gateway=arp comment="" disabled=no distance=1 dst-address=0.0.0.0/0 \
gateway=100.100.100.1 routing-mark="g1 mess" scope=255 target-scope=10
add check-gateway=arp comment="" disabled=no distance=1 dst-address=0.0.0.0/0 \
gateway=100.100.100.1 routing-mark="g1 rest" scope=255 target-scope=10
add check-gateway=arp comment="" disabled=no distance=1 dst-address=0.0.0.0/0 \
gateway=100.100.101.1 routing-mark="g3 rest" scope=255 target-scope=10
add check-gateway=arp comment="" disabled=no distance=1 dst-address=0.0.0.0/0 \
gateway=100.100.101.1 routing-mark="g3 mess" scope=255 target-scope=10
add comment="" disabled=no distance=1 dst-address=0.0.0.0/0 gateway=\
100.100.102.1 routing-mark=speed1 scope=255 target-scope=10
add comment="" disabled=no distance=1 dst-address=0.0.0.0/0 gateway=\
100.100.103.1 routing-mark=speed2 scope=255 target-scope=10
add comment="" disabled=no distance=1 dst-address=0.0.0.0/0 gateway=\
100.100.104.1 routing-mark=speed3 scope=255 target-scope=10
add comment="" disabled=no distance=1 dst-address=0.0.0.0/0 gateway=\
100.100.105.1 routing-mark=speed4 scope=255 target-scope=10
add comment="" disabled=no distance=1 dst-address=0.0.0.0/0 gateway=\
100.100.106.1 routing-mark=speed5 scope=255 target-scope=10
/ip route rule
add action=lookup comment="" disabled=no interface=bridge1 routing-mark=\
"g1 rest" src-address=192.168.0.0/24 table="g1 rest"
add action=lookup comment="" disabled=no interface=bridge1 routing-mark=\
"g1 mess" src-address=192.168.0.0/24 table="g1 mess"
add action=lookup comment="" disabled=no interface=bridge1 routing-mark=\
"g3 rest" src-address=192.168.0.0/24 table="g3 rest"
add action=lookup comment="" disabled=no interface=bridge1 routing-mark=\
"g3 mess" src-address=192.168.0.0/24 table="g3 mess"
add action=lookup comment="" disabled=no interface=bridge1 routing-mark=\
speed1 src-address=192.168.190.0/24 table=speed1
add action=lookup comment="" disabled=no interface=bridge1 routing-mark=\
speed2 src-address=192.168.190.0/24 table=speed2
add action=lookup comment="" disabled=no interface=bridge1 routing-mark=\
speed3 src-address=192.168.190.0/24 table=speed3
add action=lookup comment="" disabled=no interface=bridge1 routing-mark=\
speed4 src-address=192.168.190.0/24 table=speed4
add action=lookup comment="" disabled=no interface=bridge1 routing-mark=\
speed5 src-address=192.168.190.0/24 table=speed5
Code: Select all
/ip firewall nat
add action=masquerade chain=srcnat comment="" disabled=no src-address=\
192.168.190.0/24
IP :
Code: Select all
/ ip address
add address=192.168.4.2/24 network=192.168.4.0 broadcast=192.168.4.255 \
interface=ether1 comment="" disabled=no
add address=192.168.4.3/24 network=192.168.4.0 broadcast=192.168.4.255 \
interface=ether1 comment="" disabled=no
add address=192.168.4.4/24 network=192.168.4.0 broadcast=192.168.4.255 \
interface=ether1 comment="" disabled=no
add address=192.168.4.5/24 network=192.168.4.0 broadcast=192.168.4.255 \
interface=ether1 comment="" disabled=no
add address=192.168.4.6/24 network=192.168.4.0 broadcast=192.168.4.255 \
interface=ether1 comment="" disabled=no
add address=192.168.4.7/24 network=192.168.4.0 broadcast=192.168.4.255 \
interface=ether1 comment="" disabled=no
add address=192.168.4.8/24 network=192.168.4.0 broadcast=192.168.4.255 \
interface=ether1 comment="" disabled=no
add address=100.100.100.1/24 network=100.100.100.0 broadcast=100.100.100.255 \
interface=ether2 comment="" disabled=no
add address=100.100.101.1/24 network=100.100.101.0 broadcast=100.100.101.255 \
interface=ether2 comment="" disabled=no
add address=100.100.102.1/24 network=100.100.102.0 broadcast=100.100.102.255 \
interface=ether2 comment="" disabled=no
add address=100.100.103.1/24 network=100.100.103.0 broadcast=100.100.103.255 \
interface=ether2 comment="" disabled=no
add address=100.100.104.1/24 network=100.100.104.0 broadcast=100.100.104.255 \
interface=ether2 comment="" disabled=no
add address=100.100.105.1/24 network=100.100.105.0 broadcast=100.100.105.255 \
interface=ether2 comment="" disabled=no
add address=100.100.106.1/24 network=100.100.106.0 broadcast=100.100.106.255 \
interface=ether2 comment="" disabled=no
Code: Select all
/ ip route
add dst-address=0.0.0.0/0 gateway=192.168.4.1 scope=255 target-scope=10 \
comment="" disabled=no
Code: Select all
/ ip firewall nat
add chain=srcnat out-interface=ether1 src-address=100.100.100.2 action=src-nat \
to-addresses=192.168.4.2 to-ports=0-65535 comment="" disabled=no
add chain=srcnat out-interface=ether1 src-address=100.100.101.2 action=src-nat \
to-addresses=192.168.4.3 to-ports=0-65535 comment="" disabled=no
add chain=srcnat out-interface=ether1 src-address=100.100.102.2 action=src-nat \
to-addresses=192.168.4.4 to-ports=0-65535 comment="" disabled=no
add chain=srcnat out-interface=ether1 src-address=100.100.103.2 action=src-nat \
to-addresses=192.168.4.5 to-ports=0-65535 comment="" disabled=no
add chain=srcnat out-interface=ether1 src-address=100.100.104.2 action=src-nat \
to-addresses=192.168.4.6 to-ports=0-65535 comment="" disabled=no
add chain=srcnat out-interface=ether1 src-address=100.100.105.2 action=src-nat \
to-addresses=192.168.4.7 to-ports=0-65535 comment="" disabled=no
add chain=srcnat out-interface=ether1 src-address=100.100.106.2 action=src-nat \
to-addresses=192.168.4.8 to-ports=0-65535 comment="" disabled=no
with best regards