How to NAT eth0 to eth1 on Debian squeeze?

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

You will need to edit /etc/sysctl.conf and change the line that says net.ipv4.ip_forward = 0 to net.ipv4.ip_forward = 1.

/sbin/iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
/sbin/iptables -A FORWARD -i eth0 -o eth1 -m state --state RELATED,ESTABLISHED -j ACCEPT
/sbin/iptables -A FORWARD -i eth1 -o eth0 -j ACCEPT

/etc/init.d/isc-dhcp-server restart

cat /etc/resolv.conf

static ip on eth1 (option routers
/etc/resolv.conf (option domain-name-servers;)


subnet netmask {
    interface eth1;
    default-lease-time 6000;
    max-lease-time 7200;
    option subnet-mask;
    option time-offset -3600;
    option routers;
    option domain-name-servers;

/etc/init.d/isc-dhcp-server restart

No comments:

Post a Comment