Score:0

RouterOS - how to make diffrent IP to access the Internet through different gateway

xk flag

I want to make 192.168.1.2/24->192.168.1.1 to access the Internet, but 192.168.1.3/24->192.168.1.100 to access the Internet.

I don't know how to do it.

[admin@RouterOS] /ip/route> print detail 
Flags: D - dynamic; X - disabled, I - inactive, A - active; 
c - connect, s - static, r - rip, b - bgp, o - ospf, d - dhcp, v - vpn, m - modem, y - bgp-mpls-vpn; 
H - hw-offloaded; + - ecmp 
 0  As + dst-address=0.0.0.0/0 routing-table=main pref-src=192.168.1.2 
         gateway=192.168.1.1 immediate-gw=192.168.1.1%ether1 check-gateway=arp 
         distance=1 scope=30 target-scope=10 suppress-hw-offload=no 

 0  As + dst-address=0.0.0.0/0 routing-table=main pref-src="" gateway=192.168.1.1 
         immediate-gw=192.168.1.1%ether1 check-gateway=arp distance=1 scope=30 
         target-scope=10 suppress-hw-offload=no 

   DAc + dst-address=192.168.1.0/24 routing-table=main gateway=ether1 
         immediate-gw=ether1 distance=0 scope=10 suppress-hw-offload=no 
         local-address=192.168.1.3%ether1 

   DAc + dst-address=192.168.1.0/24 routing-table=main gateway=ether1 
         immediate-gw=ether1 distance=0 scope=10 suppress-hw-offload=no 
         local-address=192.168.1.2%ether1 

 1  As   dst-address=0.0.0.0/0 routing-table=rtab-1 pref-src=192.168.1.3 
         gateway=192.168.1.100 immediate-gw=192.168.1.100%ether1 check-gateway=arp 
         distance=1 scope=30 target-scope=10 suppress-hw-offload=no 
[admin@RouterOS] /ip/address> print 
Columns: ADDRESS, NETWORK, INTERFACE
# ADDRESS         NETWORK      INTERFACE
0 192.168.1.2/24  192.168.1.0  ether1   
1 192.168.1.3/24  192.168.1.0  ether1   
[admin@RouterOS] /ip/address> /tool/traceroute src-address=192.168.1.3 8.8.8.8
Columns: ADDRESS, LOSS, SENT, LAST, AVG, BEST, WORST, STD-DEV
#  ADDRESS          LOSS  SENT  LAST    AVG   BEST  WORST  STD-DEV
1  192.168.1.1      0%       3  0.2ms   0.2   0.1   0.2    0      
2  ... // more line
[admin@RouterOS] /ip/address> /tool/traceroute src-address=192.168.1.2 8.8.8.8 
Columns: ADDRESS, LOSS, SENT, LAST, AVG, BEST, WORST, STD-DEV
#  ADDRESS          LOSS  SENT  LAST    AVG   BEST  WORST  STD-DEV
1  192.168.1.1      0%       2  0.2ms   0.2   0.1   0.2    0.1    
2  ... // more line

Here's what I'd like to see happen.

[admin@RouterOS] /ip/address> /tool/traceroute src-address=192.168.1.3 8.8.8.8
Columns: ADDRESS, LOSS, SENT, LAST, AVG, BEST, WORST, STD-DEV
#  ADDRESS          LOSS  SENT  LAST    AVG   BEST  WORST  STD-DEV
1  192.168.1.100      0%       3  0.2ms   0.2   0.1   0.2    0      
2  ... // more line
[admin@RouterOS] /ip/address> /tool/traceroute src-address=192.168.1.2 8.8.8.8 
Columns: ADDRESS, LOSS, SENT, LAST, AVG, BEST, WORST, STD-DEV
#  ADDRESS          LOSS  SENT  LAST    AVG   BEST  WORST  STD-DEV
1  192.168.1.1      0%       2  0.2ms   0.2   0.1   0.2    0.1    
2  ... // more line
cn flag
Well, here is a problem you have - what you ask for in the start makes no sense. Bad explanation. You do not know how to do it - I have no idea what you even try to say. So, voting to close. It may be a good idea to use ChatGPT to help you formulate a question that is logically complete.
cn flag
I’m voting to close this question because I have no idea what you even try to do based from the way your question is formulated.
Nikita Kipriyanov avatar
za flag
I belive this is about policy/source-based routing; like "ip rule add from x lookup table x" in Linux. Then this is done essentially in the same way in RouterOS because it is Linux underneath its NIH-caused interface.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.