Skip to content

Commit 1f37efe

Browse files
authored
Merge pull request #4 from madaovh/patch-5
Adjust centos section with permanent routes/rules
2 parents f8b35a4 + 49e45b9 commit 1f37efe

File tree

1 file changed

+40
-12
lines changed
  • pages/cloud/dedicated/configuring-an-ip-block-in-a-vrack

1 file changed

+40
-12
lines changed

pages/cloud/dedicated/configuring-an-ip-block-in-a-vrack/guide.en-gb.md

+40-12
Original file line numberDiff line numberDiff line change
@@ -146,38 +146,66 @@ And we define the IP settings:
146146
```sh
147147
# Created by cloud-init on instance boot automatically, do not edit.
148148
#
149-
BOOTPROTO=static
150149
DEVICE=eth1
150+
BOOTPROTO=static
151151
ONBOOT=yes
152-
TYPE=Ethernet
153152
USERCTL=no
154-
DEFROUTE=no
153+
IPV6INIT=no
154+
PEERDNS=yes
155+
TYPE=Ethernet
156+
NETMASK=255.255.255.240
155157
IPADDR=46.105.135.97
156-
PREFIX=28
158+
ARP=yes
157159
```
158160

159161
### Create a new IP routing table
160162

161163
Next, we need to create a new IP route for the [vRack](https://www.ovh.co.uk/solutions/vrack/){.external}. We'll be adding a new traffic rule by amending the file, as shown below:
162164

163165
```sh
164-
sudo ip rule add from 46.105.135.97 lookup 1000
166+
/etc/iproute2/rt_tables
167+
168+
#
169+
# reserved values
170+
#
171+
255 local
172+
254 main
173+
253 default
174+
0 unspec
175+
#
176+
# local
177+
#
178+
#1 inr.ruhep
179+
1 vrack
180+
```
181+
182+
Next, create the file needed to apply the new rules:
183+
```sh
184+
nano /etc/sysconfig/network-scripts/rule-eth1
165185
```
186+
187+
And paste the following content (please remember to replace our variables with your own values):
188+
166189
```sh
167-
ip rule
168-
0: from all lookup local
169-
32765: from 46.105.135.97 lookup 1000
170-
32766: from all lookup main
171-
32767: from all lookup default
190+
ip rule add from 46.105.135.96/28 table vrack
191+
ip rule add to 46.105.135.96/28 table vrack
172192
```
173193

174194
### Amend the network configuration file
175195

176196
Finally, we need to amend the network configuration file to account for the new traffic rule and route the [vRack](https://www.ovh.co.uk/solutions/vrack/){.external} traffic through the network gateway address of **46.105.135.110**.
177197

198+
We can achieve it by editing the following file in order to add persistent and static routes:
199+
200+
```sh
201+
nano /etc/sysconfig/network-scripts/route-eth1
202+
```
203+
204+
Paste the following content (please remember to replace our variables with your own values):
205+
178206
```sh
179-
ip route add 46.105.135.96/28 dev eth1 table vrack
180-
ip route add default via 46.105.135.110 dev eth1 table vrack
207+
46.105.135.96/28 dev eth1 table vrack
208+
default via 46.105.135.110 dev eth1 table vrack
181209
```
182210

183211
Now reboot your server to apply the changes or alternatively enable simply the new network interface:

0 commit comments

Comments
 (0)