Urban Terror Server on Cisco CSR1000v

We have discussed the configuration of Guest Shell on Cisco CSR 1000v platform in a previous tutorial. The guest shell is a built-in Linux container with CentOS 7 installed, which can be activated on the fly when Linux applications are needed. Our lives are currently affected by SARS-CoV-2 and long-standing quarantine, so why not do something crazy and completely useless just for fun? For me, this is the configuration and operation of the Urban Terror server on the Cisco CSR1000v server.

So, what we need to run Urban Terror server on the Cisco CSR 1000v? First of all, we need to create a VMware CSR 1000v  instance and license it. The whole process is explained in the previous tutorial. When the licensed VMware instance of CSR 1000v is ready, we can add it to the GNS3 network topology. GNS3 is a great tool because it allows you to add and connect network nodes very quickly without really knowing what's going on under the hood. It also supports the VMware Workstation Pro hypervisor, which we will use for virtualization.

Once the CSR router is added to GNS3 topology, we must connect the router to the GNS3 cloud symbol using tap interface.  Before we actually do this, we need to create a tap interface, connect it to the bridge interface, and connect the physical Ethernet interface to the bridge. In other words, the job of the bridge is to create a connection between host computer (K55VM) running Urban Terror client and virtualized CSR 1000v VM running Urban Terror server. The network topology is depicted on the Picture 1.

Picture 1 - GNS3 Network Topology

In order to somehow automatize the process of creating tap and bridge interfaces, connecting physical Ethernet interface enp4s0f2 and tap interface to the bridge, I have created a Bash script bridge_interfaces.sh which performs this task for you. Edit the script to reflect your configuration such as IP address for the br0 interface and run the script with a single argument - the number of the tap interfaces you want to create.

In our case, the script creates a br0 and tap0 interface and connect the Ethernet interface and tap0 interface to the bridge br0.

bash ./bridge_interfaces.sh 1

Based on the number of detected tap interfaces, the script delete_interfaces.sh  removes tap interfaces and Ethernet interface from the brodge br0 and deletes br0.

bash ./delete_interfaces.sh

Hardware:

  • Asus K55VM
    - Intel(R) Core(TM) i7-3610QM CPU @ 2.30GHz
    - RAM - 2 x Kingston DDR3 8192MB
  • SOHO router - a physical SOHO router that connects LAN to the Internet

Software:

  • Host OS - Debian 10 Buster with installed VMware Workstation 15.1.0 build-13591040 and GNS3 2.2.5
  • Guest OS - CSR1000v VMware instance (Cisco IOS XE Software 16.07.01, AX feature with the maximum throughput  2500 Mbps ) (Picture 2)

Picture 2 - CSR1000v VMware Instance Parameters

1. Route Configuration

Configuration of the guest shell has been covered in a previous tutorial so we can go further and connect CSR instance to the Internet. To do so, configure a static default route 0.0.0.0/0 via SOHO router (172.17.100.1) on CSR1000v.

CSR1(config)# ip route 0.0.0.0 0.0.0.0 172.17.100.1

In order to route packets destined for the guest shell subnet 10.0.0.0/24, we need to create a route 10.0.0.0/24 on host computer (Debian 10) via the IP address 172.17.100.85 (IP address of the GigabitEthernet2 of CSR router).

$ sudo  ip route add 10.0.0.0/24 via 172.17.100.85

The same route must be configured on SOHO router, so it can route packets to the guest shell container (IP address 10.0.0.1).

$ sudo  ip route add 10.0.0.0/24 via 172.17.100.85

Once the Internet connection is working, we can update CentOS 7 in guest shell container.

CSR1# guestshell  
[guestshell@guestshell ~]$ sudo yum update -y

2. Urban Terror Server Download and Configuration

Urban Terror requires about 1.4GB free disk space thus switch to the directory /bootflash that is 7.4GB. Create the directory UrbanTerro4.3 and download the installation script UrTUpdater_Ded.sh [15kB] with wget command.

guestshell@guestshell ~]$ cd /bootflash/
[guestshell@guestshell bootflash]$ mkdir UrbanTerror4.3
[guestshell@guestshell bootflash]$ cd UrbanTerror4.3/
[guestshell@guestshell UrbanTerror4.3]$ wget "https://raw.githubusercontent.com/Barbatos/UrTUpdater/master/ded/UrTUpdater_Ded.sh"

Now, assign the executive privilege to the script and run it. The script is interactive so it will ask you few questions. Download will start shortly.

[guestshell@guestshell UrbanTerror4.3]$ chmod +x UrTUpdater_Ded.sh
[guestshell@guestshell UrbanTerror4.3]$ ./UrTUpdater_Ded.sh

Once the download is complete, create the config file for server.

[guestshell@guestshell UrbanTerror4.3]$ cp q3ut4/server_example.cfg q3ut4/server.cfg

We can start the server with the command:

[guestshell@guestshell UrbanTerror4.3]$ ./Quake3-UrT-Ded.x86_64 +set fs_game q3ut4 +set fs_basepath /bootflash/UrbanTerror4.3/ +set fs_homepath /bootflash/UrbanTerror4.3/ +set dedicated 2 +set net_port 27960 +set com_hunkmegs 128 +exec server.cfg

Server starts listening on port 27960.

Picture 3 - Socket 0.0.0.0:27960 Opened for Urban Terror Server

3. Urban Terror Client Configuration

Start the Urban Terror Client on Debian 10 Linux (IP 172.17.100.80/16).

$ ./Quake3-UrT.x86_64

Enter the game console pressing the key ` and connect to the server with the command:

] connect 10.0.0.1:27960

Picture 4 -  Connection to Urban Terror Server (IP Address 10.0.0.1/24) Running in Guest Shell Container on Cisco CSR 1000v 

TCPdump started in the guest shell container confirms communication on UDP port 27960 between Urban Terror client (172.17.100.80) and server 10.0.0.1.

[guestshell@guestshell ~]$ sudo tcpdump -i eth0 host 172.17.100.80 and port 27960 -n

Picture 5 -  Communication Between Urban Terror Server 10.0.0.1 and Client 172.17.100.80 on UDP 27960

Happy gaming!

End.

One thought on “Urban Terror Server on Cisco CSR1000v

  1. I picked up this book yesterday.
    Containers in Cisco IOS-XE, IOS-XR, and NX-OS: Orchestration and Operation

    When are you going to write a book?

    Okay, I saw your post on youtube videos.
    But for me, the real action is with simplescreenrecord and a VM in GNS3.
    But on my Windows machine uses the GNS3 VM and it fails with the command virt validate host (or virt host validate - I forget which).
    And I can not switch to hyper-v right now on my Windows box.

    My ubuntu box also failed with the same command. But I updated grub (I have not touched grub in over 10 years and I was a little afraid of the damage I would do). to get access to IOMMU. But...my ubuntu is running on, now, an old laptop. And it only has one graphics cpu and I do not know how to get everything off of that graphics cpu because I want to record videos on a VM, this way I can do the dishes and watch the videos later....

    I really do not understand why other GNS3 users are not all over the place recording videos on VMs. Without the IOMMU support however, the cpu usage for ssr is very large (expecially on a 4K screen). But with the newer VMs, they support 1920x1080 which is completely fine for any training videos.

    Also I just switched to spice console from vnc about a week ago. Spice looks to be much more powerful. I do not understand
    what this gns3 "spice + agent" thing is though.

    Lots of fun though.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.