eth0 - do kompa1 (192.168.0.2)
eth1 - do kompa2 (192.168.0.3)
eth2 - tu przychodzi do mnie internet
Mam 2 adresy ip:
a) 192.168.0.1 dla eth0 i eth1
b) przydzielony przez DHCP przez chello dla eth2 - (to juz mam skonfigurowane)
jak mam udostepnic neta na eth0 i eth1
Czyli na komp1 i komp2 ?
/etc/init.d/udostepnianie
Kod: Zaznacz cały
echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -A POSTROUTING -s 192.168.0.0/24 -j MASQUERADE -t nat
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
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:0xd000
eth1 Link encap:Ethernet HWaddr 00:60:52:08:7F:0D
inet addr:192.168.0.12 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:562 errors:0 dropped:0 overruns:0 frame:0
TX packets:24 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:39130 (38.2 KiB) TX bytes:3041 (2.9 KiB)
Interrupt:177 Base address:0xd400
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:50480 errors:0 dropped:0 overruns:0 frame:0
TX packets:16281 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:15033524 (14.3 MiB) TX bytes:1413268 (1.3 MiB)
Interrupt:185 Base address:0xd800
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:773 errors:0 dropped:0 overruns:0 frame:0
TX packets:773 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:26147 (25.5 KiB) TX bytes:26147 (25.5 KiB)
/etc/resolv.conf
Kod: Zaznacz cały
# generated by NetworkManager, do not edit!
search chello.pl
nameserver 62.179.1.60
nameserver 62.179.1.61
Kod: Zaznacz cały
#
# /etc/sysctl.conf - Configuration file for setting system variables
# See sysctl.conf (5) for information.
#
#kernel.domainname = example.com
#net/ipv4/icmp_echo_ignore_broadcasts=1
# Uncomment the following to stop low-level messages on console
#kernel.printk = 4 4 1 7
##############################################################3
# Functions previously found in netbase
#
# Uncomment the next line to enable Spoof protection (reverse-path filter)
#net.ipv4.conf.default.rp_filter=1
# Uncomment the next line to enable TCP/IP SYN cookies
#net.ipv4.tcp_syncookies=1
# Uncomment the next line to enable packet forwarding for IPv4
#net.ipv4.conf.default.forwarding=1
# Uncomment the next line to enable packet forwarding for IPv6
#net.ipv6.conf.default.forwarding=1
No i tak ja moge sie pingnac (192.168.0.1), ale nioe moge pignac innych kompow
Komp 1 moze mnie pingnac
Komp 2 nie moze.
Co zrobic zeby te 2 kompy mialy dostep do netu?
//Edit
nic sie nie zmienia nawet jak odhaszuje net.ipv4.conf.default.forwarding=1 w (/etc/sysctl.conf)
[ Dodano: 2007-04-23, 15:34 ]
Kod: Zaznacz cały
1 # This file describes the network interfaces available on your system
2 # and how to activate them. For more information, see interfaces(5).
3
4 # The loopback network interface
5 auto lo
6 iface lo inet loopback
7
8 # The primary network interface
9 allow-hotplug eth2
10 auto eth2
11 iface eth2 inet dhcp
12
13 auto eth0
14 iface eth0 inet static
15 address 192.168.0.1
16 netmask 255.255.255.0
17 network 192.168.0.0
18 broadcast 192.168.0.255
19
20 auto eth1
21 iface eth1 inet static
22 address 192.168.0.12
23 netmask 255.255.255.0
24 network 192.168.0.0
25 broadcast 192.168.0.255