1 EXHIBIT 5.1 January 13, 1997 Securities and Exchange Commission 450 Fifth Street, N.W. Washington, D.C. 20549 RE: BAY NETWORKS, INC.: REGISTRATION STATEMENT ON FORM S-3 Ladies and Gentlemen: As legal counsel for Bay Networks, Inc., a Delaware corporation (the "Company"), we are rendering this opinion in connection with the preparation and filing of a registration statement on Form S-3 (the "Registration Statement") relating to the registration under the Securities Act of 1933, as amended, of 2,193,709 shares of Common Stock, par value $.01 per share (the "Common Stock"), issued by the Company pursuant to an Agreement of Merger, dated as of December 17, 1996, among the Company, HB Acquisition, Inc., a Delaware corporation and a wholly-owned subsidiary of the Company, and NetICs, Inc., a Delaware corporation. We have examined such instruments, documents and records as we deemed relevant and necessary for the basis of our opinion hereinafter expressed. In such examination, we have assumed the genuineness of all signatures and the authenticity of all documents submitted to us as originals and the conformity to the originals of all documents submitted to us as copies. Based on such examination, we are of the opinion that the 2,193,709 shares of Common Stock of the Company being registered pursuant to the Registration Statement and to be sold by the selling stockholders are duly authorized shares of Common Stock and are validly issued, fully paid and nonassessable. We hereby consent to the filing of this opinion as an exhibit to the Registration Statement referred to above and the use of our name wherever it appears in said Registration Statement. This opinion is to be used only in connection with the issuance of the Common Stock while the Registration Statement is in effect. Respectfully submitted, /s/ GRAY CARY WARE & FREIDENRICH GRAY CARY WARE & FREIDENRICH A Professional Corporation