四博智联产品售后

 找回密码
 立即注册
搜索
查看: 6918|回复: 0

Relay

[复制链接]

237

主题

286

帖子

1675

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
1675
发表于 2015-6-9 15:45:04 | 显示全部楼层 |阅读模式


http://wiki.openwrt.org/doc/recipes/relayclient


Due I'm seeing a lot of confusion to make a repeater with OpenWRT, I will put the 2 modes available, with its configs.
I hope its easy to understand.
Of course, first install the latest Trunk version of OpenWrt:
http://downloads.openwrt.org/snapshots/trunk/
Working in Atheros hardware and Attitude Adjustment. I don't know if it works on other hardware or OpenWrt versions.

MODE 1: BRIDGED REPEATER

Both wireless networks will be the same network, DHCP addresses wil be given by the main router, all computers will see each other.

First connect the router to internet, by connecting an ethernet cable between the openwrt's router WAN port and the main router.
Install Relayd

opkg update
opkg install relayd
/etc/init.d/relayd enable

.
.
/etc/config/wireless

config wifi-device 'radio0'
        #blahblah (default settings)
    option channel '1'         #Match with the main wireless network channel
    option disabled '0'

config wifi-iface
    option ssid 'MainWirelessNetwork'
    option encryption 'psk'        # Set wep, psk or psk2 for WEP, WPA or WPA2
    option device 'radio0'
    option mode 'sta'
    option network 'wwan'
    option key 'MainRouterWirelessPassword'

config wifi-iface
    option device 'radio0'
    option mode 'ap'
    option ssid 'RepeaterWirelessNetwork'
    option encryption 'psk'
    option key 'RepeaterWirelessPassword'
    option network 'lan'

.
.
/etc/config/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' #Set this to match you main router network 192.168.x.254
    option netmask '255.255.255.0'
    option gateway '192.168.1.1'   # Your main router's IP
    option dns     '8.8.8.8'

config interface 'wwan'
    option proto 'static'
    option
    option

config 'interface' 'stabridge'
    option 'proto' 'relay'
    option 'network' 'lan wwan'
    option ipaddr '10.0.0.240'

.
.
/etc/config/dhcp

config dhcp lan
    option interface    lan
    option start     100
    option limit    150
    option leasetime    12h
    option ignore    1

config dhcp wan
    option interface    wan
    option ignore    1

.
.
As we want to make all the same network, we can disable the firewall:

/etc/init.d/firewall stop
/etc/init.d/firewall disable

.
.
.
MODE 2: REPEATER, DIFFERENT NETWORK

Repeater's clients will be able to see Main Network's devices, but not vice versa.
Addresses in the Repeater network are managed by the repeater.

Nothing has to be downloaded, the stock openwrt is enought. This is the easiest and simplest way of making a repeater

/etc/config/wireless

config wifi-device 'radio0'
    #blahblah (default settings)
    option disabled '0'
    option channel '1'       #Match with the main wireless network channel

config wifi-iface
    option ssid 'MainWirelessNetwork'
    option encryption 'psk'        # Set wep, psk or psk2 for WEP, WPA or WPA2
    option device 'radio0'
    option mode 'sta'
    option network 'wwan'
    option key 'MainRouterWirelessPassword'

config wifi-iface
    option device 'radio0'
    option mode 'ap'
    option ssid 'RepeaterWirelessNetwork'
    option encryption 'psk'
    option key 'RepeaterWirelessPassword'
    option network 'lan'

.
.
/etc/config/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.10.1'    #set to different range of your main router's network""
    option netmask '255.255.255.0'

config interface 'wwan'
    option proto 'dhcp'

.
.
/etc/config/dhcp

config dhcp lan
    option interface    lan
    option start     100
    option limit    150
    option leasetime    12h
    option ignore    0

config dhcp wan
    option interface    wan
    option ignore    1

.
.
/etc/config/firewall

config defaults
    option syn_flood '1'
    option input 'ACCEPT'
    option output 'ACCEPT'
    option forward 'REJECT'

config zone
    option name 'lan'
    option network 'lan'
    option input 'ACCEPT'
    option output 'ACCEPT'
    option forward 'REJECT'

config zone
    option name 'wan'
    option input 'REJECT'
    option output 'ACCEPT'
    option forward 'REJECT'
    option masq '1'
    option mtu_fix '1'
    option network 'wan wwan'

config forwarding
    option src 'lan'
    option dest 'wan'

Once internet is running, its easy to install LuCi to get the nice WWW interface:

opkg update
opkg install luci

AND, IF YOU INSTALLED RELAYD
opkg install luci-proto-relay

回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|Archiver|手机版|小黑屋|四博智联 Inc. ( 粤ICP备15034758号-1

GMT+8, 2020-12-3 21:51 , Processed in 0.052087 second(s), 25 queries .

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表