配置OpenWRT 校园网实现 IPv4 over IPv6。 - XiZi's Blog

配置OpenWRT 校园网实现 IPv4 over IPv6。

Xizi posted @ 2014年3月19日 15:18 in 未分类 with tags IPv4 Over IPv6 IPv6 校园网 OpenWRT OpenVPN , 13390 阅读

目前网络状况:两个位置:位置1和位置2,位置1可以正常访问IPv6网络(校内和校外),位置2可以访问IPv6和IPv4网络。

 

目的:实现位置1处无差别上网,即正常访问IPv4和IPv6网络,关键是IPv4。

基本原理:通过openvpn路由所有的IPv4数据给远程电脑。

基础设施:位置1处路由器(mdir-615),位置2处做好路由和openvpn()监听IPv4和IPv6地址。

1、基础准备。配置位置2处的电脑,做好openvpn服务器,使用正常的客户端测试openvpn的连通性。网上教程很多,这里不做具体说明了。 

2、路由的openwrt配置。这里使用我的DLink dir615 为例说明。

1)刷openwrt,这里需要提到一点,我的dir615刷openwrt,ie11和chrome都不能刷,下了个firefox4可以。

2)安装必备的软件包,由于我的dir615闪存只有4m,所以都不能安装图形界面,还有后面选择polarssl和popenvpn-polarssl,也是次原因,完全命令行操作。必备的软件包有: kmod-tun,liblzo,libpolarssl,openvpn-polarssl。

3)配置

(1)配置/etc/config/system

config system
        option hostname OpenWrt #路由器的名称
        option timezone CST-8   #时区,这个就是Asia/Chongqing,也就是中国的时区。

config 'led' 'wlan_led'   #这个是我的dir615配置无线led灯的
        option 'name'   'WLAN'
        option 'sysfs'  'd-link:green:wlan'
        option 'trigger'        'netdev'
        option 'dev'    'wlan0'
        option 'mode'   'link tx rx'

config 'led' 'wan_led'   #段配置wan口led灯
        option 'name'     'WAN'
        option 'sysfs'    'd-link:green:wan'
        option 'trigger'  'netdev'
        option 'dev'      'tun0'
        option 'mode'     'link tx rx'

(2)配置/etc/config/network

config interface 'wan'
        option ifname 'eth1' #指定wan口网卡
        option proto 'none' #这个地方配置修改为none,我们不需要ipv4网络
        option macaddr '00:24:01:76:B2:27' #这句指定wan口的mac地址。

config interface 'ovpn'  #这段内容是我们增加的,为后续的防火墙做准备。
        option ifname 'tun0' #openvpn使用的interface名称
        option proto 'none' #这里也不用配置,他的网络是由程序配置的。

(3)配置/etc/config/firewall

#对wan区域增加我们配置的openvpn,ovpn我们上面刚配置的名字。
config zone
        option name             wan
        list   network          'wan'
        list   network          'wan6'
        list   network          'ovpn' #增加这一行把openvpn增加的wan区域里面,否则即使你连接上了,路由器可以正常上网,但局域网客户端不能上。
        option input            REJECT
        option output           ACCEPT
        option forward          REJECT
        option masq             1
        option mtu_fix          1

(4)配置dns解析服务,这里我们修改/etc/dnsmasq.conf

#在文件尾部增加DNS服务器,越靠下优先级越高
server=2001:4860:4860::8844 # google ipv6 public dns
server=2001:4860:4860::8888 # 同上 
server=xxx.xxx.xxx.xxx # 学校IPv4 DNS

(5) 关于openvpn的配置,由于我们没有IPv4网络,redirect gateway回出现错误失效,我们手动添加路由即可。 /etc/config/openvpn

config openvpn sample_client

        # Set to 1 to enable this instance:
        option enabled 1
        ....
        #插入以下段到你配置的openvpn client 配置部分
        list route "0.0.0.0 0.0.0.0"

 

(6)顺便把无线的配置也贴出来吧。/etc/config/wireless

config wifi-device  radio0
        option type     mac80211
        option channel  11
        option hwmode   11ng
        option path     'platform/ath9k'
        list ht_capab   SHORT-GI-40
        list ht_capab   DSSS_CCK-40
        option htmode   HT20
        # REMOVE THIS LINE TO ENABLE WIFI:
        # option disabled 1  #注意这里原来是没有前面那个#的

