> For the complete documentation index, see [llms.txt](https://docs.ionos.com/cloud/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.ionos.com/cloud/ruby/vm-autoscaling/models/nicfirewallrule.md).

# NicFirewallRule

## Properties

| Name                   | Type        | Description                                                                                                                                                                          | Notes       |
| ---------------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ----------- |
| **name**               | **String**  | The name of the firewall rule.                                                                                                                                                       | \[optional] |
| **protocol**           | **String**  | The protocol for the rule. The property cannot be modified after its creation (not allowed in update requests).                                                                      |             |
| **source\_mac**        | **String**  | Only traffic originating from the respective MAC address is permitted. Valid format: 'aa:bb:cc:dd:ee:ff'. The value 'null' allows traffic from any MAC address.                      | \[optional] |
| **source\_ip**         | **String**  | Only traffic originating from the respective IPv4 address is permitted. The value 'null' allows traffic from any IP address.                                                         | \[optional] |
| **target\_ip**         | **String**  | If the target NIC has multiple IP addresses, only the traffic directed to the respective IP address of the NIC is allowed. The value 'null' allows traffic to any target IP address. | \[optional] |
| **icmp\_code**         | **Integer** | Sets the allowed code (from 0 to 254) when ICMP protocol is selected. The value 'null'' allows all codes.                                                                            | \[optional] |
| **icmp\_type**         | **Integer** | Sets the allowed type (from 0 to 254) if the protocol ICMP is selected. The value 'null' allows all types.                                                                           | \[optional] |
| **port\_range\_start** | **Integer** | Sets the initial range of the allowed port (from 1 to 65534) if the protocol TCP or UDP is selected. The value 'null' for 'portRangeStart' and 'portRangeEnd' allows all ports.      | \[optional] |
| **port\_range\_end**   | **Integer** | Sets the end range of the allowed port (from 1 to 65534) if the protocol TCP or UDP is selected. The value 'null' for 'portRangeStart' and 'portRangeEnd' allows all ports.          | \[optional] |
| **type**               | **String**  | The firewall rule type. If not specified, the default value 'INGRESS' is used.                                                                                                       | \[optional] |

## Example

```ruby
require 'ionoscloud-vm-autoscaling'

instance = IonoscloudVmAutoscaling::NicFirewallRule.new(
  name: My resource,
  protocol: TCP,
  source_mac: 00:0a:95:9d:68:16,
  source_ip: 22.231.113.64,
  target_ip: 22.231.113.64,
  icmp_code: 2,
  icmp_type: 8,
  port_range_start: 8,
  port_range_end: 8,
  type: INGRESS
)
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.ionos.com/cloud/ruby/vm-autoscaling/models/nicfirewallrule.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
