Prefer ipv6.

This commit is contained in:
Tom Alexander 2024-07-12 19:58:50 -04:00
parent f6152d92f1
commit 0e2c7adaf9
Signed by: talexander
GPG Key ID: D3A179C9A53C0EDE
9 changed files with 50 additions and 9 deletions

View File

@ -9,6 +9,7 @@ pf_config: "odofreebsd_pf.conf"
pflog_conf: pflog_conf:
- name: 0 - name: 0
dev: pflog0 dev: pflog0
prefer_ipv6: true
dummynet_config: "dnctl.conf" dummynet_config: "dnctl.conf"
network_rc: "odofreebsd_network.conf" network_rc: "odofreebsd_network.conf"
rc_conf: "odofreebsd_rc.conf" rc_conf: "odofreebsd_rc.conf"
@ -41,6 +42,7 @@ users:
devfs_rules: "odo_devfs.rules" devfs_rules: "odo_devfs.rules"
jail_zfs_dataset: zroot/freebsd/current/jails jail_zfs_dataset: zroot/freebsd/current/jails
jail_zfs_dataset_mountpoint: /jail jail_zfs_dataset_mountpoint: /jail
jail_canmount: "on"
jail_list: jail_list:
- name: nat_dhcp - name: nat_dhcp
enabled: true enabled: true

View File

@ -105,7 +105,8 @@ function start_vm {
local bridge_name="$BRIDGE_NAME" local bridge_name="$BRIDGE_NAME"
local ip_range="$IP_RANGE" # for raw this value does not matter local ip_range="$IP_RANGE" # for raw this value does not matter
local mac_address=$(calculate_mac_address "$name") local mac_address
mac_address=$(calculate_mac_address "$name")
local additional_args=() local additional_args=()
@ -245,7 +246,8 @@ function ng_exists {
function calculate_mac_address { function calculate_mac_address {
local name="$1" local name="$1"
local source=$(md5 -r -s "$name" | awk '{print $1}') local source
source=$(md5 -r -s "$name" | awk '{print $1}')
echo "06:${source:0:2}:${source:2:2}:${source:4:2}:${source:6:2}:${source:8:2}" echo "06:${source:0:2}:${source:2:2}:${source:4:2}:${source:6:2}:${source:8:2}"
} }

View File

@ -13,3 +13,11 @@ firefox_config:
browser.newtabpage.activity-stream.feeds.section.topstories: false browser.newtabpage.activity-stream.feeds.section.topstories: false
browser.newtabpage.pinned: "[]" browser.newtabpage.pinned: "[]"
browser.newtabpage.activity-stream.section.highlights.includePocket: false browser.newtabpage.activity-stream.section.highlights.includePocket: false
# Disable cache when devtools are open.
devtools.cache.disabled: true
# Do not track header.
privacy.donottrackheader.enabled: true
# Tell websites not to share or sell my data.
privacy.globalprivacycontrol.enabled: true
# Disable "studies" (slice testing)
app.shield.optoutstudies.enabled: false

View File

@ -23,11 +23,15 @@ function start_jail {
jail_interface_name=$(sanitize_interface_name "$2") jail_interface_name=$(sanitize_interface_name "$2")
ip_range="$3" ip_range="$3"
local mac_address
mac_address=$(calculate_mac_address "$jail_interface_name")
assert_bridge "$host_interface_name" "$bridge_name" "$ip_range" assert_bridge "$host_interface_name" "$bridge_name" "$ip_range"
bridge_link_name=$(detect_available_link "${bridge_name}") bridge_link_name=$(detect_available_link "${bridge_name}")
ngctl -d -f - <<EOF ngctl -d -f - <<EOF
mkpeer ${bridge_name}: eiface $bridge_link_name ether mkpeer ${bridge_name}: eiface $bridge_link_name ether
msg ${bridge_name}:$bridge_link_name set $mac_address
name ${bridge_name}:$bridge_link_name $jail_interface_name name ${bridge_name}:$bridge_link_name $jail_interface_name
EOF EOF
ifconfig $(ngctl msg "${jail_interface_name}:" getifname | grep Args | cut -d '"' -f 2) name "${jail_interface_name}" up ifconfig $(ngctl msg "${jail_interface_name}:" getifname | grep Args | cut -d '"' -f 2) name "${jail_interface_name}" up
@ -121,4 +125,11 @@ function sanitize_interface_name {
echo "${1:0:15}" echo "${1:0:15}"
} }
function calculate_mac_address {
local name="$1"
local source
source=$(md5 -r -s "$name" | awk '{print $1}')
echo "06:${source:0:2}:${source:2:2}:${source:4:2}:${source:6:2}:${source:8:2}"
}
main "${@}" main "${@}"

View File

@ -80,13 +80,13 @@
"ip-address": "10.215.1.215" "ip-address": "10.215.1.215"
}, },
{ {
// sftp // sftp - hard-coded in rc.conf, reproduced here to reserve ip
"hw-address": "58:9c:fc:10:ff:ab", "hw-address": "06:7b:e0:08:16:5d",
"ip-address": "10.215.1.216" "ip-address": "10.215.1.216"
}, },
{ {
// bastion // bastion - hard-coded in rc.conf, reproduced here to reserve ip
"hw-address": "58:9c:fc:10:ff:a2", "hw-address": "06:ca:1a:10:74:09",
"ip-address": "10.215.1.217" "ip-address": "10.215.1.217"
} }
] ]

View File

@ -0,0 +1 @@
prefer_ipv6: false

View File

@ -1,3 +1,4 @@
wlans_iwlwifi0="wlan0" wlans_iwlwifi0="wlan0"
ifconfig_wlan0="WPA DHCP" ifconfig_wlan0="WPA DHCP"
ifconfig_wlan0_ipv6="inet6 accept_rtadv" ifconfig_wlan0_ipv6="inet6 accept_rtadv"
ipv6_cpe_wanif="wlan0"

View File

@ -42,8 +42,6 @@
state: present state: present
sysctl_file: "/etc/sysctl.conf.local" sysctl_file: "/etc/sysctl.conf.local"
loop: loop:
- name: net.inet6.ip6.accept_rtadv # Enable stateless autoconfiguration (SLAAC)
value: "1"
- name: net.inet6.ip6.use_tempaddr # Enable privacy addresses - name: net.inet6.ip6.use_tempaddr # Enable privacy addresses
value: "1" value: "1"
- name: net.inet6.ip6.prefer_tempaddr # Prefer privacy addresses - name: net.inet6.ip6.prefer_tempaddr # Prefer privacy addresses
@ -58,3 +56,20 @@
group: wheel group: wheel
loop: loop:
- local_unbound - local_unbound
- name: Prefer ipv6
when: prefer_ipv6
sysctl:
name: "{{ item.name }}"
value: "{{ item.value }}"
state: present
sysctl_file: "/etc/rc.conf.d/ip6addrctl"
loop:
- name: ip6addrctl_policy
value: "ipv6_prefer"
- name: Don't Prefer ipv6
when: not prefer_ipv6
file:
path: "/etc/rc.conf.d/ip6addrctl"
state: absent

View File

@ -33,5 +33,6 @@
}, },
"black-formatter.importStrategy": "fromEnvironment", "black-formatter.importStrategy": "fromEnvironment",
"workbench.statusBar.visible": false, "workbench.statusBar.visible": false,
"git.openRepositoryInParentFolders": "never" "git.openRepositoryInParentFolders": "never",
"files.autoSave": "afterDelay"
} }