安装完了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
root@192.168.0.3'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 ~]#