/pattern/
does not work with a variable, because it is looking for the literal text pattern
instead of the variable.
Instead, to get this functionality you have to use $0 ~ var
:
awk -v var="ip" '$0 ~ var {print $1}' file
Example
$ cat a
123.456.789 is my ip
this is another thing
$ awk -v var="ip" '$0 ~ var {print $1}' a
123.456.789