mwood77 / pf2opn Goto Github PK
View Code? Open in Web Editor NEWAn in-browser pfsense to opnsense converter.
Home Page: https://www.pf2opn.com
License: Other
An in-browser pfsense to opnsense converter.
Home Page: https://www.pf2opn.com
License: Other
Hello
Just tried the product, and I have this error
main.e88ec901367bee90.js:1 ERROR TypeError: e?.address.replaceAll is not a function
at t.mapAliasEntity (main.e88ec901367bee90.js:1:244134)
at main.e88ec901367bee90.js:1:242827
at Array.forEach ()
at t.mapPFtoOPN (main.e88ec901367bee90.js:1:242803)
at o.onload (main.e88ec901367bee90.js:1:241830)
at v.invoke (polyfills.18a047f7d412b1c1.js:1:6562)
at Object.onInvoke (main.e88ec901367bee90.js:1:53367)
at v.invoke (polyfills.18a047f7d412b1c1.js:1:6502)
at L.runGuarded (polyfills.18a047f7d412b1c1.js:1:2066)
at FileReader. (polyfills.18a047f7d412b1c1.js:1:1
PFsense and OPNsense differ in how multiple entries (e.g. in an alias block) are formatted.
PFsense:
<alias>
<name>DescriptiveAliasNameGoesHere</name>
<type>host</type>
<address>192.168.1.0/24 192.168.2.0/24 192.168.3.0/24 192.168.4.0/24</address>
<descr></descr>
<detail><![CDATA[Entry added Fri, 01 Jan 1979 01:23:45 -0000]]></detail>
</alias>
OPNsense:
<alias uuid="abcdef12-3456-789a-bcde-f0123456789a">
<enabled>1</enabled>
<name>DescriptiveAliasNameGoesHere</name>
<type>network</type>
<proto/>
<interface/>
<counters/>
<updatefreq/>
<content>192.168.1.0/24
192.168.2.0/24
192.168.3.0/24
192.168.4.0/24</content>
<categories/>
<description/>
</alias>
pf2opn doesn't reformat the data in the address block, leading to a very subtle problem -- OPNsense appears to import the data correctly (and shows what appears to be a correct IP listing on the administration panel), but actually treats the IPs as a long text string (i.e. alias) instead of a list of separate IPs.
This does not generate a usable XML file for OPNSense. Using version 23.7. Based on my manual review of the file, this does not work with earler versions, either.
We can start with line 1--the absence of in the download.
I have a fairly basic backup that just has a lot of static DHCP mappings. I used my backup and then restored it to a fresh install of opnsense. After the install was complete the default user/pass no longer worked. I then attempted to use the user/pass from my pfsense backup and that also did not work.
I have checked both the before and after XML and the bcrypt-hash is the same.
Older versions of pfSense tend to wrap all user strings in CDATA markers, as follows:
<descr>
<![CDATA[User provided text goes here]]>
</descr>
OPNsense doesn't know what to do with these and inserts a bunch of unwanted newlines and spaces around the user text on restore.
The entire alias section of the firewall configuration seems to be unparsed / not updated.
What it should be:
<alias uuid="72b6208b-e50d-4d68-a594-da0fa6760000">
<enabled>1</enabled>
<name>MY_HOST</name>
<type>host</type>
<proto/>
<interface/>
<counters>0</counters>
<updatefreq/>
<content>19192.168.1.1</content>
<categories/>
<description>Entry added Mon, 01 Jan 1979 01:23:45 -0000</description>
</alias>
What comes out:
<alias>
<name>MY_HOST</name>
<type>host</type>
<address>192.168.1.1</address>
<descr></descr>
<detail>Entry added Mon, 01 Jan 1979 01:23:45 -0000</detail>
</alias>
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.