, 11 2010 . 16:46
+
------> |1 ()| --->2().. .
:
.
1 2 :
eth0 - e
eth1 -
(eth1) :
IP: 192.168.0.1
Netmask: 255.255.255.0
:
ifconfig eth1 192.168.0.1 netmask 255.255.255.0
ifconfig eth1 up
.
, /etc/sysctl.conf:
net.ipv4.ip_forward=1
:
sysctl -w net.ipv4.ip_forward="1"
,
iptables, ( ) .
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
dnsmasq (, DNS ).
:
IP: 192.168.0.2
Netmask/: 255.255.255.0
Gateway/: 192.168.0.1
DNS: 192.168.0.1
.
iptables ,
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
(rc.local )
http://easylinux.ru/node/117
:
linux
dnsmasq
sysctl.conf