If nistspy did not work in the above commands replace it with spymod.
For my questions about how to install NIST Net, please refer to the README under the nistnet directory and the link: http://snad.ncsl.nist.gov/nistnet/install.html
If your xnistnet doesn’t work try entering values from the command line interface for nistnet and then update the rules and then start it from xnistnet and then it should be fine.
Next big step is to change the Redhat machine into a PC-based router.
1. Below, I assume the machine has two network cards. Each connected to a different subnet, in our simple case, two separate PCs. Configure these two cards with IP address. In our case:
eth0: IP: 192.168.0.3 (It’s the default gateway for subnet machines.)
eth1: IP: 192.168.1.3
Their protocol should be ” none” not DHCP as you are assigning a static ip. Do an ifconfig and you should be able to see all the interfaces. if you don’t see them in the list type in ”ifconfig eth0 up“ and the same for eth1 to bring it into the ifconfig list.
2. Open /etc/sysctl.conf file, change the value of net.ipv4.ip_forward to 1. If doesn’t exist, add this line to the file: net.ipv4.ip_forward = 1.
3. We need IP masquerading going on the Red Hat Linux router. So the settings of the firewall need to be changed. We must enable forwarding packet from one side to the other side. Most Linux systems have two types of firewall, iptable, and ipchains. In the case of my system I made use of ipchains as follows:
For ipchains, add these lines to /etc/sysconfig/ipchains file (key lines in bold) (You can do a vi ipchains to see the content):
-A forward –i eth1 -s 192.168.0.0/255.255.255.0 –d 192.168.1.0/255.255.255.0 -j MASQ :output ACCEPT
The commands are case sensitive.
4. At this point, you may want to restart your network as follows:
# /etc/init.d/network restart
5. Then, restart your firewall:
# /etc/init.d/ipchains restart
6. To see if your new rules have gone into effect, type iptables -L or ipchains -L (again, depending on which firewall you are using). All current rules are displayed.
7. Set the IP, subnetmask and gateway on the two computers connected to the router as follows:
PC connected to eth0: 192.168.0.15/24 gw: 192.168.0.3
PC connected to eth1: 192.168.1.15/24 gw:192.168.1.3
Make sure the PCs have no other network connection.
Now, the whole configuration is done, you can ping from one side network to the other side. Try pinging 192.168.1.15 from the machine which has an IP of 192.168.0.15 and it should succeed.
You can try the xnistnet interface or the command line interface and add delay or BW configuration for the connection between various machines:
cnistnet –a 192.168.1.15 192.168.0.15 --delay 300