LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 07-19-2023, 03:31 AM   #1
mirawara
LQ Newbie
 
Registered: Jul 2023
Posts: 6

Rep: Reputation: 1
Forward FIN packets to Docker container


Hi,

I'm encountering an issue with forwarding packets from the host to a Docker container. Specifically, I have Snort running inside the container, and I want to detect FIN scans by forwarding FIN packets from the host to the container.
I've tried various approaches, including setting up iptables rules for forwarding packets, but the packets still get dropped before reaching the container. I think they are dropped in 'raw prerouting' because of the connection state tracking.

It's worth mentioning that if I perform an nmap scan using the container's IP address, the forwarding works correctly. However, when I use the host's IP address, the packets are not forwarded. So, I'm not able to detect external port scanning.

A solution could be to use network_mode='host' but I prefer to find workarounds to keep the network namespace separate.

Thanks in advance.
 
Old 07-24-2023, 08:09 PM   #2
nini09
Senior Member
 
Registered: Apr 2009
Posts: 1,855

Rep: Reputation: 161Reputation: 161
You can add new network hook into kernel to forward the TCP FIN packet.
 
Old 07-28-2023, 03:30 AM   #3
mirawara
LQ Newbie
 
Registered: Jul 2023
Posts: 6

Original Poster
Rep: Reputation: 1
Quote:
Originally Posted by nini09 View Post
You can add new network hook into kernel to forward the TCP FIN packet.
I fixed it by port mirroring via 'tc' command. Thanks for the help.
 
1 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Docker: How to change and add addons in firefox in a docker container Basher52 Linux - Software 1 11-12-2022 12:55 PM
LXer: How to Store Docker Container Data In Docker Volumes LXer Syndicated Linux News 0 03-08-2022 12:45 AM
LXer: Inside the Open Container Project: How Docker plans to unite the container market LXer Syndicated Linux News 0 06-23-2015 04:30 AM
LXer: How to capture TCP SYN, ACK and FIN packets with tcpdump LXer Syndicated Linux News 0 09-14-2014 04:54 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 04:01 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration