Raspberry Pi と Ubuntu 20.04 をクロスケーブルで接続
2102 ワード
Raspberry Pi と Ubuntu 20.04 をクロスケーブルで接続する方法です。
Ubuntu 20.04 のアドレスを、192.168.0.10
Rasbperry Pi のアドレスを、192.168.0.13
とします。
アドレス 192.168.0.10
ネットマスク 255.255.255.0
ゲートウェイ 192.168.0.10
ルートの設定
sudo ip route add 192.168.0.13/32 via 192.168.0.10 dev enp3s0f2
ルートテーブルの確認
$ ip route
default via 192.168.8.1 dev wlp2s0 proto dhcp metric 600
default via 192.168.0.10 dev enp3s0f2 proto static metric 20100
169.254.0.0/16 dev enp3s0f2 scope link metric 1000
192.168.0.0/24 dev enp3s0f2 proto kernel scope link src 192.168.0.10 metric 100
192.168.8.0/24 dev wlp2s0 proto kernel scope link src 192.168.8.101 metric 600
Raspberry Pi 側の設定
/etc/dhcpcd.conf に次を加える
/etc/dhcpcd.conf
interface eth0
static ip_address=192.168.0.13/24
static routers=192.168.0.10
/etc/rc.local に次を加える
/etc/rc.local
ifup eth0
ルートテーブルの確認
$ ip route
default via 192.168.0.10 dev eth0 src 192.168.0.11 metric 202
192.168.0.0/24 dev eth0 proto dhcp scope link src 192.168.0.11 metric 202
Author And Source
この問題について(Raspberry Pi と Ubuntu 20.04 をクロスケーブルで接続), 我々は、より多くの情報をここで見つけました https://qiita.com/ekzemplaro/items/75510ef65d11698dceb9著者帰属:元の著者の情報は、元のURLに含まれています。著作権は原作者に属する。
Content is automatically searched and collected through network algorithms . If there is a violation . Please contact us . We will adjust (correct author information ,or delete content ) as soon as possible .