The Arthashastra describes the duty of war as dependent upon the objectives of those making it (their Ashrama), as well as the nature (or castes), of the combatants.
It is inappropriate for members of different castes to fight each other because it is inappropriate for members of one caste to utilize the means of war appropriated to another caste, and such combat would inevitably result in different castes fighting each other. It is also inappropriate for members of different Ashramas to fight each other because it would be inappropriate for combatants who do not share the same objective to strive with each other. This is is the means by which to avoid violence in war; this is the Ahimsa of War, the only way to peace from war.
However, it is also understood that violent war may result when one combatant, out of aggression, desire or ignorance undertakes to fight with a member of a different caste, or a different Ashrama. In these cases, it is appropriate for the several castes and Ashramas to join together in the same objective of repelling the invasion of one caste by another, and restoring the Dharma. It is appropriate for all beings to join in the defense of the aggrieved. As Vishnu manifested the avatar of the Buddha Gotama for this very purpose, it is appropriate to understand the means of joining in the defense of a member of a different caste, or Ashrama.
The means of combat depend upon the objective and nature of the combatant, not their opponent. A Sudra employs their skills of service in combat, the industriousness of the Vaisya becomes their means of combat, the Kshetriyas utilize their civil prowess - and the Brahmans utilize their noble and royal nature. Thus, there are four means of warfare: the lowest form of warfare is diplomatic (which is the best means for a Brahman), the second-lowest form of warfare is forceful (which is the best means for a Kshetriya, especially a "soldier"), the second-highest form of warfare is economic (which is the best means for a Vaisya), and the highest form of warfare is disobedience and disruption (which is the best means for a Sudra). If the form of warfare which is appropriate to one's caste cannot achieve the goal, as in the pursuit of Kama, the warrior may achieve their goal through a higher form of warfare. It is appropriate for a warrior to lend aid and support to greater (higher) warriors. Yet if even disobedience and disruption cannot achieve the goal, disobedience and disruption are yet required, for it is forbidden to submit.
It is the inherent right of every being to disobey. Yet sometimes a being, for weakness of body, mind or heart, is overcome and must submit - like an animal. Then they, too, shall require rescue. It is by disobedience that a fighter persists in their normal duties and does not undertake anything contrary to their duty. It is by disruption that a fighter prevents their opponent from acting contrary to their opponent's duty and requires their opponent to undertake their duty. It is in this way the opponent is returned to their proper caste and Ashrama practice.
If a different means of warfare is required, the warrior should adopt new Ashrama practices to learn and perfect the duties of the different caste. The warrior who has adequately studied the Dharma, the Duties, of the several castes and Ashramas has advantage over the warrior who does not: they may accomplish their goal with greater success. This is the secret wisdom of Satyagraha.