An exception solution from A to B, the red road is forbidden.
Setting the edge with Oneway to N will prevent it from being traveled. But as you mention, this and adding turns requires being able to edit the data and then rebuild the network dataset. If you cannot edit the network data then you can only use the barrier approach that I had mentioned earlier.
Goal of restrictions is to restrict the places they touch the network edges. So in this case, the red line touches the two blue lines and they will be restricted. So you could do one of two things if you want to restrict the red but not the blue:
1. Place a point restriction on the red line. So only the red line will be restricted. To generate a point on a line, you can use the GP tool Feature to Point with the inside option. It will create a point at the midpoint of that line.
2. Or, make the red line shorter on both ends before you load it in as a line restriction.
Add a point restrict or make line shorter seems make sense. But is there any other solution to avoid red line?
On account of a left/right turn, vehicle still could stay on the horizontal line.
Is there any other way to make vehicle could not stay on horizontal line (red part)?
Yes, you can always add turn restriction to prevent travel from blue to red edges. You can read more on that here:
About creating a turn feature—Help | ArcGIS Desktop
About editing turn features—Help | ArcGIS Desktop
Another way, add an ONE WAY attribute, set the Oneway = N for the red road. The result is what my expectation, but I can not modify the original data now. Is there any way to achieve that?
Retrieving data ...