openWrt 安裝與實踐 II

來源:互聯網
上載者:User

標籤:--   ace   分享   host-only   global   src   實踐   open   prot   

1. 啟動ubuntu上面的openwrt虛擬機器之後, 設定一下虛擬機器的網卡:

第1個網卡: Host-only

第2個網卡: NAT

 

2. 查看網路設定:

[email protected]:/etc/config# cat network

config interface ‘loopback‘
        option ifname ‘lo‘
        option proto ‘static‘
        option ipaddr ‘127.0.0.1‘
        option netmask ‘255.0.0.0‘

config interface ‘lan‘
        option ifname ‘eth0‘
        option type ‘bridge‘
        option proto ‘static‘
        option ipaddr ‘192.168.1.254‘
        option netmask ‘255.255.255.0‘
        option ip6assign ‘60‘

config interface ‘wan‘
        option ifname ‘eth1‘
        option proto ‘dhcp‘

config interface ‘wan6‘
        option ifname ‘eth1‘
        option proto ‘dhcpv6‘

config globals ‘globals‘
        option ula_prefix ‘fd43:e822:82cf::/48‘

用ifconfig|grep addr命令, 可以看到eth1的ip是192.168.127.129:

[email protected]:/etc/config# ifconfig|grep add
br-lan    Link encap:Ethernet  HWaddr 00:0C:29:09:43:FB
          inet addr:192.168.1.254  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fd43:e822:82cf::1/60 Scope:Global
          inet6 addr: fe80::20c:29ff:fe09:43fb/64 Scope:Link
eth0      Link encap:Ethernet  HWaddr 00:0C:29:09:43:FB
          Interrupt:19 Base address:0x2000
eth1      Link encap:Ethernet  HWaddr 00:0C:29:09:43:05
          inet addr:192.168.127.129  Bcast:192.168.127.255  Mask:255.255.255.0
          inet6 addr: fe80::20c:29ff:fe09:4305/64 Scope:Link
          Interrupt:19 Base address:0x2080
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host

 3. 檢查一下是否能訪問網路:

[email protected]:/etc/config# ping baidu.com
PING baidu.com (111.13.101.208): 56 data bytes
64 bytes from 111.13.101.208: seq=0 ttl=128 time=46.149 ms
64 bytes from 111.13.101.208: seq=1 ttl=128 time=47.142 ms
^C
--- baidu.com ping statistics ---
2 packets transmitted, 2 packets received, 0% packet loss
round-trip min/avg/max = 46.149/46.645/47.142 ms

升級一下luci吧:

opkg update

opkg install luci

/etc/init.d/uhttpd enable

/etc/init.d/uhttpd start

/etc/init.d/firewall stop

然後開啟防火牆.

接著就可以在windows上面開啟luci了.

 

 

接下來就可以在web介面上折騰了...

 

openWrt 安裝與實踐 II

聯繫我們

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