It would be illegal as per the constitution, but to some so called conservatives, the constitution can be ignored (a la Obama) to serve their view point at any given time.
How is it unconstitutional? The purpose of the armed forces is to protect the country. Defending the border against and invading army (in uniform or not) is still a valid armed forces duty.
we have already had Guard units on border that is military
it is apparently legal for Guard
there is also Task Pressure force which uses Marines and others
look like military on border is a limited fait accompli
we did this in 1917.... my grandpa was there
after the Columbus raid