You need barriers to keep the racers and the crowd separated.
Things we have used:
If using tires or straw bales you can rope them together. Same with plastic totes. The highway barriers typically lock together with connector pieces.
What you decide to build your track with depends on time, money, and availability.
For all of these, it's recommended to encircle the crowd-facing areas with bike rack fencing to keep the crowd back more.
Notes to follow about advantages and disadvantages of each method….
How many X do you need for a decent size track?