Skip to content

Commit

Permalink
fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
smatting committed Sep 12, 2023
1 parent 8847913 commit 78167ee
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions offline/ubuntu22.04_installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -359,27 +359,28 @@ sysctl -p;
'
```

### enable network masquerading
### Enable network masquerading

Here, you should check the ethernet interface name for your outbound IP.
To prepare determine the interface of your outbound IP:

```
ip ro | sed -n "/default/s/.* dev \([en\(ps|o)0-9]*\) .*/export OUTBOUNDINTERFACE=\1/p"
export OUTBOUNDINTERFACE=$(ip ro | sed -n "/default/s/.* dev \([en\(ps|o)0-9]*\) .*/\1/p")
echo OUTBOUNDINTERFACE is $OUTBOUNDINTERFACE
```

This will return a shell command setting a variable to your default interface. copy and paste it into the command prompt, hit enter to run it, then run the following
Please Check that `OUTBOUNDINTERFACE` is correctly set, before running enabling network masquerading:

```
sudo bash -c '
sudo bash -c "
set -eo pipefail;
sed -i 's/.*DEFAULT_FORWARD_POLICY=.*/DEFAULT_FORWARD_POLICY="ACCEPT"/' /etc/default/ufw;
sed -i "1i *nat\n:POSTROUTING ACCEPT [0:0]\n-A POSTROUTING -s 172.16.0.0/24 -o $OUTBOUNDINTERFACE -j MASQUERADE\nCOMMIT" /etc/ufw/before.rules;
sed -i \"1i *nat\n:POSTROUTING ACCEPT [0:0]\n-A POSTROUTING -s 172.16.0.0/24 -o $OUTBOUNDINTERFACE -j MASQUERADE\nCOMMIT\" /etc/ufw/before.rules;
service ufw restart;
'
"
```

### add static IPs for VMs.
### Add static IPs for VMs.

```
sudo bash -c '
Expand Down

0 comments on commit 78167ee

Please sign in to comment.