OpenStack: Neutron (network)
CLI
https://developer.openstack.org/firstapp-libcloud/networking.html
# search server by port ID openstack port show -c device_id -f value ${PORT_ID} openstack show show ${PORT_ID} openstack router show ${PORT_ID}
Port
https://docs.openstack.org/python-openstackclient/latest/cli/command-objects/port.html
# get port ID for OVS interface openstack port list -c id -f value | grep $(awk '{print substr($OVS_INTERFACE,4,8)}') # list all port by subnet openstack port list --fixed-ip subnet=mgmt-dev-net --sort-column Name # list all devices by network openstack port list --network mgmt-dev -c device_id -f value # allow incomming (ingress) SSH for specific IP / subnet openstack security group rule create default \ --protocol tcp \ --dst-port 22 \ --remote-ip 10.20.30.40/32 # create port without security openstack port create openstack-net-port1 --network openstack-net --no-security-group --disable-port-security --no-fixed-ip openstack port set --disable-port-security openstack-net-port1 # get all port by subnet openstack port list -c ID -f value --fixed-ip subnet=dev-net1 # search ports (filter with json) openstack port list -c ID -c "Fixed IP Addresses" -f json | jq -r '.[] | select(."Fixed IP Addresses"[].ip_address | startswith("10.11")).ID'
Creat and assign port