Greeting guys,
I`ve done one thing with Mikrotik and icmp redirect feateure. Just one simple experiment.
I`ve got one simple network setup like this >>
172.16.0.0/23 ---- MIKROTIK ----- 10.0.0.0/24 -----GW 10.0.0.254
Ive configured the default gw at the mikrotik box as 10.0.0.254 and NATed the 172.16.0.0/23 to the ip address which belongs to the 10.0.0.0/24 so it can access the internet.
ip conf;
ADDRESS NETWORK BROADCAST INTERFACE
0 ;;; HOME LAN
172.16.0.1/23 172.16.0.0 172.16.0.255 MYLAN
1 ;;; interneti
10.0.0.252/24 10.0.0.0 10.0.0.255 INTERNET
nat conf;
1 src-address=172.16.0.0/23 action=nat to-src-address=10.0.0.252
route conf;
DST-ADDRESS G GATEWAY DISTANCE INTERFACE
2 S 0.0.0.0/0 r 10.0.0.254 1 INTERNET
4 DC 172.16.0.0/23 r 0.0.0.0 0 MYLAN
5 DC 10.0.0.0/24 r 0.0.0.0 0 INTERNET
This setup works fine like this, but I`ve changed the gateway of the mikrotik box to 10.0.0.253 which happens to be a linux server with ip forwarding enabled
Controls IP packet forwarding
net.ipv4.ip_forward = 1
[root@linuxi all]# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
10.0.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 lo
0.0.0.0 10.0.0.254 0.0.0.0 UG 0 0 0 eth0
Normally when the traffic will be directed to this host it will send an icmp redirect message indicating that this is not the best recepit of the message giving back a message like this;
Sep 4 02:48:01 linuxi kernel: IN= OUT=eth0 SRC=10.0.0.253 DST=10.0.0.252 LEN=573 TOS=0x00 PREC=0xC0 TTL=64 ID=32847 PROTO=ICMP TYPE=5 CODE=1 GATEWAY=10.0.0.254 [SRC=10.0.0.252 DST=193.203.227.129 LEN=545 TOS=0x00 PREC=0x00 TTL=127 ID=47416 DF PROTO=TCP SPT=3520 DPT=80 WINDOW=63489 RES=0x00 ACK PSH URGP=0 ]
The thing is that the mikrotik box still continues sending traffic to 10.0.0.253 even if it got edhe icmp redirect message which can be seen from this log;
Sep 4 03:01:38 nikonet kernel: IN=eth0 OUT=eth0 SRC=10.0.0.252 DST=159.148.147.196 LEN=40 TOS=0x00 PREC=0x00 TTL=126 ID=50890 DF PROTO=TCP SPT=3597 DPT=80 WINDOW=64240 RES=0x00 ACK FIN URGP=0
Sep 4 03:01:53 nikonet kernel: IN=eth0 OUT=eth0 SRC=10.0.0.252 DST=195.22.198.37 LEN=40 TOS=0x00 PREC=0x00 TTL=126 ID=50939 DF PROTO=TCP SPT=3552 DPT=80 WINDOW=63569 RES=0x00 ACK FIN URGP=0
Sep 4 03:01:53 nikonet kernel: IN=eth0 OUT=eth0 SRC=10.0.0.252 DST=195.22.198.37 LEN=40 TOS=0x00 PREC=0x00 TTL=126 ID=50940 DF PROTO=TCP SPT=3552 DPT=80 WINDOW=63569 RES=0x00 ACK URGP=0
Sep 4 03:02:53 nikonet kernel: IN=eth0 OUT=eth0 SRC=10.0.0.252 DST=195.22.198.37 LEN=40 TOS=0x00 PREC=0x00 TTL=126 ID=51011 DF PROTO=TCP SPT=3555 DPT=80 WINDOW=64240 RES=0x00 ACK FIN URGP=0
Sep 4 03:02:53 nikonet kernel: IN=eth0 OUT=eth0 SRC=10.0.0.252 DST=195.22.198.37 LEN=40 TOS=0x00 PREC=0x00 TTL=126 ID=51012 DF PROTO=TCP SPT=3555 DPT=80 WINDOW=64240 RES=0x00 ACK URGP=0
Sep 4 03:03:08 nikonet kernel: IN=eth0 OUT=eth0 SRC=10.0.0.252 DST=216.10.124.145 LEN=40 TOS=0x00 PREC=0x00 TTL=126 ID=51029 DF PROTO=TCP SPT=3572 DPT=80 WINDOW=63562 RES=0x00 ACK FIN URGP=0
The question is;
Should the mikrotik box have changed it`s gateway to 10.0.0.254 after it got the icmp redirect message or something or I should read more docs about this ![]()
p.s Ive seen a winxp machine changing its gateway (It wasn`t confed as a router)