The error message "Incompatible with interface assigned with address" is displayed when trying to assign a static IP to em0.root# set interface em0 unit 0 family inet address address/prefix-length{master:0}[edit]
root# commit
[edit interfaces em0 unit 0 family inet]
'dhcp' Incompatible with interface assigned with address
error: commit failed: (statements constraint check failed)
The error:
{master:0}[edit]
root# commit check
[edit interfaces vme unit 0 family inet]
'dhcp'
Incompatible with interface assigned with address
error: configuration check-out failed: (statements constraint check failed)
Refers to a problem with the interface in question, in this case the interface vme, which is observing a mix of an IP address configured along with the dhcp configuration. An interface can be configured to ask and obtain an IP address through DHCP, if you have the interface with this configuration and you add an IP address manually to it, you will receive the error observed above.
To correct the behavior, you must add just one of the two configurations, DHCP or STATIC IP assignment. Here are the steps to resolve this issue on a Juniper Networks device:
show
show configuration interfaces em0
delete interfaces em0 unit 0 family inet dhcp
show interfaces em0
set
set interfaces em0 unit 0 family inet address 10.1.1.1/24
commit
By following these steps, you should be able to resolve the "Incompatible with interface assigned with address" error and successfully configure your Juniper Networks device.
Delete the default dhcp configuration to assign IP dynamically root# delete interfaces em0 unit 0 family inet dhcp
Post deletion we are able to assign the IP statically and the commit is successful.root# set interfaces em0 unit 0 family inet address address/prefix-length
Note: The same error is observed for the the interfaces having default dhcp configuration