CentOS

Using iptables to route OpenVPN traffic
avatar

To have your vpn traffic be able to reach the internet you just need to add the following iptable rules:

iptables -A FORWARD -i tun0 -j ACCEPT
iptables -A FORWARD -i tun0 -o eth0 -m state –state RELATED,ESTABLISHED -j ACCEPT
iptables -A FORWARD -i eth0 -o tun0 -m state –state RELATED,ESTABLISHED -j ACCEPT
iptables -t nat -A POSTROUTING -s 192.168.0.0/24 -o eth0 -j MASQUERADE

This would take the tunnel adapter of tun0 and route the traffic through eth0 for the vpn subnet of 192.168.0.0.

Posted in Arch, CentOS, Fedora, Guides, Linux, Networking | Tagged , | Leave a comment

Redetect Network Cards in CentOS 6
avatar

CentOS 6 keeps all of the information about the networking cards in udev.  To have the system redetect the NIC cards all you need to do is delete the persistent-net.rules file and reboot.  During boot the file will be regenerated with the new information.

rm /etc/udev/rules.d/70-persistent-net.rules

Next you should update the /etc/sysconfig/network-scripts/ifcfg-<adapter> scripts to contain the new MAC addresses and remove the UUID entries that will nto match if the cards changed.

Posted in CentOS, Linux | Leave a comment

Turn on IP Forwarding in Linux
avatar

By default for security reasons IP forwarding is turned off.  If you are setting up a router or a vpn gateway you will need to turn it back on.  You can just run the following command to turn it on.

echo 1 > /proc/sys/net/ipv4/ip_forward

 

Posted in Arch, CentOS, Fedora, Guides, Linux, Networking | 1 Comment

CentOS / RHEL: View Vnstat Graphs Using PHP Web Interface Frontend
avatar

CentOS / RHEL: View Vnstat Graphs Using PHP Web Interface Frontend.

Posted in CentOS, Fedora, Guides, Linux | Leave a comment

CentOS / RHEL: Install Network Traffic Monitor To Keep a Log Of Daily Traffic
avatar

CentOS / RHEL: Install Network Traffic Monitor To Keep a Log Of Daily Traffic.

Posted in CentOS, Fedora, Guides, Linux | Leave a comment