The appropriate dplyr function here is inner_join (returns all rows from df x that have a match in df y.)
library(dplyr)
inner_join(df1, df2)
V1
1 id300
2 id5456
3 id45
Note: the rows are returned in the order in which they are in df1. If you did inner_join(df2, df1), id45 would come before id5456.