Internet Connection Sharing using Ubuntu 10.04 LTS as NAT Gateway

The following how to contains procedures to configure an Ubuntu 10.04 LTS machine to be used as a NAT (Network Address Translation) gateway for sharing internet connection.

Part A. Configuring IP v4 forwarding option

A.1. Edit the sysctl.conf file by issuing command: nano /etc/sysctl.conf  and un-commented (remove hash mark) from the following line # net.ipv4.ip_forward=1
A.2. Open the rc.local file by issuing command: nano /etc/rc.local, next, add the following lines before exit 0 line

/sbin/iptables -P FORWARD ACCEPT
/sbin/iptables –table nat -A POSTROUTING -o eth0 -j MASQUERADE

(to be continued)

Install Cacti on Ubuntu 10.04 LTS

1. Install command: apt-get install snmpd
2. edit the file /etc/default/snmpd
3. find line SNMPDOPTS='-Lsd -Lf /dev/null -u snmp -g snmp -I -smux -p /var/run/snmpd.pid 127.0.0.1 and remove string 127.0.0.1
save the changes

4 edit the file /etc/snmp/snmpd.conf
Find the line com2sec readonly  default  public
and replace the community string name (i.e., public) with the one for your snmp community
for example: com2sec readonly  default  unpatti
Save the changes

5. restart snmp daemon /etc/init.d/snmpd restart
6. test using the command: /usr/bin/snmpwalk -v 2c unpatti 127.0.0.1

Note: replace unpatti with the ro community string of your server
Note: In this tutorial, the MySQL and Apache2 have been installed in the system and running.
Check whether SNMP is installed and run, if SNMP it is not installed, run apt-get install snmp apt-get php5-snmp

Part B. Install Cacti

1. Install command: apt-get install cacti
2. press/choose ok to acknowledge message of Configuring libphp-adodb
3. configure database for cacti with dbconfig-common(y)? yes
4. supply Password of the database’s administrative user: your mysql root password
5. define MySQL application password for Cacti: yourpassword
6. Choose type of webserver to be used: Apache2 (OK)
… system will proceed with … selecting previously deselected package Gawk …
Finished.

7.Go to http://yourhost/cacti using browser to continue installation process
8. Cacti Installation Guide info, click Next
9. Choose: New Install and then Next
10. Cacti will show the following information
Database User: cacti
Database Hostname:
Database: cacti
Server Operating System type: Unix

11. Click Next
Make sure that RDTool 1.3x or higher is selected

12. Click Finish.
13. First time login on http://yourhost/cacti
user: admin
password: admin

15. proceed with password change
16. Add your device
Go to Management -> Devices -> Add