Witam, mam problemy z udostępnieniem internetu: niby wszystko jest ok - ale jednak.
root@pc:~# ifconfig
eth0 Link encap:Ethernet HWaddr 00:D0:09:63:92:D3
inet addr:192.168.1.16 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::2d0:9ff:fe63:92d3/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:148 errors:0 dropped:0 overruns:0 frame:0
TX packets:105 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:20502 (20.0 KiB) TX bytes:15845 (15.4 KiB)
Interrupt:11 Base address:0xd400
eth1 Link encap:Ethernet HWaddr 00:06:4F:00:72:FE
inet addr:192.168.2.1 Bcast:192.168.2.255 Mask:255.255.255.0
inet6 addr: fe80::206:4fff:fe00:72fe/64 Scope:Link
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
Interrupt:3 Base address:0xaf00
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:2 errors:0 dropped:0 overruns:0 frame:0
TX packets:2 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:100 (100.0 b) TX bytes:100 (100.0 b)
Plik /etc/network/interfaces
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
allow-hotplug eth0
iface eth0 inet dhcp
# LAN
allow-hotplug eth1
iface eth1 inet static
address 192.168.2.1
netmask 255.255.255.0
network 192.168.2.0
broadcast 192.168.2.255
A to plik, który udostępnia internet z eth0
echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -t nat -A POSTROUTING -o eth0 -j SNAT --to-source 192.168.1.16
Jednak po uruchomieniu go wyświetla się:
host:/etc/network# /etc/init.d/firewall
: Nie ma takiego pliku ani katalogu/sys/net/ipv4/ip_forward
'ptables v1.3.6: Bad IP address `192.168.1.18
Try `iptables -h' or 'iptables --help' for more information.