config wifi-iface
        option device   radio0
        option network  lan
        option mode     ap  #无线工作模式,ap路由,sta客户端
        option ssid     myssid #OpenWrt #默认是OpenWrt改为你想要的名字
        option encryption psk2 #none #默认是none改为你想要的加密方式,psk,psk2,wep等
        option key password #当然是密码喽。
Avatar_small
ETHENS 说:
2020年9月20日 20:04

different opinions about a particular thing will for sure help others to learn. Similarly, de.altoconvertpdftoword.com gives a chance to learn the solutions of some problems. This eases their tasks and allow them to work smoothly.

Avatar_small
ETHENS 说:
2020年10月01日 22:38

HP Board 1st, 2nd, 3rd, 4th, 5th Syllabus 2021 A syllabus is a document that contains SCERT HP 2nd Class Syllabus important information about certain content. Typically, it interacts the students what exactly you are going to study during a particular period of time. Moreover, this is a necessity as well, as providing the length and breadth of HP Board 1st, 2nd, 3rd, 4th, 5th Syllabus not only clear a picture but also keeps the candidates to be ready ahead, before the actual demonstration of chapters.

Avatar_small
sk 说:
2021年7月28日 04:50

I can say that Digitek is one of my go-to businesses when it comes to https://www.digitekprinting.com/poster-prints services. They give us customers the service that we deserve. In addition, their ink in every printing is very long lasting.

Avatar_small
Buy Backlinks 说:
2021年9月03日 01:34

You need to be painfully specific with your targeting. Because random comments with promotional content is not commenting.

Avatar_small
Plus-1 Model Paper K 说:
2021年9月27日 21:08

Kerala HSC Model Paper 2022 with answer solutions to practice with the regular mock test for (Onam & Orukkum) Quarterly, Halfyearly, Prefinal and Annual final Public examinations to the academic year of 2022, Class teacher of the college is also suggested lesson wise most important questions to every chapter of Arts, Science, and Commerce stream. Plus-1 Model Paper Kerala 2022 We have suggested to every DHSE and VHSE student can download all subject model question paper with old exam previous paper Pdf to guessing IMP questions for theory, objective.

Avatar_small
Adilkhatri 说:
2021年10月05日 19:26

it's to a great degree cool blog. Interfacing is incredibly profitable thing.you have really had any kind of effect 바카라사이트

Avatar_small
merckseo 说:
2021年10月10日 06:21

Best Social Plan is the most trusted company for providing social media marketing services. Within some years it has gained popularity as a reliable company to its customers. This company is now managing its activity successfully. It is proved number one company by its quality services. It is noticed that more and more customers are showing their intention to take service from this company. Best Social Plan

Avatar_small
adilkhatri 说:
2021年10月18日 18:55

The site is tenderly balanced and saved as much as date. So it should be, an obligation of appreciation is all together to offer this to us. АНУ -ын онлайн виз

Avatar_small
adilkhatri 说:
2021年10月21日 23:38

An obligation of appreciation is all together for the informational and pleasing post, plainly in your blog everything is extraordinary.. sviluppo siti web Milano

Avatar_small
network penetration 说:
2021年10月23日 06:12

Amaze! Just what exactly watch opener the following posting is to do. Significantly prized, saved as a favorite, I actually can’t bide time until extra!

Avatar_small
adilkhatri 说:
2021年10月23日 21:27

In this specific article, you will see a synopsis, fulfill peruse this post. Procedura di richiesta del visto indiano

Avatar_small
types of computer ne 说:
2021年10月23日 22:54

Terrific put up, attended on top not to mention saved your web sites. I just can’t hang around to study further because of most people.

Avatar_small
adilkhatri 说:
2021年10月24日 00:12

I am keen on such themes so I will address page where it is cool depicted. برنامه ویزا کانادا آنلاین

Avatar_small
adilkhatri 说:
2021年10月24日 02:47

This is extremely fascinating substance! I have altogether delighted in perusing your focuses and have arrived at the conclusion that you are ideal about a significant number of them. You are incredible. Rental Baby Roller

Avatar_small
merckseo 说:
2021年10月26日 03:17

Thanks for posting this info. I just want to let you know that I just check out your site and I find it very interesting and informative. I can't wait to read lots of your posts. sbobet

Avatar_small
merckseo 说:
2021年10月26日 19:52

For what reason do just such a great amount of composed regarding this matter? Here you see more.  안전공원

Avatar_small
adilkhatri 说:
2021年10月27日 19:09

