更改Linux網路設定,並使用putty串連

來源:互聯網
上載者:User


安裝完了Oracle資料庫之後,欲用putty串連linux系統,方便管理。但是輸入ifconfig之後,顯示本機ip如下:
www.2cto.com


所以,需要對linux網路進行配置,然後才能使用putty等工具。方法如下:
1 即時生效方法: www.2cto.com
在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 ~]#
  

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.