分类 Linux 下的文章

Raspbian 网桥配置

安装bridge-utils:

sudo apt install bridge-utils -y

修改:

/etc/network/interfaces

添加:

auto br0
  iface br0 inet manual
  bridge_ports eth0 eth1

修改:

/etc/dhcpcd.conf

添加:

denyinterfaces eth0 eth1

interface br0
static ip_address=10.168.1.206/24
static routers=10.168.1.1
static domain_name_servers=10.168.1.1

树莓派添加enc28j60网络模块

树莓派针脚

   3V3  (1) (2)  5V    
 GPIO2  (3) (4)  5V    
 GPIO3  (5) (6)  GND   
 GPIO4  (7) (8)  GPIO14
   GND  (9) (10) GPIO15
GPIO17 (11) (12) GPIO18
GPIO27 (13) (14) GND   
GPIO22 (15) (16) GPIO23
   3V3 (17) (18) GPIO24
GPIO10 (19) (20) GND   
 GPIO9 (21) (22) GPIO25
GPIO11 (23) (24) GPIO8 
   GND (25) (26) GPIO7 
 GPIO0 (27) (28) GPIO1 
 GPIO5 (29) (30) GND   
 GPIO6 (31) (32) GPIO12
GPIO13 (33) (34) GND   
GPIO19 (35) (36) GPIO16
GPIO26 (37) (38) GPIO20
   GND (39) (40) GPIO21

enc28j60模块与树莓派连接针脚


Pi                ENC28J60   
----------------------------
+3V3              VCC         
GPIO10/MOSI       SI        
GPIO9/MISO        SO       
GPIO11/SCLK       SCK     
GND               GND      

GPIO25            INT       
GPIO8/CE0#        CS 

针脚连接好之后修改/boot/config.txt,加入以下内容:

dtparam=spi=on
dtoverlay=enc28j60

然后重启树莓派就能出现enc28j60网卡.

解决使用移动,长宽等宽带ssh总是断开的问题

移动等的一些宽带经过了好几次NAT, 为限制设备NAT并发,超时的NAT表项就删除掉了。所以导致连接ssh的时候总是会断开。

总结了几种解决办法,遇到这种情况可以试一下。

服务器端

修改/etc/sshd_config配置文件,修改ClientAliveInterval的值为60,即每60秒向客户端发一个消息,用于保持连接。

ClientAliveInterval 60

- 阅读剩余部分 -

lede的snmp配置文件

lede的snmp配置文件

agentaddress UDP:161
sysLocation office
sysContact bofh@example.com
sysName HeartOfGold
com2sec ro default public
com2sec rw localhost private
group public v1 ro
group public v2c ro
group public usm ro
group private v1 rw
group private v2c rw
group private usm rw
view all included .1
access public "" any noauth exact all none none
access private "" any noauth exact all all all
exec  filedescriptors /bin/cat /proc/sys/fs/file-nr

7620N 软件源

dest root /
dest ram /tmp
lists_dir ext /var/opkg-lists
option overlay_root /overlay

src/gz 17.01_core http://downloads.pandorabox.com.cn/pandorabox/targets/ralink/mt7620/packages
src/gz 17.01_base http://downloads.pandorabox.com.cn/pandorabox/packages/mipsel_24kec_dsp/base
src/gz 17.01_lafite http://downloads.pandorabox.com.cn/pandorabox/packages/mipsel_24kec_dsp/lafite
src/gz 17.01_luci http://downloads.pandorabox.com.cn/pandorabox/packages/mipsel_24kec_dsp/luci
src/gz 17.01_mtkdrv http://downloads.pandorabox.com.cn/pandorabox/packages/mipsel_24kec_dsp/mtkdrv
src/gz 17.01_packages http://downloads.pandorabox.com.cn/pandorabox/packages/mipsel_24kec_dsp/packages

RASPBIAN配置无线网卡

编辑 /etc/wpa_supplicant/wpa_supplicant.conf 文件,添加:

network={
    ssid="无线网名称"
    psk="无线网密码"
    proto=RSN
    key_mgmt=WPA-PSK
    pairwise=CCMP
    group=CCMP
    auth_alg=OPEN
}
  1. 自动获取ip地址,

编辑 /etc/network/interfaces文件,修改为

allow-hotplug wlan0
iface wlan0 inet manual
    wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
iface default inet dhcp
  1. 配置固定ip地址

编辑 /etc/network/interfaces文件,修改为

allow-hotplug wlan0
iface wlan0 inet manual
    wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
iface default inet static
    ipaddr 192.168.1.100
    netmask 255.255.255.0
    gateway 192.168.1.1

Nginx下网页错位解决办法

最近遇到Nginx下网页错位,通过chrome的开发者工具发现这么一句话
Resource interpreted as Stylesheet but transferred with MIME type application/octet-stream:

解决办法也很简单,在配置文件中加入

include mime.types;

就行了,该文件内容如下


- 阅读剩余部分 -