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

Possible to view / edit interface configuration? #6

Open
dbjungle opened this issue Jul 14, 2024 · 7 comments
Open

Possible to view / edit interface configuration? #6

dbjungle opened this issue Jul 14, 2024 · 7 comments

Comments

@dbjungle
Copy link

I've noticed when I try to view a specific interface it seems to have no effect. I receive more details if I output to yaml, but I'm still unable to do a specific interface. Further more changing one of these aspects (dhcphostname on wan for example) seems to have no effect.

root@DE1FW01:~ # opnsense show interfaces 
   opnsense: {
       interfaces: {
           wan: {…}
           lan: {…}
           lo0: {…}
       }
   }

root@DE1FW01:~ # opnsense show interfaces wan
   opnsense: {
       interfaces: {
           wan: {…}
           lan: {…}
           lo0: {…}
       }
   }

root@DE1FW01:~ # opnsense -y show interfaces wan
opnsense:
    interfaces:
        lan:
            enable: "1"
            if: vtnet1
            ipaddr: 10.1.4.2
            ipaddrv6: track6
            media: ""
            mediaopt: ""
            subnet: "24"
            subnetv6: "64"
            track6-interface: wan
            track6-prefix-id: "0"
        lo0:
            descr: Loopback
            enable: "1"
            if: lo0
            internal_dynamic: "1"
            ipaddr: 127.0.0.1
            ipaddrv6: ::1
            subnet: "8"
            subnetv6: "128"
            type: none
            virtual: "1"
        wan:
            dhcp6-ia-pd-len: "0"
            dhcphostname: DE1FW01
            enable: "1"
            gateway: WAN_GW
            if: vtnet0
            ipaddr: dhcp
            ipaddrv6: dhcp6
            media: ""
            mediaopt: ""

root@DE1FW01:~ # 

Is there something I'm doing wrong?

@mihakralj
Copy link
Owner

looks like your conf/config.xml has something oddly encoded for interfaces branch.
Can you check the XML output of opnsense CLI for interfaces branch, and compare it with your actual interfaces branch in conf/config.xml?

My expectation is that these two won't match - that the parser in opnsense CLI doesn't understand something you have in config.xml.

@mihakralj
Copy link
Owner

btw, I am really delighted that you discovered this project and actually gave it a try; I abandoned further development of CLI when there was zero traction/interest to get opnsense CLI tool to manage the firewall.

@rhaido
Copy link

rhaido commented Jul 17, 2024

btw, I am really delighted that you discovered this project and actually gave it a try; I abandoned further development of CLI when there was zero traction/interest to get opnsense CLI tool to manage the firewall.

Is the project completely abandoned? I'm thinking about writing some extensions, in order to build a bridge for ansible automation. I've actually written a small patch to save the JSON output in the file - are you interested in merging it it?

Thanks!

@mihakralj
Copy link
Owner

Sure, happy to contribute. This project might get more attention this summer again - my vacation tinkering. 😊

@rhaido
Copy link

rhaido commented Jul 18, 2024

Sure, happy to contribute. This project might get more attention this summer again - my vacation tinkering. 😊

I've just opened a merge request, as discussed.

@dbjungle
Copy link
Author

looks like your conf/config.xml has something oddly encoded for interfaces branch. Can you check the XML output of opnsense CLI for interfaces branch, and compare it with your actual interfaces branch in conf/config.xml?

My expectation is that these two won't match - that the parser in opnsense CLI doesn't understand something you have in config.xml.

Sorry for the late response. I have been quite busy with work lately. The interfaces look normal in the XML and it matches the yaml output. Everything looks correct in the XML output of the opnsense CLI as well, but it just can't display any further than the top level of interfaces.

@dbjungle
Copy link
Author

btw, I am really delighted that you discovered this project and actually gave it a try; I abandoned further development of CLI when there was zero traction/interest to get opnsense CLI tool to manage the firewall.

I saw on reddit there were a lot of CLI tools so i tried the best looking one (this one). Then I tried the others. I'm guessing most people just modify the XML directly or have gotten used to the FreeBSD commands.

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

No branches or pull requests

3 participants