参考資料 として network の 設定 方法の 例を 示す これは 実証は してい ない (計算機が 足りないので 行えない )以下を 参考に させて頂いた 無断 借用 です。従って 正解は 以下に あります。
http://homepage.smc.edu/morgan_david/vpn/assignments/ifroute-assgt.htm
ほな はじめまひょう、これからは 正解か どうかは 不明です 未実証
                pcA eth0 IP:192.168.1.2
                                |         
                                |       
         192.168.1.0 network    |
                                |
                                |
                     pcB eth0 IP:192.168.1.1
                     pcB eth1 IP:100.1.1.1
                                |
                                |
                     pcC eth0 IP:100.1.1.254
                     pcC eth1 IP:200.2.2.254
                                |
                                |
                     pcD eth1 IP:200.2.2.2
                     pcD eth0 IP:192.168.2.1
                                |
                                |
         192.168.2.0 network    |
                                |
                                |
                      pcE eth0 IP:192.168.2.2
pcA and E : Workstation
pcB and D : Gateway
pcC       : Internet surrogate (B's ISP; D's ISP)??
network interface eth0
# /sbin/ifconfig eth0 192.168.1.2 broadcast 192.168.1.255 netmask 255.255.255.0
routing table
# /sbin/route add -net 192.168.1.0 netmask 255.255.255.0 eth0 # /sbin/route add default gw 192.168.1.1
実際の 検証が 現在 出来ないので 下記参照
ifconfig の 様式 例
# /sbin/ifconfig dev IP Adr broadcast Brc Adr netmask Nmask
IP Address: 192.168.1.2 Netmask: 255.255.255.0 = 24 Network: 192.168.1.0/24 Broadcast: 192.168.1.255
route の 様式 例
# /sbin/ifconfig add -net Network Netmask Nmask dev # /sbin/ifconfig add -net Network Netmask Nmask gw Gw Adr # /sbin/ifconfig add default gw Dfault Gw Adr
pcA の default gateway は pcB の eth0 の IP Adr 192.168.1.1 を 通過し て 処理する
network interface eth0 eth1
# /sbin/ifconfig eth0 192.168.1.1 broadcast 192.168.1.255 netmask 255.255.255.0 # /sbin/ifconfig eth1 100.1.1.1 broadcast 100.255.255.255 netmask 255.0.0.0
routing table
# /sbin/route add -net 192.168.1.0 netmask 255.255.255.0 eth0 # /sbin/route add -net 100.0.0.0 netmask 255.0.0.0 eth1 # /sbin/route add default gw 100.1.1.254
note 
Address:   192.168.1.1           11000000.10101000.00000001 .00000001
Netmask:   255.255.255.0 = 24    11111111.11111111.11111111 .00000000
Wildcard:  0.0.0.255             00000000.00000000.00000000 .11111111
=>
Network:   192.168.1.0/24        11000000.10101000.00000001 .00000000 (Class C)
Broadcast: 192.168.1.255         11000000.10101000.00000001 .11111111
HostMin:   192.168.1.1           11000000.10101000.00000001 .00000001
HostMax:   192.168.1.254         11000000.10101000.00000001 .11111110
Hosts/Net: 254                   (Private Internet)
Address:   100.1.1.1             01100100 .00000001.00000001.00000001
Netmask:   255.0.0.0 = 8         11111111 .00000000.00000000.00000000
Wildcard:  0.255.255.255         00000000 .11111111.11111111.11111111
=>
Network:   100.0.0.0/8           01100100 .00000000.00000000.00000000 (Class A)
Broadcast: 100.255.255.255       01100100 .11111111.11111111.11111111
HostMin:   100.0.0.1             01100100 .00000000.00000000.00000001
HostMax:   100.255.255.254       01100100 .11111111.11111111.11111110
Hosts/Net: 16777214              
network interface eth0 eth1
# /sbin/ifconfig eth0 100.1.1.254 broadcast 100.255.255.255 netmask 255.0.0.0 # /sbin/ifconfig eth1 200.2.2.2 broadcast 200.2.2.255 netmask 255.255.255.0
routing table
# /sbin/route add -net 100.0.0.0 netmask 255.0.0.0 eth0 # /sbin/route add -net 200.2.2.0 netmask 255.255.255.0 eth1
note 
Address:   200.2.2.2             11001000.00000010.00000010 .00000010
Netmask:   255.255.255.0 = 24    11111111.11111111.11111111 .00000000
Wildcard:  0.0.0.255             00000000.00000000.00000000 .11111111
=>
Network:   200.2.2.0/24          11001000.00000010.00000010 .00000000 (Class C)
Broadcast: 200.2.2.255           11001000.00000010.00000010 .11111111
HostMin:   200.2.2.1             11001000.00000010.00000010 .00000001
HostMax:   200.2.2.254           11001000.00000010.00000010 .11111110
Hosts/Net: 254                          
network interface eth0 eth1
# /sbin/ifconfig eth0 192.168.2.1 broadcast 192.168.2.255 netmask 255.255.255.0 # /sbin/ifconfig eth1 200.2.2.2 broadcast 200.2.2.255 netmask 255.255.255.0
routing table
# /sbin/route add -net 192.168.2.0 netmask 255.255.255.0 eth0 # /sbin/route add -net 200.2.2.0 netmask 255.255.255.0 eth1 # /sbin/route add default gw 200.2.2.254
# /sbin/ifconfig eth0 192.168.2.2 broadcast 192.168.2.255 netmask 255.255.255.0
routing table
# /sbin/route add -net 192.168.2.0 netmask 255.255.255.0 eth0 # /sbin/route add default gw 192.168.1.254
これは 図上 です 計算機が 足りないので 実証は していないので こうなる と 考えています 間違いは あると 思いますが ?
にゃんたろう 拝!
2005年12月 3日 (土) 21:48:29 JST 作成
✈