-
Notifications
You must be signed in to change notification settings - Fork 1
/
VanillaVMInstallations
341 lines (267 loc) · 9.2 KB
/
VanillaVMInstallations
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
Install Vagrantfile
-----------------------------
NewMach-Apr-1.pcap agw_install_ubuntu.sh agw_pre_check_ubuntu.sh mme tmp
vagrant@destro-magma:~$ logout
Connection to 127.0.0.1 closed.
yogesh@compute1:~/SW_EXP/FOCAL$ cat Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.box = "ubuntu/focal64"
config.vm.define :destromagma, autostart: false do |destromagma|
destromagma.vm.hostname = "destro-magma"
destromagma.vm.network "private_network", ip: "192.168.60.176", nic_type: "82540EM"
destromagma.vm.network "private_network", ip: "192.168.129.74", nic_type: "82540EM"
destromagma.vm.provider "virtualbox" do |vb|
vb.name = "destro-magma"
vb.linked_clone = true
vb.customize ["modifyvm", :id, "--memory", "6144"]
vb.customize ["modifyvm", :id, "--cpus", "4"]
vb.customize ["modifyvm", :id, "--nicpromisc2", "allow-all"]
end
end
end
yogesh@compute1:~/SW_EXP/FOCAL$
Login to the vagrant box
---------------------------------
vagrant ssh destromagma
Pre-Request (on destromagma)
-----------------------------------
sudo su
sed -i 's/GRUB_CMDLINE_LINUX=""/GRUB_CMDLINE_LINUX="net.ifnames=0 biosdevname=0"/g' /etc/default/grub
sed -i 's/enp0s3/eth0/g' /etc/netplan/50-cloud-init.yaml
# changing interface name
grub-mkconfig -o /boot/grub/grub.cfg
Restrat the Machine (On Host)
-----------------------------------
vagrant reload magma
Install the Packages (on destromagma)
(Reference : https://docs.magmacore.org/docs/lte/deploy_install)
-----------------------------------
sudo su
wget https://raw.githubusercontent.com/magma/magma/master/lte/gateway/deploy/agw_install_ubuntu.sh
bash agw_install_ubuntu.sh
This will install packages and restart the machine
Only if you need 5G (on destromagma)
----------------------------------------
vagrant@destro-magma:/etc/magma$ cat gateway.mconfig | grep enable5
"enable5gFeatures": true,
"enable5gFeatures": true,
"enable5gFeatures": true,
"enable5gFeatures": true,
vagrant@destro-magma:/etc/magma$
vagrant@destro-magma:/etc/magma$ cat gateway.mconfig | grep mcc
"mcc": "724",
vagrant@destro-magma:/etc/magma$ cat gateway.mconfig | grep mnc
"mnc": "99",
vagrant@destro-magma:/etc/magma$
vagrant@destro-magma:/etc/magma$ cat pipelined.yml
---
#
# Copyright 2020 The Magma Authors.
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# This configuration represents an access gateway with a local internal OVS
# device as the "default route", with a single "uplink" port acting as an L2
# device on port 1. You might need to change this based on the situation.
# OpenFlow ports can be numerical ports, or they can be 'local', which
# corresponds to an 'internal' OVS port; we'll translate into the relevant
# constant for the supported OF protocol by the pipeline.
###############
## IMPORTANT ##
###############
# Changes to this file has to be replicated in pipelined.yml
# Differentiate between the setup type(CWF or LTE)
setup_type: LTE
# log_level is set in mconfig. it can be overridden here
# Enable the services in PipelineD. Tables will be assigned to the services in
# the same order as the list. Cloud managed services will be initialized
# after these static services.
static_services: [
'arpd',
'proxy',
'access_control',
'startup_flows',
'ipv6_solicitation',
]
of_server_port: 3333
default_priority: 10
default_rule_tag: 0x1
# Pipeline application level configs
access_control:
# Blocks access to all AGW local IPs from UEs.
block_agw_local_ips: true
# Traffic to ip blocks in the specified direction in the blocklist will be
# dropped. Each entry in the blocklist should consist of an ip and a
# direction('inbound' or 'outbound'). If direction is not specified, then
# both inbound traffic to and outbound traffic from the ip will be blocked.
# The ip block can be simply an address or an address with a netmask.
# Examples:
# ip_blocklist:
# - ip: '127.0.0.1'
# direction: 'inbound'
# - ip: '127.0.0.1/24'
# direction: 'outbound
# - ip: '127.0.0.1/255.255.255.0'
ip_blocklist: []
meter:
enabled: true
poll_interval: 5
idle_timeout: 0
enforcement:
poll_interval: 2
default_drop_flow_name: 'internal_default_drop_flow_rule'
dpi:
enabled: false
mon_port: mon1
mon_port_number: 32769
idle_timeout: 5
conntrackd:
enabled: false
zone: 897
# Enable polling mobilityd to identify which subscriber sessions need to be
# terminated. If disabling this, make sure to set a valid idle_timeout for
# metering for auto-clearing the sessions
subscriber:
enabled: true
poll_interval: 5
# Interface to address L2 traffic to and answer ARP for UE subnet
virtual_interface: gtp_br0
# For LTE UE doesn't have an eth src so we need to fake it
local_ue_eth_addr: True
# For CWF, allow unknown uplink ARPs to passthrough
allow_unknown_arps: False
# Interface to NAT traffic to
nat_iface: eth0
# Interface to eNodeB
enodeb_iface: eth1
# By default enable routing for NonNAT
dp_router_enabled: true
# Bridge name comes from magma_magmad.service.j2
bridge_name: gtp_br0
# Bridge ip comes from magma_ifaces_gtp
bridge_ip_address: 192.168.128.1
# For ipv6 router solicitation app, default is to use S1 link local address.
# ipv6_router_addr: 'd88d:aba4:472f:fc95:7e7d:8457:5301:ebce'
# QoS parameters
qos:
enable: true
impl: linux_tc
enable_pyroute2: True
max_rate: 1000000000
gbr_rate: 80Kbit
linux_tc:
min_idx: 2
max_idx: 65534
ovs_meter:
min_idx: 2
max_idx: 100000
monitored_ifaces: ['gtp_br0',
'gtp0',
'gtp_sys_2152'
]
# Whether pipelined should cleanup flows on restarts
clean_restart: false
redis_enabled: true
# Logs grpc payload content
magma_print_grpc_payload: false
# MTR iface
mtr_interface: mtr0
###############
## IMPORTANT ##
###############
# This is duplicated from spgw.yml - if you change the value here,
# also change it there
ovs_gtp_port_number: 32768
# Internal port for monitoring service
ovs_mtr_port_number: 15577
ovs_internal_sampling_port_number: 15578
ovs_internal_sampling_fwd_tbl_number: 201
# Be careful changing these default values
# enable_nat: True
non_nat_gw_probe_frequency: 20
# non_nat_arp_egress_port: dhcp0
ovs_uplink_port_name: patch-up
# virtual_mac: '02:ff:bb:cc:dd:ee'
uplink_bridge: uplink_br0
uplink_eth_port_name: eth0
uplink_gw_mac: 'ff:ff:ff:ff:ff:ff'
paging_timeout: 30
classifier_controller_id: 5
upf_node_identifier: 192.168.200.1
he_proxy_eth_mac: 'e6:8f:a2:80:80:80'
ovs_gtp_stats_polling_interval: 180
# Internal port for processing internal conntrack
ovs_internal_conntrack_port_number: 15579
# Table to forward packets from the internal conntrack
ovs_internal_conntrack_fwd_tbl_number: 202
dp_irq:
enable: True
S1_cpu: '2-3'
S1_queue_size: 2048
SGi_cpu: '2-3'
SGi_queue_size: 1024
sgi_tunnel:
enabled: false
type: wg
enable_default_route: false
tunnels:
- wg_local_ip: 172.168.100.1/24
peer_pub_key: 'VQT+tLY6/xF+k1WqrXeQzlfb8hWMVLcPdtCPvwIUNU0='
peer_pub_ip: 1.2.3.4
# Use this config only to turn off TSO of physical devices.
# This is useful to debug perf issues.
# dp_tso:
# gtp_tso_enable: false
#
ebpf:
enabled: false
vagrant@destro-magma:/etc/magma$ cat pipelined.yml
Restart SSH
------------------------
vagrant@destro-magma:/etc/ssh$ cat sshd_config | grep Pass
PasswordAuthentication yes
sudo service sshd restart
Other Commands
------------------------
- Check the version of magma
sudo apt list | grep magma
- Take latest from magma
cat /etc/apt/sources.list.d/magma.list
-- deb https://artifactory.magmacore.org/artifactory/debian-test focal-ci main
-- sudo apt update
-- sudo apt install -y magma -o Dpkg::Options::="--force-overwrite"
Issues
-----------------------
1. DNS Failure
Refer : https://stackoverflow.com/questions/53687051/ping-google-com-temporary-failure-in-name-resolution
sudo systemctl disable systemd-resolved.service
sudo systemctl stop systemd-resolved.service
sudo rm /etc/resolv.conf
sudo vim /etc/resolv.conf
nameserver 8.8.8.8
============================================================================================================
Connecting Machines
yogesh@compute1:~/SW_EXP$ cat Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.box = "ubuntu/bionic64"
config.vm.define :ue_ran_sim, autostart: false do |ue_ran_sim|
ue_ran_sim.vm.hostname = "ue-ran-sim"
ue_ran_sim.vm.network "private_network", ip: "192.168.60.154", nic_type: "82540EM"
ue_ran_sim.vm.network "private_network", ip: "192.168.129.52", nic_type: "82540EM"
ue_ran_sim.vm.provider "virtualbox" do |vb|
vb.name = "ue-ran-sim"
vb.linked_clone = true
vb.customize ["modifyvm", :id, "--memory", "6144"]
vb.customize ["modifyvm", :id, "--cpus", "4"]
vb.customize ["modifyvm", :id, "--nicpromisc2", "allow-all"]
end
end
end