bc3ff2b3591b545c8002fdb2faa5c67b1f8d6941
howto/EdgeOS-Config.md
... | ... | @@ -0,0 +1,149 @@ |
1 | + |
|
2 | +#EdgeRouterPro-8 config example with v1.9.0 |
|
3 | + |
|
4 | +After a lot of searching and trying I [Phil/ALS7] finnaly got a working config |
|
5 | +Also thanx to drathir for his patience and support |
|
6 | + |
|
7 | +##Features |
|
8 | + |
|
9 | +* IPv4/IPv6 Tunnel via OpenVPN |
|
10 | +* dn42 DNS |
|
11 | + |
|
12 | +##How-To |
|
13 | + |
|
14 | +--> still work in Progress |
|
15 | + |
|
16 | +* Basic EdgeOS knowledge is required |
|
17 | + |
|
18 | +1) you need to create all required fields in the registry --> look at [[Getting started]] |
|
19 | + |
|
20 | +2) get a peer --> ask nice @ [[IRC]] |
|
21 | + |
|
22 | +3) You need following data from the peer |
|
23 | + |
|
24 | +--tunnel options, secret key --ASN from the peer --ip's |
|
25 | + |
|
26 | +... |
|
27 | + |
|
28 | +The data i used are the following: |
|
29 | + |
|
30 | +Own ASN: AS111111 |
|
31 | +Own IPv4: 172.AA.AA.64/27 |
|
32 | +Own IPv6: fdBB:BBBB:CCCC::/48 |
|
33 | + |
|
34 | +Peer OpenVPN Remote Address: X.X.X.X |
|
35 | +Peer OpenVPN Remote Host: X.X.X.Y |
|
36 | +Peer OpenVPN IP for you: fdAA::BBB/64 |
|
37 | +Peer OpenVPN IP: fdAA::CC |
|
38 | +Peer OpenVPN Port: 1194 |
|
39 | +Peer OpenVPN encryption: aes256 |
|
40 | +Peer ASN: AS222222 |
|
41 | +Peer BGP Neighbour IPv4: Z.Z.Z.Z |
|
42 | +Peer BGP Neighbour IPv6: fdAA::CC |
|
43 | + |
|
44 | +###Copy OpenVPN key to the ErPro |
|
45 | + |
|
46 | +copy vpn key to /config/auth/giveITaName |
|
47 | + |
|
48 | + sudo su |
|
49 | + cd /config |
|
50 | + mkdir auth |
|
51 | + cd auth |
|
52 | + cat > giveITaName |
|
53 | + |
|
54 | +now paste the key in the terminal window, hit return once and kill cat with CTRL+C |
|
55 | +last thing to do is type exit |
|
56 | + |
|
57 | +###Create IPv4 OpenVPN Interface |
|
58 | + |
|
59 | +Set up Interface vtunX -- i used vtun0 |
|
60 | + |
|
61 | + configure |
|
62 | + set interface openssh vtun0 |
|
63 | + set interfaces openvpn vtun0 mode site-to-site |
|
64 | + set interfaces openvpn vtun0 local-port 1194 |
|
65 | + set interfaces openvpn vtun0 remote-port 1194 |
|
66 | + set interfaces openvpn vtun0 local-address 172.AA.AA.64 |
|
67 | + set interfaces openvpn vtun0 remote-address X.X.X.X |
|
68 | + set interfaces openvpn vtun0 remote-host X.X.X.Y |
|
69 | + set interfaces openvpn vtun0 shared-secret-key-file /config/auth/giveITaName |
|
70 | + set interfaces openvpn vtun0 encryption aes256 |
|
71 | + |
|
72 | + set interfaces openvpn vtun0 openvpn-option "--comp-lzo" //if your peer support compression |
|
73 | + |
|
74 | + commit |
|
75 | + save |
|
76 | + exit |
|
77 | + |
|
78 | +Now the ipv4 tunnel should be up&running |
|
79 | + |
|
80 | +Check it with: |
|
81 | + |
|
82 | + show interfaces openvpn |
|
83 | + show interfaces openvpn detail |
|
84 | + show openvpn status site-to-site |
|
85 | + |
|
86 | +###Create IPv4 BGP Session |
|
87 | + |
|
88 | +####Open Firewall |
|
89 | + |
|
90 | +* You need to open the firewall to local for the tunnel Interface on port 179/tcp |
|
91 | + |
|
92 | +####Configure the BGP Neighbor |
|
93 | + |
|
94 | +* You must not use AS before the as numbers !! |
|
95 | + |
|
96 | +With this step you create the basic bgp session |
|
97 | + |
|
98 | + configure |
|
99 | + set protocols bgp 111111 neighbor Z.Z.Z.Z remote-as 222222 |
|
100 | + set protocols bgp 111111 neighbor Z.Z.Z.Z soft-reconfiguration inbound |
|
101 | + set protocols bgp 111111 neighbor update-source 172.AA.AA.64 |
|
102 | + commit |
|
103 | + save |
|
104 | + |
|
105 | +When commit this configuration you should be able to see a BGP neighbor session start and come up. |
|
106 | +You can check this with: |
|
107 | + |
|
108 | + show ip bgp summary |
|
109 | + |
|
110 | +####Set route to blackhole |
|
111 | + |
|
112 | +so bgp can announce the route |
|
113 | + |
|
114 | + set protocols static route 172.AA.AA.64/27 blackhole |
|
115 | + commit |
|
116 | + save |
|
117 | + |
|
118 | +####Announce prefix to BGP |
|
119 | + |
|
120 | + set protocols bgp 111111 network 172.A.A.64/27 |
|
121 | + commit |
|
122 | + save |
|
123 | + exit |
|
124 | + |
|
125 | +You should now be able to see networks being advertised via |
|
126 | + |
|
127 | + show ip bgp neighbors Z.Z.Z.Z advertised-routes |
|
128 | + |
|
129 | +###Define Nameservers |
|
130 | + |
|
131 | +Now ping to 172.23.0.53 ... thats the nameserver we are using |
|
132 | +If everything is allright it should work |
|
133 | + |
|
134 | +####NS Config |
|
135 | + |
|
136 | +Enter the configure mode |
|
137 | + |
|
138 | + configure |
|
139 | + set service dns forwarding name-server 8.8.8.8 |
|
140 | + set service dns forwarding name-server 8.8.4.4 |
|
141 | + set service dns forwarding options rebind-domain-ok=/dn42/ |
|
142 | + set service dns forwarding options server=/23.172.in-addr.arpa/172.23.0.53 |
|
143 | + set service dns forwarding options server=/22.172.in-addr.arpa/172.23.0.53 |
|
144 | + set service dns forwarding options server=/dn42/172.23.0.53 |
|
145 | + commit |
|
146 | + save |
|
147 | + exit |
|
148 | + |
|
149 | +Now try to access any .dn42 tld |