Ubuntu10.04網路問題解決記錄

來源:互聯網
上載者:User

Ubuntu10.04網路問題解決記錄 以前的虛擬機器環境,由於時間長了網路設定變化導致現在上不網,現把解決過程記錄如下: 前提:  本機window7:Ip為192.168.1.5;網關為192.168.1.1;  虛擬機器通過Bridge與本機進行橋接上網。 過程:1、建立Bridge橋接配置: Edit -> Virtual network editor, 添加一個Bridged類型的網路或直接修改其中一個為Bridged類型,並在Bridged to位置選擇本機使用的網卡;確定退出。 2、設定虛擬系統的網路為Bridged: 通過VM -> Settings -> hardware -> Network adapter中,選擇network connection類型中的Bridged;確定退出。 3、啟動虛擬機器,通過命令ifconfig 查看現在啟動的網路裝置及其配置 如有裝置如下,則跳過第4、5步,直接進行第6步配置網路ip和網關就行。 eth0      Link encap:Ethernet  HWaddr xx:xx:xx:xx:xx:xx            inet6 addr: xxxx:xxxx:xxxx:xxxx:xxxx/64 Scope:Link          ...lo        Link encap:Local Loopback            inet addr:127.0.0.1  Mask:255.0.0.0          inet6 addr: ::1/128 Scope:Hos          ...如 只能看到一個lo項(如下),則按照第4步用ifconfig -a繼續查看本機有的網卡裝置 lo        Link encap:Local Loopback            inet addr:127.0.0.1  Mask:255.0.0.0          inet6 addr: ::1/128 Scope:Hos          ...4、通過ifconfig -a命令 可以查看所有網卡裝置即使沒有啟動;如下 eth0      Link encap:Ethernet  HWaddr xx:xx:xx:xx:xx:xx            inet6 addr: xxxx:xxxx:xxxx:xxxx:xxxx/64 Scope:Link          ...lo        Link encap:Local Loopback            inet addr:127.0.0.1  Mask:255.0.0.0          inet6 addr: ::1/128 Scope:Hos5、通過命令vi /etc/network/interfaces修改網路設定auto eth0iface eth0 inet dhcp把自動設定ip改成如下,其中#後為注釋項auto eth0iface eth0 inet staticaddress 192.168.1.10gateway 192.168.1.1netmask 255.255.255.0#nameserver  8.8.8.8nameserver  8.8.8.8#這裡是DNS網域名稱,具體情況其ip不一樣。#network 192.168.1.0#broadcast 192.168.1.2556、通過vi /etc/resolv.conf命令修改DNS配置nameserver  8.8.8.8#保持與上面的nameserver配置一致domain localdomainsearch localdomain7、重啟網卡裝置 用命令/etc/init.d/networking restart重啟網卡裝置。8、用命令reboot重啟虛擬機器系統 重啟後用ifconfig命令查看下,網路設定已經配好且可以上網了。如果沒有用命令ifconfig eth0 up/down 啟動/關閉網卡 eth0試下。 (1)/etc/network/interfaces          這個檔案中可以進行IP/掩碼/預設閘道的配置 (2)/etc/resolv.conf         這個檔案包含DNS網域名稱解析的伺服器位址 (3)/etc/init.d/networking          這個檔案可以重新啟動網卡的配置   /etc/init.d/networking restart具體使用到的命令主要有如下命令: (1)ifconfig -------查看網卡資訊 (2)ifconfig eth0 up/down 啟動/關閉網卡 eth0 (3)ifconfig eth0 125.0.0.0 netmask 255.0.0.0   -----配置網卡IP地址 (4)route add default gw 192.168.1.1   -------配置預設路由 (5)/etc/init.d/networking  restart 重啟網路設定  

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.