ENUM OVS_NAT_ATTR(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ enum ovs_nat_attr(9) ✨

okay bestie, so this is the enum ovs_nat_attr(9) page from the Kernel API Manual β€” literally the glow-up guide for the attributes you can slap onto %OVS_CT_ATTR_NAT. yes, the NAT action. we're doing networking lore today, stay with me πŸ’…


🌸 NAME 🌸

enum ovs_nat_attr β€” the attributes for %OVS_CT_ATTR_NAT. that's it, that's the whole vibe check. πŸ¦‹


✨ SYNOPSIS ✨

like, here's the whole squad, in order, no cap:

enum ovs_nat_attr {
    OVS_NAT_ATTR_SRC ,
    OVS_NAT_ATTR_DST ,
    OVS_NAT_ATTR_IP_MIN ,
    OVS_NAT_ATTR_IP_MAX ,
    OVS_NAT_ATTR_PROTO_MIN ,
    OVS_NAT_ATTR_PROTO_MAX ,
    OVS_NAT_ATTR_PERSISTENT ,
    OVS_NAT_ATTR_PROTO_HASH ,
    OVS_NAT_ATTR_PROTO_RANDOM

};

πŸ’– Constants πŸ’–

so each of these little icons has a job. let's meet them πŸŽ€

  • OVS_NAT_ATTR_SRC β€” the flag for Source NAT, aka mangle the source address/port. iconic behaviour honestly.
  • OVS_NAT_ATTR_DST β€” the flag for Destination NAT, aka mangle the destination address/port.
🚨 okay so here's the fine print, and it's giving "read the docs before you ship": - only one of (OVS_NAT_ATTR_SRC, OVS_NAT_ATTR_DST) may be specified. pick a lane, bestie. - this is effective only for packets for ct_state NEW connections. - packets of committed connections get mangled by the NAT action according to the committed NAT type, regardless of the flags you specified. so your flags don't get a vote there, sorry 😭 - as a corollary (fancy word, ate), a NAT action without a NAT type flag will only mangle packets of committed connections. - the following NAT attributes only apply for NEW (non-committed) connections, and they may be included only when the CT action has the OVS_CT_ATTR_COMMIT flag and either OVS_NAT_ATTR_SRC or OVS_NAT_ATTR_DST is also included. all the conditions, but we love a struct with standards πŸ’…
  • OVS_NAT_ATTR_IP_MIN β€” struct in_addr or struct in6_addr. two types, one attribute, main character energy.
  • OVS_NAT_ATTR_IP_MAX β€” struct in_addr or struct in6_addr. same deal, but the upper one 🫢
  • OVS_NAT_ATTR_PROTO_MIN β€” u16 L4 protocol specific lower boundary (port). the floor πŸ“
  • OVS_NAT_ATTR_PROTO_MAX β€” u16 L4 protocol specific upper boundary (port). the ceiling ⭐
  • OVS_NAT_ATTR_PERSISTENT β€” flag for persistent IP mapping across reboots. yes, it remembers. lowkey obsessed with continuity πŸ”₯
  • OVS_NAT_ATTR_PROTO_HASH β€” flag for pseudo random L4 port mapping (MD5). pseudo random, very demure.
  • OVS_NAT_ATTR_PROTO_RANDOM β€” flag for fully randomized L4 port mapping. fully. no half measures πŸ‘‘

🌈 SEE ALSO 🌈

the whole friend group, go say hi 🧚:

  • Kernel file ./include/uapi/linux/openvswitch.h
  • struct ovs_header(9)
  • enum ovs_datapath_attr(9)
  • enum ovs_packet_attr(9)
  • enum ovs_vport_type(9)
  • enum ovs_vport_attr(9)
  • enum ovs_vport_upcall_attr(9)
  • enum ovs_frag_type(9)
  • enum ovs_flow_attr(9)
  • enum ovs_sample_attr(9)
  • enum ovs_userspace_attr(9)
  • struct ovs_action_push_mpls(9)
  • struct ovs_action_add_mpls(9)
  • struct ovs_action_push_vlan(9)
  • enum ovs_ct_attr(9)
  • struct ovs_action_push_eth(9)
  • enum ovs_check_pkt_len_attr(9)
  • enum ovs_psample_attr(9)
  • enum ovs_action_attr(9)

okay that's the whole page, you understood it perfectly, I'm so proud of you πŸ₯ΉπŸ’–

sign-off szn: this lil masterpiece lives in ./include/uapi/linux, dated October 2026. drink water, commit your changes, and remember: NAT flags are temporary but the kernel is forever πŸ’œβœ¨πŸŽ€

πŸ“¦ where this page comes from