分类目录归档:计算机网络应用

Vultr VPS BGP配置双接入点Choopa + HE

在BGP的申请方面,下面的参考资料都说得很清楚了。但是对于两个Peer的接入网上的文章都没有说清楚。经过一番摸索。我把自己的bird配置文件贴上来供参考。可以实现Choopa和HE线路的共同运作。
Bird6.conf:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
router id **Vultr分配的IPV4地址**;
protocol device{
scan time 5;
}
protocol bgp Vultr {
local as **你的AS号,不带AS两个字母**;
source address **Vultr分配的IPV6地址**;
neighbor **Vultr分配的IPV6网关** as 64515;
import none;
export all;
graceful restart on;
multihop 2;
password "**BGP密码**";
}
protocol bgp HE {
local as **你的AS号,不带AS两个字母**;
source address **HE分配的隧道IPV6地址**;
neighbor **HE分配的隧道IPV6网关** as 6939;
import none;
export all;
graceful restart on;
multihop 2;
}
protocol static {
route **你的IPV6宣告网段** via **Vultr分配的IPV6地址**;
}
protocol direct {
interface "**自定义网卡名**";
import all;
}

HE.NET隧道网卡linux配置命令:

1
2
3
4
ifconfig sit0 up
ifconfig sit0 inet6 tunnel ::**HE.NET IPv4接入服务器地址**
ifconfig sit1 up
ifconfig sit1 inet6 add **HE分配的隧道IPv6地址**/64

Vultr网卡Linux配置命令:

1
2
3
ip link add dev **自定义网卡名** type dummy
ip link set **自定义网卡名** up
ip addr add dev **自定义网卡名** **你的IPV6宣告网段**

参考资料:
https://blog.yuzu.im/marchives/133
https://blog.ni-co.moe/public/560.html
https://blog.ni-co.moe/public/563.html

简易python socket通信

Server:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#coding=utf-8
import socket
HOST='127.0.0.1'
PORT=52314
s=socket.socket(socket.AF_INET,socket.SOCK_STREAM)
s.bind((HOST,PORT))
s.listen(1)
while 1:
    conn,addr=s.accept()
    print 'The client on %s is connecting the server.' % str(addr)
    while 1:
        data=conn.recv(1024)
        if data=="\q":
            print 'The client is going to offline.'
            conn.close()
            break
        else:
            print data
conn.close()
s.close()

Client:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#coding=utf-8
import socket
HOST = '127.0.0.1'
PORT = 52314
try:
    s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
    s.connect((HOST, PORT))
    while 1:
        cmd = raw_input()
        if cmd == "quit":
            print 'Bye!'
            s.sendall("\q")
            break
        s.sendall(cmd)
finally:
    s.sendall("\q")
    s.close()

How to register a free .ovh domain

First i want to say:no zuo no die.please remember.
Then i will say how to create the domain.
Now ATTENTION PLEASE: If you don’t have an OVH account andyou are Chinese.Please don’t read the following because OVH don’t accept more Chinese.i don’t know why.though i am a Chinese,but i have registered my OVH account a few years ago.so i can do it now.
OK.First,login your account,and navigate to https://www.ovh.com/fr/domaines/dotovh.xml..fill the textbox with your favorite domain.and click the button.Always choose the no-money option.And at last you will be navigated to an billing page.you shoun’t pay anything.but at the bottom of page,you can see a button.click it and it will let you enter the captcha.then you can take a nap and wait for a long time.Then you will see your domain in you control panel.
My domain :2345.ovh