大橋のページ

iproute2+tcを使って1台で複数インターネット接続

1 複数のインターネット接続
2 インタフェースとルーティングテーブル
3 ifconfigとrouteコマンド
4 Linuxカーネルのコンパイル 1
5 Linuxカーネルのコンパイル 2
6 iproute2+tcのインストール
7 ipコマンドでインタフェースの登録
8 ipコマンドでルーティング設定
9 namedをインタフェースごとに起動する
10 sendmailをインタフェースごとに起動する

6 iproute2+tcのインストール

iproute2+tcをインストールする

iproute2+tcのソースは、RedHat 5.1では「iproute-2.2.4-2.i386.rpm」になります。Linuxに転送して、rpmコマンドでインストールします。

# rpm -ivv iproute-2.2.4-2.i386.rpm
D: counting packages to install
D: found 1 packages
D: looking for packages to download
D: retrieved 0 packages
D: New Header signature
D: Signature size: 149
D: Signature pad : 3
D: sigsize         : 152
D: Header + Archive: 329751
D: expected size   : 329751
D: opening database mode 0x42 in //var/lib/rpm/
D: found 0 source and 1 binary packages
D:  requires: ld-linux.so.2  satisfied by db provides.
D:  requires: libc.so.6  satisfied by db provides.
D:  requires: libdl.so.2  satisfied by db provides.
D:  requires: libm.so.6  satisfied by db provides.
D:  requires: libresolv.so.2  satisfied by db provides.
D:  requires: /bin/bash  satisfied by db file lists.
D:  requires: /bin/sh  satisfied by db file lists.
D:  requires: libc.so.6(GLIBC_2.0)  satisfied by db provides.
D:  requires: libc.so.6(GLIBC_2.1)  satisfied by db provides.
D:  requires: libdl.so.2(GLIBC_2.0)  satisfied by db provides.
D:  requires: libdl.so.2(GLIBC_2.1)  satisfied by db provides.
D:  requires: libm.so.6(GLIBC_2.1)  satisfied by db provides.
D: installing binary packages
D: getting list of mounted filesystems
D: New Header signature
D: Signature size: 149
D: Signature pad : 3
D: sigsize         : 152
D: Header + Archive: 329751
D: expected size   : 329751
D: package: iproute-2.2.4-2 files test = 0
D:    file: /sbin/ifcfg action: create
D:    file: /sbin/ip action: create
D:    file: /sbin/rtmon action: create
D:    file: /sbin/tc action: create
D:    file: /usr/doc/iproute-2.2.4 action: create
D:    file: /usr/doc/iproute-2.2.4/README.decnet action: create
D:    file: /usr/doc/iproute-2.2.4/README.iproute2+tc action: create
D:    file: /usr/doc/iproute-2.2.4/RELNOTES action: create
D:    file: /usr/doc/iproute-2.2.4/api-ip6-flowlabels.ps action: create
D:    file: /usr/doc/iproute-2.2.4/examples action: create
D:    file: /usr/doc/iproute-2.2.4/examples/SYN-DoS.rate.limit action: create
D:    file: /usr/doc/iproute-2.2.4/examples/cbqinit.eth1 action: create
D:    file: /usr/doc/iproute-2.2.4/examples/dhcp-client-script action: create
D:    file: /usr/doc/iproute-2.2.4/examples/diffserv action: create
D:    file: /usr/doc/iproute-2.2.4/examples/diffserv/Edge1 action: create
D:    file: /usr/doc/iproute-2.2.4/examples/diffserv/Edge2 action: create
D:    file: /usr/doc/iproute-2.2.4/examples/diffserv/Edge31-ca-u32 action: creat
e
D:    file: /usr/doc/iproute-2.2.4/examples/diffserv/Edge31-cb-chains action: cr
eate
D:    file: /usr/doc/iproute-2.2.4/examples/diffserv/Edge32-ca-u32 action: creat
e
D:    file: /usr/doc/iproute-2.2.4/examples/diffserv/Edge32-cb-chains action: cr
eate
D:    file: /usr/doc/iproute-2.2.4/examples/diffserv/Edge32-cb-u32 action: creat
e
D:    file: /usr/doc/iproute-2.2.4/examples/diffserv/README action: create
D:    file: /usr/doc/iproute-2.2.4/examples/diffserv/afcbq action: create
D:    file: /usr/doc/iproute-2.2.4/examples/diffserv/ef-prio action: create
D:    file: /usr/doc/iproute-2.2.4/examples/diffserv/efcbq action: create
D:    file: /usr/doc/iproute-2.2.4/examples/diffserv/regression-testing action:
create
D:    file: /usr/doc/iproute-2.2.4/ip-cref.ps action: create
D:    file: /usr/doc/iproute-2.2.4/ip-tunnels.ps action: create
D:    file: /usr/sbin/rtacct action: create
D: running preinstall script (if any)
#

「/sbin」ディレクトリに「ifcfg」「ip」「rtmon」「tc」が、「/usr/sbin」ディレクトリに「rtacct」がインストールされ、「/usr/doc/iproute-2.2.4」ディレクトリに各ドキュメントがインストールされます。

「ip」と「tc」(traffic control)が主なコマンドです。「ifcfg」はインタフェースにIPアドレスを割り当てるコマンドです。

# /sbin/ifcfg
Usage: ifcfg DEV [[add|del [ADDR[/LEN]] [PEER] | stop]
       add - add new address
       del - delete address
       stop - completely disable IP

著作権、商標等について (C) 2000 HyperDyne Inc.