Tak wyglada moja siec
Kod: Zaznacz cały
_______SERVER_______
..eth0......eth1.......eth2....eth3..
....|...........|.............|..............
....|...........|.............|..............
....|...........|.............|..............
...K1.........K2........internet........
na K2 NIE dziala internet i NIE dziala ping do servera
K1 i K2 sa dobrze skonfigurowane bo zamieniajac je miejscami internet dzialal na innych kompach ;]
W skr[u/o]cie siec dziala na eth0 ale juz nie chce dzialac na eth1
Co zrobic zeby dzialal net na eth1?
//Edit: Moze jest w tym blad ze pare kart ma ten sam adres czyli: 192.168.0.1??
Dolaczam kody:
→# ifconfig
→# cat /etc/init.d/maskarada
→# lspci | grep Et
→# cat /etc/network/interfaces
→# ifconfig
Kod: Zaznacz cały
eth0      Link encap:Ethernet  HWaddr 00:0E:2E:9C:73:20  
          inet addr:192.168.0.1  Bcast:192.168.0.255  Mask:255.255.255.0
          inet6 addr: fe80::20e:2eff:fe9c:7320/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:149 errors:0 dropped:0 overruns:0 frame:0
          TX packets:862 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:14272 (13.9 KiB)  TX bytes:64140 (62.6 KiB)
          Interrupt:177 Base address:0xc400 
eth1      Link encap:Ethernet  HWaddr 00:60:52:08:7F:0D  
          inet addr:192.168.0.1  Bcast:192.168.0.255  Mask:255.255.255.0
          inet6 addr: fe80::260:52ff:fe08:7f0d/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1778 errors:0 dropped:0 overruns:0 frame:0
          TX packets:23 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:118626 (115.8 KiB)  TX bytes:2988 (2.9 KiB)
          Interrupt:185 Base address:0xc800 
eth2      Link encap:Ethernet  HWaddr 00:E0:7D:E4:C0:F7  
          inet addr:89.76.62.86  Bcast:255.255.255.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:576  Metric:1
          RX packets:21223 errors:0 dropped:0 overruns:0 frame:0
          TX packets:4949 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:2647005 (2.5 MiB)  TX bytes:458240 (447.5 KiB)
          Interrupt:193 Base address:0xcc00 
eth3      Link encap:Ethernet  HWaddr 00:05:1C:0:D B:D E  
          inet addr:192.168.0.1  Bcast:192.168.0.255  Mask:255.255.255.0
          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:169 Base address:0xc000 
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:73 errors:0 dropped:0 overruns:0 frame:0
          TX packets:73 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:5367 (5.2 KiB)  TX bytes:5367 (5.2 KiB)Kod: Zaznacz cały
#!/bin/sh
case "$1" in
start)
echo 'Wlaczam NAT'
/sbin/iptables -F -t nat
/sbin/iptables -X -t nat
/sbin/iptables -F -t filter
/sbin/iptables -X -t filter
/sbin/iptables -t filter -P FORWARD DROP
/sbin/iptables -t filter -A FORWARD -s 192.168.0.0/24 -d 0/0 -j ACCEPT
/sbin/iptables -t filter -A FORWARD -s 0/0 -d 192.168.0.0/24 -j ACCEPT
/sbin/iptables -t nat -A POSTROUTING -s 192.168.0.0/24 -d 0/0 -j MASQUERADE
;;
stop)
echo 'KoÅczÄ pracÄ Netfiltera'
/sbin/iptables -F -t nat
/sbin/iptables -F -t filter
;;
*)
echo 'UÅźycie: /etc/init.d/maskarada {start|stop}'
exit 1
;;
esac
exit 0Kod: Zaznacz cały
00:0a.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL-8139/8139C/8139C+ (rev 10)
00:0b.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL-8139/8139C/8139C+ (rev 10)
00:0c.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL-8139/8139C/8139C+ (rev 10)
00:0d.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL-8139/8139C/8139C+ (rev 10)Kod: Zaznacz cały
# 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
# The primary network interface
allow-hotplug eth2
auto eth2
iface eth2 inet dhcp
auto eth0
iface eth0 inet static
        address 192.168.0.1
        netmask 255.255.255.0
auto eth1
iface eth1 inet static
        address 192.168.0.1
        netmask 255.255.255.0
auto eth3
iface eth3 inet static
        address 192.168.0.1
        netmask 255.255.255.0