20
10/28/2019 1 Connection Tracking Implementation and Case

Connection Tracking Implementation and Case · 2019-10-28 · 1 Connection Tracking Implementation and Case. 10/28/2019 2 Intro •Yoga Wahyu Mahendra •Klaten, 8 September 1999

  • Upload
    others

  • View
    9

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Connection Tracking Implementation and Case · 2019-10-28 · 1 Connection Tracking Implementation and Case. 10/28/2019 2 Intro •Yoga Wahyu Mahendra •Klaten, 8 September 1999

10/28/2019

1

Connection Tracking Implementation and Case

Page 2: Connection Tracking Implementation and Case · 2019-10-28 · 1 Connection Tracking Implementation and Case. 10/28/2019 2 Intro •Yoga Wahyu Mahendra •Klaten, 8 September 1999

10/28/2019

2

Intro

• Yoga Wahyu Mahendra• Klaten, 8 September 1999• MikroTik Certified Trainer (TR0619) at BelajarMikroTik.COM• Certificate Taken :

• MTCNA• MTCTCE• MTCRE• MTCWE• MTCIPv6E• MTCUME• MTCINE• MTCSE

Page 3: Connection Tracking Implementation and Case · 2019-10-28 · 1 Connection Tracking Implementation and Case. 10/28/2019 2 Intro •Yoga Wahyu Mahendra •Klaten, 8 September 1999

10/28/2019

3

BelajarMikroTik.COM

• BelajarMikroTik.COM is the one of MikroTik Training Center in Indonesia

• BelajarMikroTik.COM founded by Herry Darmawan & Akbar Azwir on 2013

• Located in Surabaya but we also hold training around Indonesia even in Australia and Philippines

• Certification that you can take : MTCNA, MTCTCE, MTCRE, MTCUME, MTCWE, MTIPv6E, MTCSE, MTCINE

Page 4: Connection Tracking Implementation and Case · 2019-10-28 · 1 Connection Tracking Implementation and Case. 10/28/2019 2 Intro •Yoga Wahyu Mahendra •Klaten, 8 September 1999

10/28/2019

4

What is Connection Tracking?

• In Router, all the active traffic will be stored real-time to restored them to the correct request source

• In MikroTik RouterOS, This feature called Connection-Tracking

Page 5: Connection Tracking Implementation and Case · 2019-10-28 · 1 Connection Tracking Implementation and Case. 10/28/2019 2 Intro •Yoga Wahyu Mahendra •Klaten, 8 September 1999

10/28/2019

5

How Connection Tracking Work?

Page 6: Connection Tracking Implementation and Case · 2019-10-28 · 1 Connection Tracking Implementation and Case. 10/28/2019 2 Intro •Yoga Wahyu Mahendra •Klaten, 8 September 1999

10/28/2019

6

Connection Tracking

• Disabling connection tracking will effect with some Firewall feature

• Feature affected by Connection-Tracking :• NAT• Connection-bytes• Connection-mark• Connection-state• Connection-limit• Connection-rate• Layer7-protocol• New-connection-mark• Tarpit

Page 7: Connection Tracking Implementation and Case · 2019-10-28 · 1 Connection Tracking Implementation and Case. 10/28/2019 2 Intro •Yoga Wahyu Mahendra •Klaten, 8 September 1999

10/28/2019

7

Connection Tracking Menu

• IP Firewall Connections

Page 8: Connection Tracking Implementation and Case · 2019-10-28 · 1 Connection Tracking Implementation and Case. 10/28/2019 2 Intro •Yoga Wahyu Mahendra •Klaten, 8 September 1999

10/28/2019

8

Connection Tracking in Packet Flow

Page 9: Connection Tracking Implementation and Case · 2019-10-28 · 1 Connection Tracking Implementation and Case. 10/28/2019 2 Intro •Yoga Wahyu Mahendra •Klaten, 8 September 1999

10/28/2019

9

Connection State

• Each connection has a state

• This state called Connection-state

Page 10: Connection Tracking Implementation and Case · 2019-10-28 · 1 Connection Tracking Implementation and Case. 10/28/2019 2 Intro •Yoga Wahyu Mahendra •Klaten, 8 September 1999

10/28/2019

10

Connection State

Page 11: Connection Tracking Implementation and Case · 2019-10-28 · 1 Connection Tracking Implementation and Case. 10/28/2019 2 Intro •Yoga Wahyu Mahendra •Klaten, 8 September 1999

10/28/2019

11

Connection StateNEW

Established

Related

Invalid

Page 12: Connection Tracking Implementation and Case · 2019-10-28 · 1 Connection Tracking Implementation and Case. 10/28/2019 2 Intro •Yoga Wahyu Mahendra •Klaten, 8 September 1999

10/28/2019

12

Tips for connection state

• DROP Invalid Packet

• ACCEPT Established and Related Packet

• Another rule will only check the NEW Packet

• Less Check = Less CPU Load

Page 13: Connection Tracking Implementation and Case · 2019-10-28 · 1 Connection Tracking Implementation and Case. 10/28/2019 2 Intro •Yoga Wahyu Mahendra •Klaten, 8 September 1999

10/28/2019

13

Implementation

This Rule only checking the NEW

PACKET

Page 14: Connection Tracking Implementation and Case · 2019-10-28 · 1 Connection Tracking Implementation and Case. 10/28/2019 2 Intro •Yoga Wahyu Mahendra •Klaten, 8 September 1999

10/28/2019

14

Connection Tracking Stuck?

• For some case we need to mark other connection.

ISP A ISP B

Page 15: Connection Tracking Implementation and Case · 2019-10-28 · 1 Connection Tracking Implementation and Case. 10/28/2019 2 Intro •Yoga Wahyu Mahendra •Klaten, 8 September 1999

10/28/2019

15

Mark Connection

• To know which connection that we have to delete we can mark that connection

Page 16: Connection Tracking Implementation and Case · 2019-10-28 · 1 Connection Tracking Implementation and Case. 10/28/2019 2 Intro •Yoga Wahyu Mahendra •Klaten, 8 September 1999

10/28/2019

16

Delete the Conn-Track

This Connection that we should Delete!!

Page 17: Connection Tracking Implementation and Case · 2019-10-28 · 1 Connection Tracking Implementation and Case. 10/28/2019 2 Intro •Yoga Wahyu Mahendra •Klaten, 8 September 1999

10/28/2019

17

Ensure Gateway is reachable

• To ensure that gateway always reachable we can use Tools Netwatch

Page 18: Connection Tracking Implementation and Case · 2019-10-28 · 1 Connection Tracking Implementation and Case. 10/28/2019 2 Intro •Yoga Wahyu Mahendra •Klaten, 8 September 1999

10/28/2019

18

PROBLEM SOLVED?

NOHow if the problems always come?

Page 19: Connection Tracking Implementation and Case · 2019-10-28 · 1 Connection Tracking Implementation and Case. 10/28/2019 2 Intro •Yoga Wahyu Mahendra •Klaten, 8 September 1999

10/28/2019

19

Solution

• We can use Script in Netwatch deleting the connection tracking automatically

/ip firewall connection {:foreach r in=[find where connection-mark=via-ISP-A] do={remove $r}}

Page 20: Connection Tracking Implementation and Case · 2019-10-28 · 1 Connection Tracking Implementation and Case. 10/28/2019 2 Intro •Yoga Wahyu Mahendra •Klaten, 8 September 1999

10/28/2019

20

Thanks!Any questions?

You can find me at :

Yoga Wahyu Mahendra

@yogawhyme

[email protected]