5G and beyond (B5G) networks are leading a digital revolution in telecommunication in both academia and industry. It brings new paradigms in many aspects of people's daily lives due to its advantages. However, it still leaves some issues in terms of security and privacy as challenges. Blockchain, the public database, is an alternative to the traditional centralized systems, serving as the backbone technique in many systems, including manufacturing, economics, and industry. Blockchain is promising in solving the security issues in the sense that it provides desirable properties including decentralization, transparency, immutability, and so on. In this article, we investigate typical security and privacy issues in edge intelligence in B5G networks and devise a framework to integrate blockchain with such systems, which can provide guaranteed security as well as privacy. We also illustrate several possible solutions to these security and privacy issues in edge intelligence in B5G systems based on blockchain and Ethereum to show how blockchain contributes to the coming B5G networks.