Here at this site amazingly the basic material gathering so everybody can value an incredible arrangement. siti internet varese

Avatar_small
DIET RBSE Class 5 Pr 说:
2021年10月27日 19:34

RBSE 5th Important Question Paper 2022 in PDF format. Rajasthan's Board of Secondary Education (BSER) will hold a public examination for the DIET RBSE Class 5 Previous Question Paper 2022 BSER Matric Exam will be held in the month of March every year,with around 5 to 6 lakhs of students taking part in the exam each year. Rajasthan Board 5th Class Exam Dates are expected to be announced soon. BSER 5th Question Paper 2022 for All Subjects is available on this website. These questions are based on the BSER-recommended curriculum.

Avatar_small
adilkhatri 说:
2021年10月28日 23:25

Thanks for the nice blog. It was very useful for me. I'm happy I found this blog. Thank you for sharing with us.I too always learn something new from your post. 사설토토

Avatar_small
ilounge 说:
2021年11月01日 02:16

Really! Everything that a opener it blog post was for my situation. A great deal enjoyed, bookmarked, As i can’t look ahead to alot more!

Avatar_small
adilkhatri 说:
2021年11月02日 18:37

I need to express profound gratitude to you. I have bookmark your site for future updates. bed bug traps

Avatar_small
adilkhatri 说:
2021年11月02日 18:43

A debt of gratitude is in order for composing such a decent article, I bumbled onto your blog and read a couple of post. I like your style of composing... Anemometer

Avatar_small
adilkhatri 说:
2021年11月02日 18:49

For this site, you will see our record, make sure to experience this information. ice skates

Avatar_small
adilkhatri 说:
2021年11月02日 19:04

This is a great post I seen because of offer it. It is truly what I needed to see seek in future you will proceed after sharing such a magnificent post. bungee cords

Avatar_small
adilkhatri 说:
2021年11月02日 19:11

Gee… I translate writes on a similar to issue, be that as it may I never went by your blog. I added it to populars additionally i'll be your reliable preliminary. tool belt

Avatar_small
Harry 说:
2021年11月04日 00:27

Thanks for the nice blog. It was very useful for me. I'm happy I found this blog. Thank you for sharing with us.I too always learn something new from your post.

<a href="http://202.95.10.77/">judi qiu qiu online</a>

Avatar_small
Harry 说:
2021年11月04日 00:36

This is exactly for that reason fabulous and additionally extremely creative. I simply absolutely love all the different shades and additionally anyone can get the software on the deliver would be happy. judi online24jam terpercaya 2020

Avatar_small
Harry 说:
2021年11月09日 00:49

Seriously! What exactly a close watch opener that write-up has become in my opinion. Completely liked, book-marked, When i can’t lose time waiting for far more! silk pajama set womens

Avatar_small
Harry 说:
2021年11月09日 00:57

This is exactly for that reason fabulous and additionally extremely creative. I simply absolutely love all the different shades and additionally anyone can get the software on the deliver would be happy. silk pajamas set

Avatar_small
Harry 说:
2021年11月12日 21:31 It is a great suggestions specifically to be able to people not used to blogosphere, quick and also correct information… Thank you regarding revealing this place. A necessity examine write-up judi qiu qiu online
Avatar_small
Harry 说:
2021年12月31日 03:20

Seriously! What exactly a close watch opener that write-up has become in my opinion. Completely liked, book-marked, When i can’t lose time waiting for far more! 카지노사이트

Avatar_small
Harry 说:
2021年12月31日 03:28

Great posting, moved in front plus saved as a favorite your web blog. I actually can’t put it off to read simple things extra out of you actually 카지노사이트

Avatar_small
Harry 说:
2022年2月02日 02:47

Thanks for the nice blog. It was very useful for me. I'm happy I found this blog. Thank you for sharing with us.I too always learn something new from your post. situs garudaqq

Avatar_small
Harry 说:
2022年2月02日 02:51

It is a great suggestions specifically to be able to people not used to blogosphere, quick and also correct information… Thank you regarding revealing this place. A necessity examine write-up dominoqq

Avatar_small
Harry 说:
2022年2月15日 05:46

Wonderful blog post, resolved to go on and even bookmarked your webblog. As i can't hold on to enjoy a book alot more as a result of one. situs garudaqq

Avatar_small
NCERT 8th Class Text 说:
2022年7月01日 23:46

