In exchange, the Senators will receive the 21st overall pick in the NHL draft on Friday night.
Lehner was 9-12 with a 3.00 goals-against average and .905 save percentage last season. In 76 starts over five seasons, he is 30-36 with a 2.88 GAA and .914 save percentage.
Legwand, 34, had nine goals and 27 points last season for the Senators. In 16 NHL seasons, he has 223 goals and 604 points.