Guestshell on C8000v Running Cisco IOS XE Version 17.12.02
- Newer versions run Centos 8
- First enable iox which is the feature that enables running container. Then we need to create a special interface that will source our traffic. This will serve as the default gateway for all the containers that will be bound to this interface
en
conf t
iox
interface VirtualPortGroup 0
ip add 192.168.2.1 255.255.255.0
no shut
- If you have an IGP running you can just advertise the interface into the process or you can just configure NAT which we will do
access-list 1 permit 192.168.2.0 0.0.0.255
ip nat inside source list 1 interface G1 overload
interface VirtualPortGroup 0
ip nat inside
interface G1
ip nat outside
- Enable Guest Shell:
We will configure gateway0 as the default gateway and then bind it to the virtualportgroup we created. The guest-interface is the interface that will be presented to the container
The guest-ipaddress is the ip of the container
conf t
app-hosting appid guestshell
app-vnic gateway0 virtualportgroup 0 guest-interface 0
guest-ipaddress 192.168.2.100 netmask 255.255.255.0
app-default-gateway 192.168.2.1 guest-interface 0 # This is the default router that will be pushed to the container
name-server0 1.1.1.1
end
4. Now we will enable the guestshell
```bash copy
guestshell enable
guestshell
- dohost allows you to run ios commands in the shell
dohost "show ip route 192.168.1.0" | sed 's/255/500/g'
- you can send files to your bootflash on your router which can come in handy for sharing files and folder with you container and the router
touch /bootflash/guest-share/myfile.txt