Linuxでローカルループバックを作成する方法は?

Linuxでローカルループバックを作成する方法は?

次のようにローカルループバックを作成する必要があります。高速イーサネットおよびギガビットイーサネットインターフェイスでループバックテストを実行する

抜粋

ローカルループバックジョブの設定

転送ポートを受信ポートに物理的に接続せずにローカルループバックを設定するには、次の手順に従います。

  1. 構成モードで、次の階層レベルに移動します。

    [編集する]

    user@host# インターフェース インターフェース名の編集 (fastether-options | gigether-options)

  2. ローカルループバックを設定します。

    [インターフェースインターフェース名の編集 (fastether-options | gigether-options)]

    User@host# このループバックを設定します。

ベストアンサー1

以下は、インターフェイスの作成に関するドキュメントです。Red Hat Enterprise Linux 3: リファレンスガイド - 第8章 ネットワークインタフェース

  1. 存在しない場合は、この行を追加してください。/etc/hosts

    127.0.0.1       localhost       localhost.localdomain
    
  2. ルートとして次のコマンドを実行します。

    # ifconfig lo 127.0.0.1
    
    # route add 127.0.0.1
    
  3. テストインターフェース

    # ifconfig lo
    lo    Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:3924  Metric:1
          RX packets:60 errors:0 dropped:0 overruns:0 frame:0
          TX packets:60 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
    
    # ping localhost
    PING localhost (127.0.0.1): 56 data bytes
    64 bytes from 127.0.0.1: icmp_seq=0 ttl=255 time=0.3 ms
    64 bytes from 127.0.0.1: icmp_seq=1 ttl=255 time=0.2 ms
    64 bytes from 127.0.0.1: icmp_seq=2 ttl=255 time=0.1 ms
    64 bytes from 127.0.0.1: icmp_seq=3 ttl=255 time=0.1 ms
    64 bytes from 127.0.0.1: icmp_seq=4 ttl=255 time=0.2 ms
    64 bytes from 127.0.0.1: icmp_seq=5 ttl=255 time=0.1 ms
    
    --- localhost ping statistics ---
    6 packets transmitted, 6 packets received, 0% packet loss
    round-trip min/avg/max = 0.1/0.1/0.3 ms
    

おすすめ記事