Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1514581
  • 博文数量: 129
  • 博客积分: 1449
  • 博客等级: 上尉
  • 技术积分: 3048
  • 用 户 组: 普通用户
  • 注册时间: 2012-07-24 18:36
文章分类

全部博文(129)

文章存档

2015年(3)

2014年(20)

2013年(65)

2012年(41)

分类: 项目管理

2014-07-31 11:49:46

RJ45接口做WAN

1. RJ45接口不接网线时, eth0 肯定无内网IP

点击(此处)折叠或打开

  1. root@OpenWrt:~# busybox ifconfig
  2. br-lan Link encap:Ethernet HWaddr 38:83:45:36:0C:F0
  3.           inet addr:192.168.2.1 Bcast:192.168.2.255 Mask:255.255.255.0
  4.           UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
  5.           RX packets:2556 errors:0 dropped:0 overruns:0 frame:0
  6.           TX packets:2521 errors:0 dropped:0 overruns:0 carrier:0
  7.           collisions:0 txqueuelen:0
  8.           RX bytes:278382 (271.8 KiB) TX bytes:438634 (428.3 KiB)

  9. eth0 Link encap:Ethernet HWaddr 00:16:D3:95:55:30
  10.           UP BROADCAST MULTICAST MTU:1500 Metric:1
  11.           RX packets:0 errors:0 dropped:0 overruns:0 frame:0
  12.           TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
  13.           collisions:0 txqueuelen:1000
  14.           RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
  15.           Interrupt:4

  16. lo Link encap:Local Loopback
  17.           inet addr:127.0.0.1 Mask:255.0.0.0
  18.           UP LOOPBACK RUNNING MTU:16436 Metric:1
  19.           RX packets:95034 errors:0 dropped:0 overruns:0 frame:0
  20.           TX packets:95034 errors:0 dropped:0 overruns:0 carrier:0
  21.           collisions:0 txqueuelen:0
  22.           RX bytes:6462012 (6.1 MiB) TX bytes:6462012 (6.1 MiB)

  23. wlan0 Link encap:Ethernet HWaddr 38:83:45:36:0C:F0
  24.           UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
  25.           RX packets:2529 errors:0 dropped:0 overruns:0 frame:0
  26.           TX packets:2770 errors:0 dropped:0 overruns:0 carrier:0
  27.           collisions:0 txqueuelen:1000
  28.           RX bytes:313626 (306.2 KiB) TX bytes:530918 (518.4 KiB)

2. RJ45接口接网线时, eth0 则获取了内网IP

点击(此处)折叠或打开

  1. root@OpenWrt:/xutest# busybox ifconfig
  2. br-lan Link encap:Ethernet HWaddr 38:83:45:36:0C:F0
  3.           inet addr:192.168.2.1 Bcast:192.168.2.255 Mask:255.255.255.0
  4.           UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
  5.           RX packets:2818 errors:0 dropped:0 overruns:0 frame:0
  6.           TX packets:2783 errors:0 dropped:0 overruns:0 carrier:0
  7.           collisions:0 txqueuelen:0
  8.           RX bytes:300189 (293.1 KiB) TX bytes:477670 (466.4 KiB)

  9. eth0 Link encap:Ethernet HWaddr 00:16:D3:95:55:30
  10.           inet addr:192.168.8.145 Bcast:192.168.8.255 Mask:255.255.255.0
  11.           UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
  12.           RX packets:336 errors:0 dropped:63 overruns:0 frame:0
  13.           TX packets:47 errors:0 dropped:0 overruns:0 carrier:0
  14.           collisions:0 txqueuelen:1000
  15.           RX bytes:47093 (45.9 KiB) TX bytes:4568 (4.4 KiB)
  16.           Interrupt:4

  17. lo Link encap:Local Loopback
  18.           inet addr:127.0.0.1 Mask:255.0.0.0
  19.           UP LOOPBACK RUNNING MTU:16436 Metric:1
  20.           RX packets:103882 errors:0 dropped:0 overruns:0 frame:0
  21.           TX packets:103882 errors:0 dropped:0 overruns:0 carrier:0
  22.           collisions:0 txqueuelen:0
  23.           RX bytes:7066202 (6.7 MiB) TX bytes:7066202 (6.7 MiB)

  24. wlan0 Link encap:Ethernet HWaddr 38:83:45:36:0C:F0
  25.           UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
  26.           RX packets:2791 errors:0 dropped:0 overruns:0 frame:0
  27.           TX packets:3039 errors:0 dropped:0 overruns:0 carrier:0
  28.           collisions:0 txqueuelen:1000
  29.           RX bytes:339101 (331.1 KiB) TX bytes:576625 (563.1 KiB)

WiFi中继模式时, Client+AP来实现的. 重启路由client端可以获取内网IP, 
1. 重启路由可以获取内网IP, 此时路由可以正常上网

