{"id":9119,"date":"2022-04-28T16:17:33","date_gmt":"2022-04-28T08:17:33","guid":{"rendered":"http:\/\/jc.a300.cn/luyouwang\/?p=9119"},"modified":"2022-04-28T16:17:33","modified_gmt":"2022-04-28T08:17:33","slug":"openwrt%e4%bf%ae%e6%94%b9ip%e5%9c%b0%e5%9d%80%e4%b8%a4%e7%a7%8d%e6%96%b9%e6%b3%95%ef%bc%88%e7%9b%b4%e6%8e%a5%e5%91%bd%e4%bb%a4%e4%bf%ae%e6%94%b9%e8%b7%9f%e5%90%8e%e5%8f%b0%e4%bf%ae%e6%94%b9%ef%bc%89","status":"publish","type":"post","link":"http:\/\/jc.a300.cn/luyouwang\/9119.html","title":{"rendered":"OpenWrt\u4fee\u6539IP\u5730\u5740\u4e24\u79cd\u65b9\u6cd5\uff08\u76f4\u63a5\u547d\u4ee4\u4fee\u6539\u8ddf\u540e\u53f0\u4fee\u6539\uff09"},"content":{"rendered":"

OpenWrt\u662f\u4ec0\u4e48\uff1fOpenWrt\u4e00\u822c\u5e38\u89c1\u4e8e\u65e0\u7ebf\u8def\u7531\u5668(\u8f6f\u8def\u7531)\u7b2c\u4e09\u65b9\u56fa\u4ef6\uff0c\u5b83\u662f\u4e00\u4e2a\u9ad8\u6548\u3001\u53ef\u9760\u3001\u529f\u80fd\u591a\u7684\u8def\u7531\u5668\u56fa\u4ef6\u3002<\/strong>OpenWrt \u53ef\u4ee5\u88ab\u63cf\u8ff0\u4e3a\u4e00\u4e2a\u5d4c\u5165\u5f0f\u7684 Linux \u53d1\u884c\u7248\u3002\uff08\u4e3b\u6d41\u8def\u7531\u5668\u56fa\u4ef6\u6709 dd-wrt,tomato,openwrt,padavan\u56db\u7c7b\uff09\u5bf9\u6bd4\u4e00\u4e2a\u5355\u4e00\u7684\u3001\u9759\u6001\u7684\u7cfb\u7edf\uff0cOpenWrt\u7684\u5305\u7ba1\u7406\u63d0\u4f9b\u4e86\u4e00\u4e2a\u5b8c\u5168\u53ef\u5199\u7684\u6587\u4ef6\u7cfb\u7edf\uff0c\u4ece\u5e94\u7528\u7a0b\u5e8f\u4f9b\u5e94\u5546\u63d0\u4f9b\u7684\u9009\u62e9\u548c\u914d\u7f6e\uff0c\u5e76\u5141\u8bb8\u60a8\u81ea\u5b9a\u4e49\u7684\u8bbe\u5907\uff0c\u4ee5\u9002\u5e94\u4efb\u4f55\u5e94\u7528\u7a0b\u5e8f\u3002<\/p>\n

\"OpenWrt\"<\/a>
OpenWrt<\/figcaption><\/figure>\n

OpenWrt\u7684\u7f51\u7edc\u914d\u7f6e\u6587\u4ef6\u662f\/etc\/config\/network<\/code>\uff0c\u5b83\u8d1f\u8d23\u4ea4\u6362\u82af\u7247VLAN\u3001\u7f51\u7edc\u63a5\u53e3\u548c\u8def\u7531\u7684\u914d\u7f6e\u3002<\/p>\n

\u65b9\u6cd5\u4e00\uff1a\u4f7f\u7528\u547d\u4ee4\u4fee\u6539<\/h2>\n

\u6211\u4eec\u53ef\u4ee5\u5728\u63a7\u5236\u53f0\u4e2d\u8f93\u5165ifconfig<\/code>\u547d\u4ee4\u6765\u67e5\u770b\u7cfb\u7edf\u7684IP\u5730\u5740<\/p>\n

root@OpenWrt:\/# ifconfig\r\n<\/pre>\n

\u9996\u5148\u5728SSH\u63a7\u5236\u53f0\u4e2d\u8f93\u5165<\/p>\n

vi\u00a0\u00a0\u00a0 etc\/config\/network<\/pre>\n
root@OpenWrt:~# vi \/etc\/config\/network\r\n\r\nconfig interface 'loopback'\r\n        option ifname 'lo'\r\n        option proto 'static'\r\n        option ipaddr '127.0.0.1'\r\n        option netmask '255.0.0.0'\r\n\r\nconfig globals 'globals'\r\n        option packet_steering '1'\r\n\r\nconfig interface 'lan'\r\n        option type 'bridge'\r\n        option proto 'static'\r\n        option ipaddr '192.168.1.1'\r\n        option netmask '255.255.255.0'\r\n        option ip6assign '60'\r\n        option _orig_ifname 'eth0'\r\n        option _orig_bridge 'true'\r\n        option ifname 'eth0 eth1 eth2'\r\n\r\nconfig interface 'wan'\r\n        option proto 'dhcp'\r\n        option ifname 'eth3'<\/pre>\n

\u53ea\u9700\u8981\u5c06192.168.1.1\u4fee\u6539\u6210\u4f60\u60f3\u8981\u7684IP\u5730\u5740\uff0c\u6bd4\u5982192.168.8.1 \u6309i \u8fdb\u5165\u4fee\u6539\uff0c\u4fee\u6539\u5b8c\u6210\u6309 esc \u9000\u51fa\u7f16\u8f91\uff0c\u63a5\u7740:wq \u4fdd\u5b58\u9000\u51fa<\/span>\uff0c\u7136\u540e\u4fdd\u5b58\u9000\u51fa\uff0c\u7136\u540e\u518d\u91cd\u542f\u5f00\u53d1\u677f\uff08\u5982\u679c\u4f7f\u7528\u547d\u4ee4\u53ef\u4ee5\u4f7f\u7528reboot<\/strong><\/span>\uff09\uff0c\u5c31\u53d1\u73b0 IP \u5730\u5740\u88ab\u6539\u4e3a 192.168.8.1 \u4e86\u3002<\/p>\n

 <\/p>\n

\u65b9\u6cd5\u4e8c\uff1a\u4f7f\u7528WEB\u63a7\u5236\u53f0\u4fee\u6539<\/h2>\n

\u767b\u5f55OpenWrt\u7cfb\u7edf\u7684WEB\u63a7\u5236\u53f0<\/p>\n

\u70b9\u51fb\u7f51\u7edc --> \u63a5\u53e3 --> LAN<\/p>\n

\"\"<\/a>\u70b9\u51fb\u4fee\u6539<\/code>\uff0c\u8fdb\u5165LAN\u63a5\u53e3\u4fee\u6539\u9875\u9762<\/p>\n

\"\"<\/a><\/p>\n

\u5c06IPv4 \u5730\u5740<\/code>\u4e2d\u7684192.168.1.1<\/code>\u4fee\u6539\u4e3a\u81ea\u5df1\u60f3\u8981\u7684IP\u5373\u53ef\uff0c\u4fee\u6539\u5b8c\u6210\u540e\uff0c\u6700\u540e\u70b9\u51fb\u4e0b\u65b9\u7684\u4fdd\u5b58&\u5e94\u7528<\/code>\u5373\u53ef\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"

OpenWrt\u662f\u4ec0\u4e48\uff1fOpenWrt\u4e00\u822c\u5e38\u89c1\u4e8e\u65e0\u7ebf\u8def\u7531\u5668(\u8f6f\u8def\u7531)\u7b2c\u4e09\u65b9\u56fa\u4ef6\uff0c\u5b83\u662f\u4e00\u4e2a\u9ad8\u6548\u3001\u53ef\u9760\u3001\u529f\u80fd\u591a\u7684\u8def\u7531\u5668\u56fa\u4ef6\u3002OpenWrt \u53ef\u4ee5\u88ab\u63cf\u8ff0\u4e3a\u4e00\u4e2a\u5d4c\u5165\u5f0f\u7684 Linux \u53d1\u884c\u7248\u3002\u2026<\/p>\n","protected":false},"author":680,"featured_media":9120,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[182,2842,2840,2841],"attr":[],"class_list":{"0":"post-9119","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","6":"hentry","7":"category-ruanluyou","8":"tag-openwrt","9":"tag-openwrt-lanip","10":"tag-openwrtip","12":"entry"},"views":81199,"_links":{"self":[{"href":"http:\/\/jc.a300.cn/luyouwang\/wp-json\/wp\/v2\/posts\/9119","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/jc.a300.cn/luyouwang\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/jc.a300.cn/luyouwang\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/jc.a300.cn/luyouwang\/wp-json\/wp\/v2\/users\/680"}],"replies":[{"embeddable":true,"href":"http:\/\/jc.a300.cn/luyouwang\/wp-json\/wp\/v2\/comments?post=9119"}],"version-history":[{"count":0,"href":"http:\/\/jc.a300.cn/luyouwang\/wp-json\/wp\/v2\/posts\/9119\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/jc.a300.cn/luyouwang\/wp-json\/wp\/v2\/media\/9120"}],"wp:attachment":[{"href":"http:\/\/jc.a300.cn/luyouwang\/wp-json\/wp\/v2\/media?parent=9119"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/jc.a300.cn/luyouwang\/wp-json\/wp\/v2\/categories?post=9119"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/jc.a300.cn/luyouwang\/wp-json\/wp\/v2\/tags?post=9119"},{"taxonomy":"attr","embeddable":true,"href":"http:\/\/jc.a300.cn/luyouwang\/wp-json\/wp\/v2\/attr?post=9119"}],"curies":[{"name":"wp","href":"http:\/\/api.w.org\/{rel}","templated":true}]}}