Skip to content

network create non-routed without gateway no longer possible #2841

@cldmkr

Description

@cldmkr

Description

I try to create a L2 only network, means not routed and no gateway. However a gateway is still set. (Purpose is to create a HA network between 2 servers, where only HA heartbeat is sent between 2 nodes).

Steps to reproduce

apiclient = IaasApi(_api_configuration)
ipv4withprefix = CreateNetworkIPv4WithPrefix(prefix = '10.1.0.0/28', nameservers = [ '8.8.8.8' ])
print(ipv4withprefix)
###
### gateway=None nameservers=['8.8.8.8'] prefix='10.1.0.0/28'
###

ipv4 = CreateNetworkIPv4(ipv4withprefix)
print(ipv4)
###
### oneof_schema_1_validator=None oneof_schema_2_validator=None actual_instance=CreateNetworkIPv4WithPrefix(gateway=None, nameservers=['8.8.8.8'], prefix='10.1.0.0/28') one_of_schemas={'CreateNetworkIPv4WithPrefix', 'CreateNetworkIPv4WithPrefixLength'}
###

candidateitem = CreateNetworkPayload(name = name, ipv4 = ipv4, routed = False, dhcp = True)
print(candidateitem)
###
### dhcp=True ipv4=CreateNetworkIPv4(oneof_schema_1_validator=None, oneof_schema_2_validator=None, actual_instance=CreateNetworkIPv4WithPrefix(gateway=None, nameservers=['8.8.8.8'], prefix='10.1.0.0/28'), one_of_schemas={'CreateNetworkIPv4WithPrefix', 'CreateNetworkIPv4WithPrefixLength'}) ipv6=None labels=None name='ihe01testnetwork' routed=False routing_table_id=None
###

result = apiclient.create_network(project_id=project_id, region=region, create_network_payload=candidateitem)
print(result)
###
### created_at=datetime.datetime(2026, 1, 20, 15, 37, 7, tzinfo=TzInfo(0)) dhcp=True id='c90cdb22-202a-46b2-b224-e268ec48e46c' ipv4=NetworkIPv4(gateway=None, nameservers=['8.8.8.8'], prefixes=['10.1.0.0/28'], public_ip=None) ipv6=None labels={} name='ihe01testnetwork' routed=False routing_table_id=None status='CREATING' updated_at=datetime.datetime(2026, 1, 20, 15, 37, 7, tzinfo=TzInfo(0))
###
### ---> while creating, gateway is still None

result2 = apiclient.get_network(project_id=project_id, region=region, network_id='c90cdb22-202a-46b2-b224-e268ec48e46c')
print(result2)
###
### created_at=datetime.datetime(2026, 1, 20, 15, 37, 7, tzinfo=TzInfo(0)) dhcp=True id='c90cdb22-202a-46b2-b224-e268ec48e46c' ipv4=NetworkIPv4(gateway='10.1.0.1', nameservers=['8.8.8.8'], prefixes=['10.1.0.0/28'], public_ip=None) ipv6=NetworkIPv6(gateway=None, nameservers=[], prefixes=[]) labels={} name='ihe01testnetwork' routed=False routing_table_id=None status='CREATED' updated_at=datetime.datetime(2026, 1, 20, 15, 37, 10, tzinfo=TzInfo(0))
###

### ---> once created, gateway is set, although it shall be NONE.
  1. Initialize the API
  2. Create a network with non_routed=True and ipv4.gateway=None
  3. Get details after network creation has completed

Actual behavior

Shows a gateway is assigned to subnet, and communicated i.e. to DHCP clients

Expected behavior

Network has no gateway, no gateway is communicated via DHCP.

Environment

stackit-core==0.2.0
stackit-iaas==1.1.0

Additional info

Addon: Also via stackit CLI this seems to not work.... option no-ipv4-gateway seems to be ignored? Although network-interface list shows that there is no gateway interface from the project router (only the meta interface), the network overview still shows the gateway IP.

stackit network create --name ihe01testnetwork --non-routed --no-ipv4-gateway --ipv4-prefix "10.1.0.0/28"

stackit network describe 83957c75-4218-48b7-af25-5ed22960ae1b

 ID                │ 83957c75-4218-48b7-af25-5ed22960ae1b
───────────────────┼──────────────────────────────────────
 NAME              │ ihe01testnetwork
───────────────────┼──────────────────────────────────────
 STATE             │ CREATED
───────────────────┼──────────────────────────────────────
 ROUTED            │ false
───────────────────┼──────────────────────────────────────
 IPv4 GATEWAY      │ 10.1.0.1
───────────────────┼──────────────────────────────────────
 IPv4 NAME SERVERS │ 208.67.222.222, 208.67.220.220
───────────────────┼──────────────────────────────────────
 IPv4 PREFIXES     │ 10.1.0.0/28

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions