The examples in section 10.4 use the simulated machine enterprise. It is a simulated x86 machine (PC) with a Red Hat Linux 7.3 installation. Unfortunately enterprise does not have any services running that can be used to test access from the real network to the simulated machine by default. To get around this we can turn on the echo service on TCP port 7.
To be able to try more than one example without repeating the configuration steps, you can prepare a checkpoint that you can then start from when trying the examples. Simply follow these steps:
[root@enterprise root]# pico /etc/xinetd.d/echo
If you prefer Emacs or vi, those editors are also available.
disable = yes
to
disable = no
You can use the arrow keys to navigate in the file.
[root@enterprise root]# /etc/init.d/xinetd restart
You should see a couple of messages about the xinetd service stopping and starting again.
[root@enterprise root]# telnet localhost 7
Type a line of text and press enter, and it should be echoed on the simulated console.
To quit the telnet session, first press Ctrl and 5, and then type q and press enter at the telnet> prompt that appears.
In the examples, the simulated machine sometimes needs to be reconfigured. Since it is running Linux, the Linux configuration commands are used. If you are using a simulated machine with a different operating system you should configure the simulated machine similarly, but the commands may of course be different.
In the examples, the simulation host has the IP address 10.0.0.129 and the real host that communicates with the simulated network has the IP address 10.0.0.240. You should generally replace these addresses with the address of your simulation host and another host on the your real network.
The enterprise machine uses its default IP address 10.10.0.15.
The examples assume that you have a host on the real network that you can telnet to. You should check that you can telnet from the simulation host to the other real host. Just run telnet <ip> in a terminal window, where <ip> is the IP address of the other real host. If that does not work, you should not expect to be able to telnet from the simulated machine either.
If you do not have any hosts that accept telnet connections on your network, you can test the connection by entering GET / HTTP/1.0 and a blank line to port 80 of a web server on your network instead. This should return the HTML content of the start page of the server. Here 64.233.161.104 (www.google.com) is used, replace it with the IP address of your web server:
[root@enterprise root]# telnet 64.233.161.104 80 Trying 64.233.161.104... Connected to 64.233.161.104. Escape character is '^]'. GET / HTTP/1.0 HTTP/1.0 302 Found Location: http://www.google.se/cxfer?c=PREF%3D:TM%3D1118841789:S%3DumC Vbug84n5uBWAo&prev=/ Set-Cookie: PREF=ID=a5e237e2402bdcac:CR=1:TM=1118841789:LM=1118841789: S=HQ3jOc8_1peVGj98; expires=Sun, 17-Jan-2038 19:14:07 GMT; path=/; domain=.google.com Content-Type: text/html Server: GWS/2.1 Content-Length: 214 Date: Wed, 15 Jun 2005 13:23:09 GMT Connection: Keep-Alive <HTML><HEAD><TITLE>302 Moved</TITLE></HEAD><BODY> <H1>302 Moved</H1> The document has moved <A HREF="http://www.google.se/cxfer?c=PREF%3D:TM%3D1118841789:S%3DumC Vbug84n5uBWAo&prev=/">here</A>. </BODY></HTML> Connection closed by foreign host. [root@enterprise root]#
Make sure that the telnet or web server you use is on the same IP subnet as the simulation host, since you may not be able to access other subnets, depending on what connection type you are using.