Setup Linux as an internet gateway PDF Print E-mail
Monday, 12 February 2007 11:12
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
 

Comments  

 
-1 #1 Rishi 2011-05-10 19:11
http://reddragon-linux.blogspot.com/2011/05/linux-internet-gateway-server-setup.html
Quote
 

More KB Articles