LoginSignup
0
0

More than 1 year has passed since last update.

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

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