点击(此处)折叠或打开

  1. root@OpenWrt:~# ifconfig
  2. br-lan Link encap:Ethernet HWaddr 38:83:45:36:0C:F0
  3.           inet addr:192.168.2.1 Bcast:192.168.2.255 Mask:255.255.255.0
  4.           UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
  5.           RX packets:3202 errors:0 dropped:591 overruns:0 frame:0
  6.           TX packets:79 errors:0 dropped:0 overruns:0 carrier:0
  7.           collisions:0 txqueuelen:0
  8.           RX bytes:372351 (363.6 KiB) TX bytes:12682 (12.3 KiB)

  9. eth0 Link encap:Ethernet HWaddr 38:83:45:36:0C:F0
  10.           UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
  11.           RX packets:3450 errors:0 dropped:15 overruns:0 frame:0
  12.           TX packets:132 errors:0 dropped:0 overruns:0 carrier:0
  13.           collisions:0 txqueuelen:1000
  14.           RX bytes:451630 (441.0 KiB) TX bytes:19276 (18.8 KiB)
  15.           Interrupt:4

  16. lo Link encap:Local Loopback
  17.           inet addr:127.0.0.1 Mask:255.0.0.0
  18.           UP LOOPBACK RUNNING MTU:16436 Metric:1
  19.           RX packets:104 errors:0 dropped:0 overruns:0 frame:0
  20.           TX packets:104 errors:0 dropped:0 overruns:0 carrier:0
  21.           collisions:0 txqueuelen:0
  22.           RX bytes:11823 (11.5 KiB) TX bytes:11823 (11.5 KiB)

  23. wlan0 Link encap:Ethernet HWaddr 38:83:45:36:0C:F0
  24.           UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
  25.           RX packets:56 errors:0 dropped:0 overruns:0 frame:0
  26.           TX packets:3491 errors:0 dropped:0 overruns:0 carrier:0
  27.           collisions:0 txqueuelen:1000
  28.           RX bytes:7163 (6.9 KiB) TX bytes:526068 (513.7 KiB)

  29. wlan0-1 Link encap:Ethernet HWaddr 3A:83:45:36:0C:F0
  30.           inet addr:192.168.8.102 Bcast:192.168.8.255 Mask:255.255.255.0
  31.           UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
  32.           RX packets:3943 errors:0 dropped:593 overruns:0 frame:0
  33.           TX packets:823 errors:0 dropped:0 overruns:0 carrier:0
  34.           collisions:0 txqueuelen:1000
  35.           RX bytes:528090 (515.7 KiB) TX bytes:108481 (105.9 KiB)
此时在上级路由的显示如下: 


2. 中继转换时, 仅执行 /etc/init.d/network restart, 无法获取内网IP, 此时路由无法上网

点击(此处)折叠或打开

  1. root@OpenWrt:~# ifconfig
  2. br-lan Link encap:Ethernet HWaddr 5C:63:BF:CE:12:6A
  3.           inet addr:192.168.2.1 Bcast:192.168.2.255 Mask:255.255.255.0
  4.           UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
  5.           RX packets:1433 errors:0 dropped:6 overruns:0 frame:0
  6.           TX packets:1488 errors:0 dropped:0 overruns:0 carrier:0
  7.           collisions:0 txqueuelen:0
  8.           RX bytes:175314 (171.2 KiB) TX bytes:369206 (360.5 KiB)

  9. eth0 Link encap:Ethernet HWaddr 5C:63:BF:CE:12:6A
  10.           UP BROADCAST MULTICAST MTU:1500 Metric:1
  11.           RX packets:0 errors:0 dropped:0 overruns:0 frame:0
  12.           TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
  13.           collisions:0 txqueuelen:1000
  14.           RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
  15.           Interrupt:4

  16. lo Link encap:Local Loopback
  17.           inet addr:127.0.0.1 Mask:255.0.0.0
  18.           UP LOOPBACK RUNNING MTU:16436 Metric:1
  19.           RX packets:190 errors:0 dropped:0 overruns:0 frame:0
  20.           TX packets:190 errors:0 dropped:0 overruns:0 carrier:0
  21.           collisions:0 txqueuelen:0
  22.           RX bytes:25151 (24.5 KiB) TX bytes:25151 (24.5 KiB)

  23. wlan0 Link encap:Ethernet HWaddr 5C:63:BF:CE:12:6A
  24.           UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
  25.           RX packets:1428 errors:0 dropped:0 overruns:0 frame:0
  26.           TX packets:1607 errors:0 dropped:0 overruns:0 carrier:0
  27.           collisions:0 txqueuelen:1000
  28.           RX bytes:195276 (190.6 KiB) TX bytes:416107 (406.3 KiB)

  29. wlan0-1 Link encap:Ethernet HWaddr 5E:63:BF:CE:12:6A
  30.           UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
  31.           RX packets:637 errors:0 dropped:59 overruns:0 frame:0
  32.           TX packets:2 errors:0 dropped:0 overruns:0 carrier:0
  33.           collisions:0 txqueuelen:1000
  34.           RX bytes:103617 (101.1 KiB) TX bytes:284 (284.0 B)

阅读(3241) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~