*NetWork [#na9a6dd7]

RIGHT:更新日&lastmod();
**ip addrによるIPの追加 [#l8587d8c]

ifconfigよりこちらが利用されるようになるみたい。ここで編集されたことはifconfigでは見えない。

-ip追加
 ip addr add 192.168.0.2/24 dev eth0

-ip削除
 ip addr del 192.166.0.2/24 dev eth0

-ip確認
 $ ip addr show
 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN
     link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
     inet 127.0.0.1/8 scope host lo
     inet6 ::1/128 scope host
        valid_lft forever preferred_lft forever
 2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNOWN qlen 1000
     link/ether 00:22:68:59:3b:e1 brd ff:ff:ff:ff:ff:ff
     inet 192.168.10.46/24 brd 192.168.10.255 scope global eth0
     inet6 2001:a4e8:ee4e:0:222:68ff:fe59:3be1/64 scope global dynamic
        valid_lft 14150sec preferred_lft 12350sec
     inet6 fe80::222:68ff:fe59:3be1/64 scope link
        valid_lft forever preferred_lft forever

***ifcfg-eth0に記述してもよい [#p9cbe674]
以下を追加
 
 IPADDR2=192.168.0.2
 NETMASK2=255.255.255.0


**ipアドレスの追加及びルーティング情報の追加 [#ud061bbe]

ネットワークのON/OFF

 /sbin/ifconfig eth0:0 down
 /sbin/ifconfig eth0:0 up
 /sbin/ifconfig eth0:0 192.244.75.3


ipアドレスの追加:
 /sbin/ifconfig eth0:1 192.244.75.3
 /sbin/ifconfig eth0:2 192.244.75.5

ルーティング情報の追加/更新:
 /sbin/route add default gw 192.244.75.21
 /sbin/route del default gw 192.244.75.21
 /sbin/route add -net 192.244.75.0 gw 10.0.0.2 netmask 255.255.255.0 metric 1
 /sbin/route add -net 10.0.0.0 netmask 255.0.0.0 eth0

defaultゲートウェイの追加:
 /sbin/route add -net default gw 192.244.75.9

ネットワークの接続状態表示

 netstat --numeric-ports 
 稼働中のインターネット接続(w/oサーバー)
 Proto 受信-Q 送信-Q 内部アドレス            外部アドレス            状態
 tcp        0      0 192.244.75.253:4040     192.244.75.254:1035     ESTABLISHED
 tcp        0    140 192.244.75.253:22       219.109.252.82:6307     ESTABLISHED
 稼働中のUNIXドメインソケット (w/oサーバー)
 Proto RefCnt フラグ      タイプ     状態         Iノード パス
 unix  13     [ ]         DGRAM                    678    /dev/log
 unix  3      [ ]         STREAM     CONNECTED     1621498
 
 ------------中略------------------------------------------------

**ネットワークデバイスの設定等 [#pf590563]

/etc/sysconfigの中にもあるがデバイス名については

''/etc/udev/rules.d/70-persistent-net.rules

 # This file was automatically generated by the /lib/udev/write_net_rules
 # program run by the persistent-net-generator.rules rules file.
 #
 # You can modify it, as long as you keep each rule on a single line.
 
 # Realtek Semiconductor Co., Ltd. RTL-8169 Gigabit Ethernet (rule written by anaconda)
 SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:40:ca:97:92:63", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"

にある~
Ghost等でデュプリケートした場合は70-persistent-net.rulesを削除して再起動すると
新しく作成される。

また Vine5.xからネットワークの起動が~

/etc/rc.d/init.d/network から /etc/rc.d/init.d/NetworkManager

に変更になったようだ

&color(red){しかし、NetworkManagerがいまいち動作がわからないので、NetworkManagerを止めて networkに変更する};

 NetworkManager  0:off   1:off   2:off   3:off   4:off   5:off   6:off
 (略)
 network         0:off   1:off   2:off   3:on    4:on    5:on    6:off

GUIのネットワークの設定のデバイスで各デバイスでNetworkManagerで管理するのチェックを外す

''ethtool''

ネットワークインターフェイスの状況を調べるコマンド

 # ethtool eth0
 Settings for eth0:
        Supported ports: [ TP MII ]
        Supported link modes:   10baseT/Half 10baseT/Full
                                100baseT/Half 100baseT/Full
                                1000baseT/Half 1000baseT/Full
        Supports auto-negotiation: Yes
        Advertised link modes:  10baseT/Half 10baseT/Full
                                100baseT/Half 100baseT/Full
                                1000baseT/Half 1000baseT/Full
        Advertised auto-negotiation: Yes
        Speed: 100Mb/s
        Duplex: Full
        Port: MII
        PHYAD: 0
        Transceiver: internal
        Auto-negotiation: on
        Supports Wake-on: pumbg
        Wake-on: g
        Current message level: 0x00000033 (51)
        Link detected: yes

''lspci''

 # lspci
 
 (略)
 
 01:04.0 CardBus bridge: Ricoh Co Ltd RL5c476 II (rev ac)
 01:04.1 CardBus bridge: Ricoh Co Ltd RL5c476 II (rev ac)
 01:04.2 FireWire (IEEE 1394): Ricoh Co Ltd R5C552 IEEE 1394 Controller (rev 04)
 01:06.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL-8169 Gigabit Ethernet (rev 10)

--------------------------------------------------------------------------------
RIGHT:[[元ページ:http://wwwism.dyndns.org/hp/linux/network.htm]]


トップ   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS