Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[client] Add state file to debug bundle #2969

Merged
merged 2 commits into from
Dec 2, 2024
Merged

Conversation

lixmal
Copy link
Contributor

@lixmal lixmal commented Nov 30, 2024

Describe your changes

Adds the state.json file to the debug bundle.

Example content:

{
  "dns_state": {
    "DNSAddress": "",
    "ManagerType": 3,
    "WgIface": "wt0"
  },
  "iptables_state": {
    "acl_entries": {
      "FORWARD": [
        [
          "-i",
          "wt0",
          "-j",
          "DROP"
        ],
        [
          "-i",
          "wt0",
          "-j",
          "NETBIRD-RT-FWD"
        ],
        [
          "-o",
          "wt0",
          "-m",
          "conntrack",
          "--ctstate",
          "RELATED,ESTABLISHED",
          "-j",
          "ACCEPT"
        ],
        [
          "-m",
          "mark",
          "--mark",
          "0x1bd01",
          "-j",
          "NETBIRD-ACL-INPUT"
        ]
      ],
      "INPUT": [
        [
          "-i",
          "wt0",
          "-j",
          "DROP"
        ],
        [
          "-i",
          "wt0",
          "-j",
          "NETBIRD-ACL-INPUT"
        ],
        [
          "-i",
          "wt0",
          "-m",
          "conntrack",
          "--ctstate",
          "RELATED,ESTABLISHED",
          "-j",
          "ACCEPT"
        ]
      ],
      "OUTPUT": [
        [
          "-o",
          "wt0",
          "-j",
          "DROP"
        ],
        [
          "-o",
          "wt0",
          "-j",
          "NETBIRD-ACL-OUTPUT"
        ],
        [
          "-o",
          "wt0",
          "!",
          "-d",
          "100.89.214.39/16",
          "-j",
          "ACCEPT"
        ],
        [
          "-o",
          "wt0",
          "-m",
          "conntrack",
          "--ctstate",
          "RELATED,ESTABLISHED",
          "-j",
          "ACCEPT"
        ]
      ],
      "PREROUTING": [
        [
          "-t",
          "mangle",
          "-i",
          "wt0",
          "-m",
          "addrtype",
          "--dst-type",
          "LOCAL",
          "-j",
          "MARK",
          "--set-mark",
          "0x1bd01"
        ]
      ]
    },
    "acl_ipset_store": {
      "ipsets": {
        "nb0000001": {
          "ips": {
            "0.0.0.0": {}
          }
        },
        "nb0000002": {
          "ips": {
            "0.0.0.0": {}
          }
        }
      }
    },
    "interface_state": {
      "name": "wt0",
      "userspace_bind": false,
      "wg_address": {
        "IP": "100.89.214.39",
        "Network": {
          "IP": "100.89.0.0",
          "Mask": "//8AAA=="
        }
      }
    },
    "route_ipset_counter": {
      "idMap": {},
      "refCountMap": {}
    },
    "route_rules": {
      "established-NETBIRD-RT-FWD": [
        "-m",
        "conntrack",
        "--ctstate",
        "RELATED,ESTABLISHED",
        "-j",
        "ACCEPT"
      ],
      "jump-nat": [
        "-j",
        "NETBIRD-RT-NAT"
      ],
      "jump-pre": [
        "-j",
        "NETBIRD-RT-PRE"
      ],
      "static-nat-outbound": [
        "-m",
        "mark",
        "--mark",
        "0x1bd11",
        "!",
        "-o",
        "lo",
        "-j",
        "MASQUERADE"
      ],
      "static-nat-return": [
        "-m",
        "mark",
        "--mark",
        "0x1bd12",
        "-o",
        "wt0",
        "-j",
        "MASQUERADE"
      ]
    }
  },
  "route_state": {
    "idMap": {
      "init": [
        "100::/128",
        "198.51.100.99/32",
      ]
    },
    "refCountMap": {
      "100::/128": {
        "Count": 1,
        "Out": {
          "IP": "fe80::10:18ff:feab:384c%wlp0s20f3",
          "Intf": {
            "Flags": 51,
            "Index": 3,
            "MTU": 1500,
            "Name": "wlp0s20f3"
          }
        }
      },
      "198.51.100.99/32": {
        "Count": 1,
        "Out": {
          "IP": "192.168.0.1",
          "Intf": {
            "Flags": 51,
            "Index": 3,
            "MTU": 1500,
            "Name": "wlp0s20f3"
          }
        }
      }
    }
  }
}

Issue ticket number and link

Checklist

  • Is it a bug fix
  • Is a typo/documentation fix
  • Is a feature enhancement
  • It is a refactor
  • Created tests that fail without the change (if possible)
  • Extended the README / documentation, if necessary

@lixmal lixmal merged commit c7e7ad5 into main Dec 2, 2024
25 checks passed
@lixmal lixmal deleted the debug-bundle-with-state-file branch December 2, 2024 17:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants