Building a Sturdy Wall
The fencing does connect to each other. You just need to use the right parts... using wire fence as an example, you'd need to use the fence posts in conjunction with the other components available in that section to build a fence.
Here is a wire fence I built earlier with each of the different components used marked on it:
This also applies to picket fencing once you've unlocked the ability to build that, or if you're re-arranging existing picket fencing.
With the large junk fences, they don't connect to each other - you'll have to spend some time piecing it together bit by bit until you've achieved what you want. It is possible to build a junk fence that doesn't have sufficiently large gaps that enemies can just walk past it but you'll need to position each panel individually.
Short answer:
Enter console ( ~ Key)
Type: "TCL", then press ENTER
Console should read "Collision -> OFF", if it does, press ~ again, to exit Console
[[[note: this will allow your character to clip through anything in game, even the earth. Type TCL in console again to turn it off, try not to walk into the sun.]]]
Enter the Workshop Menu, and select a junk wall (Or anything, really)
Place a junk wall, now, place another junk wall as close as you want to the 1st junk wall.
[[[You'll notice that no matter how close you place the wall (or anything, really), it remains green! You can even place them directly insinde one another!]]]
***Misplace a wall? Trying to place a wall directly next to an already placed wall OUT of TCL?
[[[You'll also notice that you cannot select the wall again after it is placed while in TCL. To fix this, simply exit TCL, returning to normal collision, then enter TCL into console again. You will be able to select it now]]]
[[[You will also notice you cannot place a wall through a wall that has been previously placed while NOT in TCL. To solve this, select the wall (the one you placed normally) that can not be clipped through WHILE in TCL, then release it. This will place the wall (the one you placed normally, while not in TCL) on the hypothetical layer that exists while you place things in TCL. You will now be able to place a new wall, inside of the previously placed wall (the one you previously placed normally)... this is confusing I know, I hope it helps. It may take some playing around.]]]
Here's a link to a video of me awkwardly explaing how this works:
I use fence posts to fill in small gaps between the fence sections or the fence and the impenetrable object next to it. You may have to use 3 or 4 to fill in the gap, but it seems to work.