Comment configurer une vm pfsense a partir de l'esxi.
Comment configurer une vm pfsense a partir de l’esxi.
Configurer le réseau interne de l’esxi
Activer le ssh sur l’esxi
[2.3.3-RELEASE][root@pfSense.localdomain]/root: route add -net 62.210.87.1/32 -iface em0
add net 62.210.87.1: gateway em0
[2.3.3-RELEASE][root@pfSense.localdomain]/root: route add default 62.210.87.1
add net default: gateway 62.210.87.1
[2.3.3-RELEASE][root@pfSense.localdomain]/root: netstat -rn
Routing tables
Internet:
Destination Gateway Flags Netif Expire
default 62.210.87.1 UGS em0
62.210.87.1/32 00:50:56:01:1b:d0 US em0
127.0.0.1 link#6 UH lo0
163.172.226.64 link#1 UHS lo0
163.172.226.64/32 link#1 U em0
192.168.1.0/24 link#2 U em1
192.168.1.1 link#2 UHS lo0
Internet6:
Destination Gateway Flags Netif Expire
::1 link#6 UH lo0
fe80::%em0/64 link#1 U em0
fe80::250:56ff:fe01:1bd0%em0 link#1 UHS lo0
fe80::%em1/64 link#2 U em1
fe80::1:1%em1 link#2 UHS lo0
fe80::%lo0/64 link#6 U lo0
fe80::1%lo0 link#6 UHS lo0
ff01::%em0/32 fe80::250:56ff:fe01:1bd0%em0 U em0
ff01::%em1/32 fe80::1:1%em1 U em1
ff01::%lo0/32 ::1 U lo0
ff02::%em0/32 fe80::250:56ff:fe01:1bd0%em0 U em0
ff02::%em1/32 fe80::1:1%em1 U em1
ff02::%lo0/32 ::1 U lo0
General PFCTL Commands
# pfctl -d disable packet-filtering# pfctl -e enable packet-filtering# pfctl -q run quiet# pfctl -v -v run even more verbose
Loading PF Rules
# pfctl -f /etc/pf.conf load /etc/pf.conf# pfctl -n -f /etc/pf.conf parse /etc/pf.conf, but dont load it# pfctl -R -f /etc/pf.conf load only the FILTER rules# pfctl -N -f /etc/pf.conf load only the NAT rules# pfctl -O -f /etc/pf.conf load only the OPTION rules
Clearing PF Rules & Counters
# pfctl -F all flush ALL# pfctl -F rules flush only the RULES# pfctl -F queue flush only queue’s# pfctl -F nat flush only NAT# pfctl -F info flush all stats that are not part of any rule.# pfctl -z clear all counters# note: flushing rules do not touch any existing stateful connections
Output PF Information
# pfctl -s rules show filter information# pfctl -v -s rules show filter information for what FILTER rules hit..# pfctl -vvsr show filter information as above and prepend rule numbers# pfctl -v -s nat show NAT information, for which NAT rules hit..# pfctl -s nat -i xl1 show NAT information for interface xl1# pfctl -s queue show QUEUE information# pfctl -s label show LABEL information# pfctl -s state show contents of the STATE table# pfctl -s info show statistics for state tables and packet normalization# pfctl -s all show everything
Maintaining PF Tables
# pfctl -t addvhosts -T show show table addvhosts# pfctl -vvsTables view global information about all tables# pfctl -t addvhosts -T add 192.168.1.50 add entry to table addvhosts# pfctl -t addvhosts -T add 192.168.1.0/16 add a network to table addvhosts# pfctl -t addvhosts -T delete 192.168.1.0/16 delete nework from table addvhosts# pfctl -t addvhosts -T flush remove all entries from table addvhosts# pfctl -t addvhosts -T kill delete table addvhosts entirely# pfctl -t addvhosts -T replace -f /etc/addvhosts reload table addvhosts on the fly# pfctl -t addvhosts -T test 192.168.1.40 find ip address 192.168.1.40 in table addvhosts# pfctl -T load -f /etc/pf.conf load a new table definition# pfctl -t addvhosts -T show -v output stats for each ip address in table addvhosts# pfctl -t addvhosts -T zero reset all counters for table addvhosts