Needed:
- Computer (Virtual is an option)
- 2 NIC's
- ADSL modem
- linux and iptables
# vi /etc/sysconfig/networking/devices/ifcfg-eth1
DEVICE=eth1
ONBOOT=yes
BOOTPROTO=none
NETMASK=255.255.255.0
USERCTL=yes
PEERDNS=no
GATEWAY=eth0
TYPE=Ethernet
IPADDR=192.168.100.1
# service network restart
# rpm -q iptables
# yum install iptables
# lsmod | grep iptable_nat
# modprobe iptable_nat
# iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
# service iptables save
Activate ip forwarding
# echo \"1\" > /proc/sys/net/ipv4/ip_forward
Edit configfile so the change you made above is still active after a reboot
# /etc/sysctl.conf
net.ipv4.ip_forward = 1
Check the /etc/sysctl.conf file for errors
# sysctl -p
Leave a Reply