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 3 years have passed since last update.

Debianで固定IPアドレスを別のIPアドレスに変更する

0
Last updated at Posted at 2021-03-28

既に固定IPアドレスになっていることが前提になります。
※下記リンクの「VirtualBoxにDebianをインストール」で固定IPアドレスに変更している前提です

ip.sh
# !/bin/bash
#
# ip.sh 192.168.1.11
#
IP=$1

# 変更後、SSHは切断されます。
sed -i -e "s/\(address\s\)[0-9\.]\+/\1${IP}/" /etc/network/interfaces.d/local \
  && systemctl restart networking

参考

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?