ビーグルボーンブラックに固定IPを設定した後、インターネットにアクセスできません。

ビーグルボーンブラックに固定IPを設定した後、インターネットにアクセスできません。

Beaglebone blackでIPを静的にしようとしています。このために私は従うこのチュートリアル。チュートリアルに従って変更した後、私の/etc/network/interfacesファイルは次のようになります。

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo

iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet static

address 192.168.24.38
network 192.168.24.0
broadcast 192.168.24.255
netmask 255.255.252.0
gateway 192.168.25.10

# Example to keep MAC address between reboots
#hwaddress ether DE:AD:BE:EF:CA:FE

# The secondary network interface
#auto eth1
#iface eth1 inet dhcp

# WiFi Example
#auto wlan0
#iface wlan0 inet dhcp
#    wpa-ssid "essid"
#    wpa-psk  "password"

# Ethernet/RNDIS gadget (g_ether)
# ... or on host side, usbnet and random hwaddr
# Note on some boards, usb0 is automaticly setup with an init script
iface usb0 inet static
    address 192.168.7.2
    netmask 255.255.255.0
    network 192.168.7.0
    gateway 192.168.7.1

Beaglebone blackを再起動したら、コマンドを使用して自分のIPが静的IPであることを確認できますifconfig。これはコマンドの出力です。ifconfig

eth0      Link encap:Ethernet  HWaddr d0:39:72:3b:da:e8  
          inet addr:192.168.24.38  Bcast:192.168.24.255  Mask:255.255.252.0
          inet6 addr: fe80::d239:72ff:fe3b:dae8/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:3352 errors:0 dropped:63 overruns:0 frame:0
          TX packets:77 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:329055 (321.3 KiB)  TX bytes:10701 (10.4 KiB)
          Interrupt:40 

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:1 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:79 (79.0 B)  TX bytes:79 (79.0 B)

usb0      Link encap:Ethernet  HWaddr 66:b8:b3:7a:c3:19  
          inet addr:192.168.7.2  Bcast:192.168.7.3  Mask:255.255.255.252
          inet6 addr: fe80::64b8:b3ff:fe7a:c319/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:88 errors:0 dropped:0 overruns:0 frame:0
          TX packets:76 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:13642 (13.3 KiB)  TX bytes:17130 (16.7 KiB)

しかし、今はインターネットにアクセスできません。だから。私の設定でどこが間違っているか教えてください。ありがとう

提案されているように、コマンドの出力はip route次のとおりです。

  default via 192.168.25.10 dev eth0 
    192.168.7.0/30 dev usb0  proto kernel  scope link  src 192.168.7.2 
    192.168.24.0/22 dev eth0  proto kernel  scope link  src 192.168.24.38

コマンドの出力はping -c1 google.com次のとおりです。

ping:不明なホストgoogle.com

コマンド出力 netstat -nr

Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
192.168.7.0     0.0.0.0         255.255.255.252 U         0 0          0 usb0

ベストアンサー1

ping コマンドと netstat コマンドを実行して、ルーティングですべてが正常であることを確認します。ただし、DHCPはDNS /レゾルバ設定データも提供します。 DNS検証に失敗しました。

/etc/resolv.conf を編集し、次のように作成します。

nameserver 8.8.8.8

この時点で、google.comをpingすると正常に動作します。

後で会社に連絡して、内部ドメイン(yourdomain.xx)とネームサーバーのIP(localnameserver)を要求してください。

次のように変更します。

search yourdomain.xx
nameserver localnameserver

おすすめ記事