すると以外に簡単にできることが判明。以下その手順です。
>
<
[root]#cat /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
ONBOOT=yes
BOOTPROTO=static
IPADDR=192.168.1.100
NETMASK=255.255.255.0
[root]#cp /etc/sysconfig/network-scripts/ifcfg-eth0 /etc/sysconfig/network-scripts/ifcfg-eth0:1
[root]#vi /etc/sysconfig/network-scripts/ifcfg-eth0\:1
[root]#cat /etc/sysconfig/network-scripts/ifcfg-eth0\:1
DEVICE=eth0:1
ONBOOT=yes
BOOTPROTO=static
IPADDR=192.168.1.101
NETMASK=255.255.255.0
[root]#/etc/init.d/network restart
[root]#/sbin/ifconfig
eth0 Link encap:Ethernet HWaddr xx:xx:xx:xx:xx:xx
inet addr:192.168.1.100 Bcast:192.168.1.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:3628231 errors:0 dropped:0 overruns:0 frame:0
TX packets:2719218 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:2803068698 (2673.2 Mb) TX bytes:616666033 (588.0 Mb)
Interrupt:11 Base address:0x8000
eth0:1 Link encap:Ethernet HWaddr xx:xx:xx:xx:xx:xx
inet addr:192.168.1.101 Bcast:192.168.1.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:3628231 errors:0 dropped:0 overruns:0 frame:0
TX packets:2719218 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:2803068698 (2673.2 Mb) TX bytes:616666033 (588.0 Mb)
Interrupt:11 Base address:0x8000
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:6869 errors:0 dropped:0 overruns:0 frame:0
TX packets:6869 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:654293 (638.9 Kb) TX bytes:654293 (638.9 Kb)
/etc/sysconfig/network-scripts/ifcfg-eth0をコピーしてデバイス名とIPアドレスを直して、NICを再起動するだけでした。
これを使えば同じポート番号で2つ以上ソフトを動かしたりできますね。
0 件のコメント:
コメントを投稿