I got this from here
Will N. Korea Attack S. Korea if US Attacks Iran?
A so-called unthinkable question: Will North Korea attack South Korea--and U.S. troops in the South--if the United States attacks Iran over its nuclear program? (Really, this is a matter of when, not if, as decades of Western appeasement of Iran seem to have made war inevitable.)
The answer is probably not. But the possibility of North Korea seeking to exploit an opportunity to defeat the South should be addressed given the following: North Korea's intense hatred of South Korea; the North's dire economic straits, long history of engaging in criminal activities for money, and unique partnership in nuclear and missile crimes with oil-rich Iran, which is believed to have subsidized the North's nuclear and missile tests, and is also believed to be prepared to pay handsomely for strategic North Korean assistance in the event of an Iranian showdown with the West; a conviction on the part of the North Korean military that it could actually win a new Korean war; a related perception on the part of both North Korea and Iran that the U.S., which is still bogged down in Afghanistan, clearly lacks the resources and the political will to fight three wars, or two wars with heavy losses, even for a short period of time, or, perhaps, even, one protracted conflict involving large-scale casualties, following the Vietnam and Iraq debacles; and, last but not least, the North's lips-and-teeth relationship with China, which is strongly opposed to U.S. military action against Iran and infuriated by the Obama administration's declared new geo-strategic focus on the Asia-Pacific region--a U.S. policy shift that Beijing regards as inherently menacing.
That doesn't mean that China would-- or could--order North Korea to come to Iran's aid by attacking South Korea and the approximately 28,000 U.S. troops stationed there. However, there may be hardline elements in Beijing who would very much like to see the U.S. dealt a severe blow--some of these figures actually applauded the 9/11 attacks on New York and Washington, DC--and, with that aim in mind, might be willing to back North Korea up militarily if it plunges into an all-out conflict with Seoul and its superpower ally, provided the North refrains from attacking the South and its (sitting duck?) defenders with chemical and nuclear weapons, the use of which could trigger a U.S. nuclear response with consequences too terrible for even the hardest line and most nationalistic and anti-American--but presumably still sane--Chinese generals to contemplate.
Considering all of the above and the fact that Russia has warned Washington in no uncertain terms against attacking Iran, making clear that Moscow would view an armed intervention in its neighbor as a threat to Russian interests, and that U.S.-Russia relations are at an all-time, post-Cold War low point; that Iran has vowed to destroy Israel if it attacks Iran, and to attack the U.S. if it or Israel attacks or appears to be close to attacking Iran; that Iran and its Lebanese proxy, Hezbollah, are bristling with ballistic missiles capable of leveling Israel's civilian population centers--and that Israel is believed to possess one of the world's most formidable nuclear arsenals--the potential for war in the Greater Middle East widening into a global conflict, though thankfully still remote, cannot be dismissed as mere fantasy or pointless speculation.
Time and again, history has shown that the unthinkable can happen.