OpenWrt 的世界︰樹莓派 3B 【路由器】移星轉斗

什麼是『路由器』呢?它的構成『條件』又是什麼??

一小段文字︰

OpenWrt as router device

If your device has some ports labeled LAN and at least a port labeled WAN and you want it to operate as a router (a connection between two different networks). Depending on actual hardware support, it may be possible to create a WAN port on a device with only LAN ports, see your device’s page for more info about this.
:!: the default IP of the LAN ports of a OpenWrt device is 192.168.1.1, if the addresses of the devices in the network you connect to the WAN port are 192.168.1.X (X=any number), you need to change the IP address of the LAN interfaces your OpenWrt router to 192.168.2.1 (or to something that isn’t 192.168.1.X, anyway), or change the addressing of the other network you are connecting to.
The LAN and WAN ports MUST have at least different subnets for routing to work.

This means:

  • OpenWrt will be mostly in its default factory configuration
    • firewall on
    • DHCP is on
  • The following steps are optional:
    • you can customize the router address and the address of the subnet that OpenWrt manages, but you don’t have to (you preferably want to do this, if the addresses 192.168.1.* are already in use on the WAN side)
    • you can change the WAN side IP address to no longer obtain a dynamic address: if your ISP wants you to set a fixed address then set it to a fixed address instead
  • If you are confused now or don’t know, simply start by leaving both config parts in its default configuration. If you experience problems with these defaults, then adapt them accordingly later.

Luci instructions:

  1. Click on NetworkInterfaces, then click on the Edit button of the LAN Network.
  2. In General Setup tab, in IPv4 address write the static address of this device, if your router’s address is 192.168.1.1 (most common) you can usually choose any address from 192.168.1.2 to 192.168.1.250. Once you have chosen and written the IP address, write it down in the same sticker with the user/password above, it will be used to connect to your device in the future.
  3. By default the WAN interface/port is set as DHCP client, this will allow it to work with networks where there is another router giving addresses without further configuration. If you need to set static address please see the instructions for Client device, and change the WAN interface settings accordingly.

Command line instructions:

  1. type uci set network.lan.ipaddr='new-ip-address‘ (“new-ip-address” is the new IP address you want for the LEDE device in your network) and press Return,
  2. if needed, type uci set network.wan.proto='static‘ to switch to static protocol on WAN interface, then change wan settings by using the same procedure detailed for Client device, settings for wan interface are network.wan.ipaddr, network.wan.gateway, network.wan.dns, and so on, so change the commands accordingly.
  3. You might want to basic OpenWrt documentation too, as these setups are usually very specific to your own network setup and it makes no sense to try to cover all possible cases here.
  4. type uci commit && service network restart and press Return
  5. then connect again to your device at its new IP address and continue

 

 如何簡單解釋著實苦惱!

 

若說『路由』就是『網路擇徑』!?

Routing

Routing is the process of selecting a path for traffic in a network, or between or across multiple networks. Broadly, routing is performed in many types of networks, including circuit-switched networks, such as the public switched telephone network (PSTN), and computer networks, such as the Internet.

In packet switching networks, routing is the higher-level decision making that directs network packets from their source toward their destination through intermediate network nodes by specific packet forwarding mechanisms. Packet forwarding is the transit of logically addressed network packets from one network interface to another. Intermediate nodes are typically network hardware devices such as routers, bridges, gateways, firewalls, or switches. General-purpose computers also forward packets and perform routing, although they have no specially optimized hardware for the task.

The routing process usually directs forwarding on the basis of routing tables, which maintain a record of the routes to various network destinations. Routing tables may be specified by an administrator, learned by observing network traffic or built with the assistance of routing protocols.

Routing, in a narrower sense of the term, often refers to IP routing and is contrasted with bridging. Routing assumes that network addresses are structured and that similar addresses imply proximity within the network. Structured addresses allow a single routing table entry to represent the route to a group of devices. In large networks, structured addressing (routing, in the narrow sense) outperforms unstructured addressing (bridging). Routing has become the dominant form of addressing on the Internet. Bridging is still widely used within local area networks.

Delivery schemes

Routing schemes differ in how they deliver messages:

  • unicast delivers a message to a single specific node
  • broadcast delivers a message to all nodes in the network
  • multicast delivers a message to a group of nodes that have expressed interest in receiving the message
  • anycast delivers a message to any one out of a group of nodes, typically the one nearest to the source
  • geocast delivers a message to a geographic area

Unicast is the dominant form of message delivery on the Internet. This article focuses on unicast routing algorithms.

Routing schemesCast.svg
UnicastUnicast.svg
BroadcastBroadcast.svg
MulticastMulticast.svg
AnycastAnycast-BM.svg
GeocastGeocast.svg
 

 

藉著『route』軟件達成『目的』?!

D.1. route

Appendix D. IP Route Management

D.1. route

In the same way that ifconfig is the venerable utility for IP address management, route is a tremendously useful command for manipulating and displaying IP routing tables.

Here we’ll look at several tasks you can perform with route. You can display routes, add routes (most importantly, the default route), remove routes, and examine the routing cache. I will switch between traditional and CIDR notation for network addressing in this (and subsequent) sections, so the reader unaware of these notations is encouraged to refer liberally to the links provided in Section I.1.3, “General IP Networking Resources”.

When using route and ip route on the same machine, it is important to understand that not all routing table entries can be shown with route. The key distinction is that route only displays information in the main routing table. NAT routes, and routes in tables other than the main routing table must be managed and viewed separately with the ip route tool.

 

直是繞口令呦!!

或該讀本書吧☆

《鳥哥的 Linux 私房菜》

第二章、基礎網路概念

……

小標題的圖示5.1.2 路由修改: route

我們在第二章網路基礎的時候談過關於路由的問題, 兩部主機之間一定要有路由才能夠互通 TCP/IP 的協定,否則就無法進行連線啊!

………

 

問題在『斗轉星移』刻不停歇?☻

索性反其道而行,借增

‧ usb ethernet adapter

ethernet hub

談『實務』趣味,三招兩式闖江湖也!☺