dmauser / opnazure

This template allows you to deploy an OPNsense Firewall Azure VM using the opnsense-bootsrtap installation method

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Better bootstraping script ?

lukasmrtvy opened this issue · comments

Hello,
I am using MicrosoftOSTC:freebsd-11-3:freebsd_11_3:latest Azure image and custom script:

pkg install -y xmlstarlet
fetch https://github.com/opnsense/core/blob/stable/20.1/src/etc/config.xml.sample
xml  ed --inplace -u  '/opnsense/interfaces/lan/ipaddr' -v "dhcp" config.xml.sample
xml  ed --inplace -u '/opnsense/interfaces/wan/if' -v "hn0" config.xml.sample
xml  ed --inplace -u '/opnsense/interfaces/lan/if' -v "hn1" config.xml.sample

xml  ed --inplace \
-s /opnsense/system/ssh -t elem -n "enabled" -v "enabled" \
-s /opnsense/system/ssh -t elem -n "passwordauth" -v "1" \
-s /opnsense/system/ssh -t elem -n "permitrootlogin" -v "1" \
config.xml.sample

xml  ed --inplace -s '/opnsense/filter' -t elem -n rule -v "" \
-s //rule -t elem -n "type" -v "pass" \
-s //rule -t elem -n "interface" -v "wan" \
-s //rule -t elem -n "ipprotocol" -v "inet" \
-s //rule -t elem -n "statetype" -v "keep stat" \
-s //rule -t elem -n "disablereplyto" -v "1" \
-s //rule -t elem -n "protocol" -v "tcp" \
-s //rule -t elem -n "source" -v "" \
-s //rule/source -t elem -n "any" -v "1" \
-s //rule -t elem -n "destination" -v "" \
-s //rule/destination -t elem -n "network" -v "wanip" \
-s //rule/destination -t elem -n "port" -v "443" \
config.xml.sample

cp config.xml.sample /usr/local/etc/config.xml

pkg install -y ca_root_nss
fetch https://raw.githubusercontent.com/opnsense/update/master/bootstrap/opnsense-bootstrap.sh
sed -i "" "s/reboot/#reboot/g" opnsense-bootstrap.sh

sh ./opnsense-bootstrap.sh -y

service waagent stop 
pkg install -y python27
service waagent start

pkg install -y bash 
pkg install -y dmidecode #one of waagent optional dependencies

reboot

which providers better control at deploy time..

Anyway, problem is that whole networking is broken after opnsense installation. I can not even connect to that machine..

Any ideas?

I have made a lot of changes recently. Check out the newer updates. Closing this request.