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
ExecCommands:
iptables -w -t nat -N TP_OUT
CopyCopy
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
ExecCommands:
iptables -w -j TP_OUT -N
CopyCopy
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
ustralias:
iptables:
-w
-t
-N
-p
-j
-M
-n
-X
-g
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