While bash won't try to resolv no standard variables, like $/
, you could simply:
sed "
/^iface $iface/,/^$/{
/address/s/^.*$/\taddress $ip/;
/netmask/s/^.*$/\tnetmask $netmask/;
/broadcast/s/^.*$/\tbroadcast $broadcast/;
/gateway/s/^.*$/\tgateway $gateway/;
}" -i $file
Nota: This modify only 1 paragraph concerning $iface
: with the first sed line: /^iface $iface/,/^$/{ ... }
delimit a command block who could be executed only from a line matching /^iface $iface/
to an empty line (or end of file).
And for playing with IP address in bash, take a look at https://serverfault.com/a/461831/142978