Serwer ma już skonfigurowany, internet poprzez PPPoE śmiga, aż miło.
Teraz chciałbym, aby puszczał internet dalej do jednego komputera przez tą samą kartę sieciową.
- eth0 mam pod PPPoE
eth1 chciałbym mieć na 192.168.3.x

Kod: Zaznacz cały
[komputer docelowy]
|
|
|
|
|
{sieć}---------{serwer z dwiema sieciówkami}
Na komputerze- kliencie jest ubuntu, ale plik interfaces wyglądałby takinterfaces z serwera pisze: auto lo ath0 eth0
#ath0 <- po tym dostaję sygnał z internetu
#eth0 <- tym puszczam go dalej
iface lo inet loopback
address 127.0.0.1
netmask 255.0.0.0
iface ath0 inet dhcp
pre-up iwconfig ath0 essid any
iface eth0 inet static
address 160.64.0.1
netmask 255.255.255.0
Kod: Zaznacz cały
auto lo eth0
iface lo inet loopback
address 127.0.0.1
netmask 255.0.0.0
iface eth0 inet static
address 160.64.0.3
netmask 255.255.255.0
Kod: Zaznacz cały
#!/bin/sh -e
echo 1 >/proc/sys/net/ipv4/ip_forward
iptables -o ath0 -t nat -A POSTROUTING -s 160.64.0.0/30 -j MASQUERADE
exit 0
Kod: Zaznacz cały
{Internet} ----- (Przełącznik) -----1 sieciówka pod ppp0 i eth1------ (Debian)
|
|
(Windows)
Kod: Zaznacz cały
{Internet} ---------- (Przełącznik) ==2 sieciówki jedna pod ppp0 druga pod eth1 ====== (Debian)
|
|
(Windows)
Kod: Zaznacz cały
auto lo
iface lo inet loopback
auto dsl-provider
iface dsl-provider inet ppp
pre-up /sbin/ifconfig eth0 hw ether 00:a1:b0:a2:8e:27 # zmiana mac'ka na eth0
pre-up /sbin/ifconfig eth0 up
provider dsl-provider
auto eth0
iface eth0 inet manual
Kod: Zaznacz cały
localhost:/etc/network# ifconfig
eth0 Link encap:Ethernet HWaddr 00:a1:b0:a2:8e:27
inet addr:192.168.3.200 Bcast:192.168.3.255 Mask:255.255.255.0
inet6 addr: fe80::2a1:b0ff:fea2:8e27/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:47849 errors:0 dropped:0 overruns:0 frame:0
TX packets:45211 errors:0 dropped:0 overruns:0 carrier:2
collisions:0 txqueuelen:1000
RX bytes:19304710 (18.4 MiB) TX bytes:14901808 (14.2 MiB)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:7701 errors:0 dropped:0 overruns:0 frame:0
TX packets:7701 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:54009460 (51.5 MiB) TX bytes:54009460 (51.5 MiB)
ppp0 Link encap:Point-to-Point Protocol
inet addr:172.16.3.133 P-t-P:172.16.1.1 Mask:255.255.255.255
UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1492 Metric:1
RX packets:28592 errors:0 dropped:0 overruns:0 frame:0
TX packets:28973 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:3
RX bytes:15727294 (14.9 MiB) TX bytes:3617365 (3.4 MiB)