Skip to content

Commit 834155e

Browse files
committed
test: alternate dnsmasq configuration
1 parent 2d26faa commit 834155e

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

systemd/dnsmasq.sh.template

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,27 @@ if [[ ${CRC_NETWORK_MODE_USER} -eq 1 ]]; then
88
fi
99

1010
hostName=$(hostname)
11-
hostIp=$(hostname --all-ip-addresses | awk '{print $1}')
11+
hostIp=$(ip -4 addr show dev br-ex | grep 'inet ' | cut -d/ -f1 | awk '{print $2}')
12+
13+
echo "${hostIp}" | grep -E "([0-9]{1,3}[\\.]){3}[0-9]{1,3}"
14+
15+
if [[ "$?" -ne 0 ]]; then
16+
echo -n "IP address of br-ex not found"
17+
exit 1
18+
fi
1219

1320
cat << EOF > /etc/dnsmasq.d/crc-dnsmasq.conf
14-
listen-address=$hostIp
21+
listen-address=br-ex
1522
expand-hosts
1623
log-queries
1724
local=/crc.testing/
1825
domain=crc.testing
1926
address=/${APPS_DOMAIN}/$hostIp
2027
address=/api.crc.testing/$hostIp
2128
address=/api-int.crc.testing/$hostIp
22-
address=/$hostName.crc.testing/$hostIp
29+
address=/$hostName.crc.testing/192.168.126.11
2330
EOF
2431

2532
/bin/systemctl enable --now dnsmasq.service
2633
/bin/nmcli conn modify --temporary ovs-if-br-ex ipv4.dns $hostIp,1.1.1.1
34+

0 commit comments

Comments
 (0)