Use this procedure to enable a DNS query from the PKT0 port via the HFE.
Procedure
- Obtain the Primary IPv4 addresses for both the SBC Pkt0 interfaces and HFE eth0.
(Get this information from the AWS console under ‘Private IPv4 addresses' when viewing the instance) - Stop the HFE:
- Select Instance.
- Select Instance state.
- Select Stop instance.
- Update the HFE user-data.
- Select Instance.
- Select Actions.
- Select Edit user data.
In the user-data, add the following lines ending in '
#DNS Query
' by replacing the values in< >
with the IPs identified in step 1:Examplesudo /bin/bash $HFE_FILE setup /bin/echo "Configured using HFE script - $HFE_FILE" >> $LOG_FILE sudo iptables -t nat -I POSTROUTING -o eth0 -s <Active SBC Pkt0 Primary IP> -j SNAT --to <HFE Eth0 primary IP> #DNS Query sudo iptables -t nat -I POSTROUTING -o eth0 -s <Standby SBC Pkt0 Primary IP> -j SNAT --to <HFE Eth0 primary IP> #DNS Query /bin/echo "Added rules to support DNS queries from SBC" >> $LOG_FILE #DNS Query /bin/echo $(timestamp) " ========================= Done ==========================================" >> $LOG_FILE --//
- Select Save.
- Start the HFE:
- Select Instance.
- Select Instance state.
- Select Start instance.
Verification
Use the following procedure to verify the changes:
- Login to HFE as
ec2-user
using the mgmt port. - Run
sudo iptables -t nat -vnL
. - Verify the rules for the primary IPs appear in the POSTROUTING Chain.
Note
In some Amazon Linux 2 AMIs, cloudinit will not get the latest user-data, and instead uses a cached version.
If the new rules are not added, then perform the following steps:
- Check if the user-data is the latest:
sudo cat /var/lib/cloud/instance/user-data.txt
- If the user-data is not the latest:
- Remove the cached files:
sudo rm -rf /var/lib/cloud/instances/*
- Reboot the instance:
sudo reboot
- Re-verify using steps 1-3 above.
- Remove the cached files:
- If the user-data is the latest:
- Try manually copying each iptables command from the user-data and issuing it on the Linux command line.
Any errors with the command will be returned.
- Try manually copying each iptables command from the user-data and issuing it on the Linux command line.
Overview
Content Tools