Check the iptables configuration: Make sure that the iptables configuration is correct and that the TP_OUT chain is defined. You can check the iptables configuration by running the command iptables -L. If the TP_OUT chain is not defined, you can define it by running the command iptables -N TP_OUT -t nat.failed to start v2ray-core: not support "redirect" mode of transparent proxy: ExecCommands: iptables -w 2 -t nat -N TP_OUT Bad argument `2' Try `iptables -h' or 'iptables --help' for more information. : exit status 2
did not workedCheck the iptables configuration: Make sure that the iptables configuration is correct and that the TP_OUT chain is defined. You can check the iptables configuration by running the command iptables -L. If the TP_OUT chain is not defined, you can define it by running the command iptables -N TP_OUT -t nat.
It seems that the iptables command in the ExecCommands section of your v2ray-core configuration file is not correctly formatted.
The error message indicates that the argument 2 is not valid for the iptables command. The 2 in this context refers to the timeout value, which is not a valid argument for the redirect mode of transparent proxy.
To fix this issue, you can try removing the 2 from the ExecCommands section of your configuration file, like this:CopyCopy
iptables -w -t nat -N TP_OUT
This will disable the timeout feature and allow the iptables command to execute without any issues.Copy
Alternatively, you can modify the ExecCommands section to use the -j option instead of -t to specify the target chain, like this
iptables -w -j TP_OUT -N
This will create a new chain called TP_OUT and set its policy to ACCEPT, which should allow the traffic to be redirected correctly.
Note that the redirect mode of transparent proxy is not the only way to configure iptables for transparent proxying. You may also consider using the DSCP mode, which uses the DSCP mark to identify and redirect traffic.
Here's an example of how you can modify your v2ray-core configuration file to use DSCP mode
In this example, the iptables command is run with the -w option to enable wrapping, the -t option to specify the target chain (TP_OUT), the -N option to create a new chain if it doesn't exist, the -p option to specify the protocol ( sorte.ssh), the -j option to specify the target jump ( DSCP ), the -M option to set the mark ( 0x13 ), the -n option to specify the interface name ( any ), and the `-X