Home > OS >  Questions about the Linux double nic do code converter
Questions about the Linux double nic do code converter

Time:10-07

Recently doing a statute conversion device, the need to implement the protocol conversion between master station and the terminal, then use a double so embedded devices, Linux application programming, network chart is as follows,

Because the terminal is a TCP server, the main is a TCP client, so my implementation approach is to use embedded devices so 1 simulation terminal IP, so 2 simulation host IP, so 1 set up listening, the main building links with front-end ports 1, so 2 to establish links with the terminal, and then modify the middle of the packet filtering and forwarding, but now there is a problem, when building links with terminal, due to 1 address and terminal are exactly the same, so the application directly through internal connection to the front-end ports 1, rather than the terminal,
In the process to solve the problem, I have been added to the routing table, and also binding in socket programming so address, but still not solve the problem,
Does everybody have a good solution to this problem, or forward this message forwarding and modification of do you have any better ideas,

CodePudding user response:

As nodes, cheat on both sides?
If you want to implement this function, I think you should do with netfilter, intercept before routing of packets, packet also need other checkers, can't let the entire network normal forwarding function was set up,

CodePudding user response:

Thank you for your offer, we want to achieve as nodes, cheating on both sides, I also thought of netfilter, but we use others' core board, does not provide the core source code, I understand it is a core netfilter compilation need source code, so had not implemented,

CodePudding user response:

Unable to enter the kernel was really hard, can consider to cooperate with iptables, putting the packet truncated?
  • Related