NCERT Class 1,2, 3, 4, 5, 6, 7, 8, 9, 10 Textbooks 2023 for Providing the best learning Platform with Various Resources to Support and enhance Educational Delivery and Management. Students Download NCERT Books 2023 for Class 1,2, 3, 4, 5, 6, 7, 8, 9, 10 Subject Wise and Hindi, Urdu, English Medium Wise our Website Provide Pdf Format, This Online Service offers easy Access to the NCERT e-Book 2023 for Class 1,2, 3, 4, 5, 6, 7, 8, 9, 10. <a href="https://10thmodelpaper.in/ncert-books-for-class-1-2-3-4-5-6-7-8-9-10/">NCERT 8th Class Textbook 2023</a> The service covers eBooks of all subjects Published by NCERT for Class 1,2, 3, 4, 5, 6, 7, 8, 9, 10 Class in Hindi, English and Urdu.

Avatar_small
NCERT 8th Class Text 说:
2022年7月01日 23:47

NCERT Class 1,2, 3, 4, 5, 6, 7, 8, 9, 10 Textbooks 2023 for Providing the best learning Platform with Various Resources to Support and enhance Educational Delivery and Management. Students Download NCERT Books 2023 for Class 1,2, 3, 4, 5, 6, 7, 8, 9, 10 Subject Wise and Hindi, Urdu, English Medium Wise our Website Provide Pdf Format, This Online Service offers easy Access to the NCERT e-Book 2023 for Class 1,2, 3, 4, 5, 6, 7, 8, 9, 10. NCERT 8th Class Textbook 2023 The service covers eBooks of all subjects Published by NCERT for Class 1,2, 3, 4, 5, 6, 7, 8, 9, 10 Class in Hindi, English and Urdu.

Avatar_small
nutrizionista roma p 说:
2022年8月01日 20:10

Spesso però bastano pochi giorni per perdere la motivazione iniziale. Non importa quanto tu ti senta motivato all’inizio: dopo qualche giorno continuare sembra impossibile.

Avatar_small
homes for sale in Ro 说:
2022年8月10日 23:14

Buying or selling a home is more than just a transaction: it’s a life-changing experience. That’s why I highly-seasoned real estate professionals is dedicated to providing exceptional, personalized service for all of my clients.

Avatar_small
dark web/deep web/d 说:
2022年8月20日 18:11

This will show you any content pages associated with those links. The content pages are usually informational, although sometimes they contain affiliate links to other companies. dark web links

Avatar_small
dark web/deep web/d 说:
2022年8月20日 18:59

To find out more about links, subscribe to the newsletter called Search Engine Land. In this newsletter, you will receive important tips and information about improving your site's ranking on Google.  deep web

Avatar_small
dark web/deep web/d 说:
2022年8月20日 19:28

The Dark Net is an untapped goldmine for anyone willing to take advantage of it. The Dark Web is a part of the World Wide Web that's not visible to the common browser or search engine. dark web sites

Avatar_small
dark web/deep web/d 说:
2022年8月20日 20:02

A lot of these sites are link farms. These are websites that have hundreds of other links leading to their own page on the Web.  dark web links

Avatar_small
dark web/deep web/d 说:
2022年8月20日 20:20

Other sites, such as those offering gambling sites, have been known to spam innocent gamers with links to their own gambling sites. dark web

Avatar_small
dark web/deep web/d 说:
2022年8月20日 20:42

The most common product an affiliate marketer sells is information products. This can be information on a new topic, an e-book, or even a manual on a particular subject.  work from home jobs

Avatar_small
dark web/deep web/d 说:
2022年8月20日 21:00

These are usually small text within the content. Many people include these within their material because they want to sell the reader something. They will usually give you a portion of the sale if they are sold. affiliate marketing success

Avatar_small
AP SSC Hindi Questio 说:
2022年9月16日 06:53

Every student of class 10 can learn Hindi easily and this is or National language, Hindi is the most important language for every student, AP SSC Hindi Question Paper and the Board of Secondary Education, Andhra Pradesh (BSEAP) class 10th of SSC students also can download the AP 10th Hindi Model Paper 2023 Pdf with Solved question paper in chapter wise for all lessons of the course as AP SSC Hindi Model Paper 2023. Every student of class 10 can learn Hindi easily and this is or National language, Hindi is the most important language for every student.


登录 *


loading captcha image...
(输入验证码)
or Ctrl+Enter
Host by is-Programmer.com | Power by Chito 1.3.3 beta | © 2007 LinuxGem | Design by Matthew "Agent Spork" McGee