mardi 3 avril 2012

Nat transparent


/etc/network/interfaces

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

#interface internet
auto eth0
iface eth0 inet static
address 172.16.1.226
network 172.16.1.0
broadcast 172.16.1.255
netmask 255.255.255.0
gateway 172.16.1.254

#interface LOCAL
auto eth1
iface eth1 inet static
address 10.0.0.1
network 10.0.0.0
broadcast 10.0.255.255
netmask 255.255.0.0
gateway 172.16.1.254
#gateway 10.0.0.1
#pre-up /home/manager/iptables.start



/etc/init.d/iptables

#!/bin/bash

#sysctl net.ipv4.ip_forward=1
#iptables -> /etc/init.d/iptables
#sudo update-rc.d iptables defaults
#eth0 internet

iptables -A POSTROUTING -t nat -o eth0 -j MASQUERADE


/etc/resolv.conf

nameserver 172.16.1.254


/etc/dhcp3/dhcpd.conf

#
# Sample configuration file for ISC dhcpd for Debian
#
# Attention: If /etc/ltsp/dhcpd.conf exists, that will be used as
# configuration file instead of this file.
#
# $Id: dhcpd.conf,v 1.1.1.1 2002/05/21 00:07:44 peloy Exp $
#

# The ddns-updates-style parameter controls whether or not the server will
# attempt to do a DNS update when a lease is confirmed. We default to the
# behavior of the version 2 packages ('none', since DHCP v2 didn't
# have support for DDNS.)
ddns-update-style none;

# option definitions common to all supported networks...
#option domain-name "8.8.8.8";
#option domain-name-servers ns1.example.org, ns2.example.org;

default-lease-time 600;
max-lease-time 7200;

# If this DHCP server is the official DHCP server for the local
# network, the authoritative directive should be uncommented.
#authoritative;

# Use this to send dhcp log messages to a different log file (you also
# have to hack syslog.conf to complete the redirection).
log-facility local7;

# No service will be given on this subnet, but declaring it helps the
# DHCP server to understand the network topology.

#subnet 10.152.187.0 netmask 255.255.255.0 {
#}

# This is a very basic subnet declaration.


subnet 10.0.0.0 netmask 255.255.0.0 {
  range 10.0.0.2 10.0.10.254;
  option routers 10.0.0.1;
  option domain-name "salle 416";
  option domain-name-servers 8.8.8.8;
}

Aucun commentaire:

Enregistrer un commentaire