0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

systemd-nspawnAdvent Calendar 2018

Day 3

Hyper-V + systemd-nspawnの開発環境を作る(2) ~ ubuntuネットワーク設定 ~

Last updated at Posted at 2018-12-14

前回の続きです

ホスト側ネットワーク設定

netplanではなくsystemd-networkdにして、ブリッジインターフェイスを作成します

apt update
apt upgrade -y
apt remove -y netplan.io
cd /etc/systemd/network
curl -L https://git.io/fpbOF > br.network
curl -L https://git.io/fpb3U > bridge.netdev
curl -L https://git.io/fpb3t > eth0.network
curl -L https://git.io/fpb3Y > eth1.network

iptablesと転送の許可設定をします

apt install -y iptables-persistent
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
netfilter-persistent save
curl -L https://git.io/fpb3M > /etc/sysctl.conf

疎通確認用のnginxを入れて再起動してみます

apt install -y nginx
systemctl reboot

再起動後、 http://10.100.0.2/ にアクセスしてnginxのデフォルトページが見れればOK

nginx.png


次回

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?