安裝完了Oracle數據庫之後,欲用putty連接linux系統,方便管理。但是輸入ifconfig之後,顯示本機ip如下:
所以,需要對linux網絡進行配置,然後才能使用putty等工具。方法如下:
1 即時生效方法:
在root用戶下,輸入如下命令:
#ifconfig eth0 192.168.0.1 netmask 255.255.255.0 up
OK!
2 永久生效方法:
修改配置文件:
/etc/sysconfig/network-scripts/ifcfg-eth0
添加如下內容:
DEVICE=eth0
ONBOOT=yes
BOOTPROTO=static
IPADDR=192.168.0.3
NETMASK=255.255.255.0
GATEWAY=192.168.0.1
最後執行:
service network restart
ok 搞定!
以下是用putty連接上linux後的演示:
login as: root
[email protected]'s password:
Last login: Thu Dec 6 20:24:35 2012
[root@RedHat4 ~]# ifconfig
eth0 Link encap:Ethernet HWaddr 00:0C:29:06:5E:84
inet addr:192.168.0.3 Bcast:192.168.0.255 Mask:255.255.255.0
inet6 addr: fe80::20c:29ff:fe06:5e84/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:38 errors:0 dropped:0 overruns:0 frame:0
TX packets:37 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:4588 (4.4 KiB) TX bytes:4629 (4.5 KiB)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:1861 errors:0 dropped:0 overruns:0 frame:0
TX packets:1861 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:2368602 (2.2 MiB) TX bytes:2368602 (2.2 MiB)
[root@redhat4 ~]#