Десктоп имеет 2 сетевые карточки: одна для локальной сети и интернет (eth0/pppoe), другая для соеденинея с ноутбуком (средствами кроссовера) (eth2).
Надо раздать интернет и локальную сеть ноутбуку.
Локальную сеть раздать надо обязательно, поскольку в ней находятся dns-сервера.
(в iptables вписал:
Код: Выделить всё
iptables -t nat -A POSTROUTING -s 192.168.0.0/24 -o dsl0 -j MASQUERADE
iptables -t nat -A POSTROUTING -s 192.168.0.0/24 -o eth0 -j MASQUERADEДанные:
Код: Выделить всё
# cat /etc/resolv.conf
search homenet.loc
nameserver 10.10.0.1
nameserver 10.10.0.2Код: Выделить всё
# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
as.glazov-homen * 255.255.255.255 UH 0 0 0 dsl0
192.168.0.0 * 255.255.255.0 U 0 0 0 eth2
10.16.0.0 * 255.255.0.0 U 0 0 0 eth0
205.188.0.0 host-16-0-1.hom 255.255.0.0 UG 0 0 0 eth0
link-local * 255.255.0.0 U 0 0 0 eth0
64.12.0.0 host-16-0-1.hom 255.255.0.0 UG 0 0 0 eth0
192.168.0.0 host-16-0-1.hom 255.255.0.0 UG 0 0 0 eth0
10.0.0.0 host-16-0-1.hom 255.0.0.0 UG 0 0 0 eth0
loopback * 255.0.0.0 U 0 0 0 lo
default * 0.0.0.0 U 0 0 0 dsl0Код: Выделить всё
# ifconfig
dsl0 Link encap:Point-to-Point Protocol
inet addr:91.215.17.169 P-t-P:91.215.16.5 Mask:255.255.255.255
UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1492 Metric:1
RX packets:443 errors:0 dropped:0 overruns:0 frame:0
TX packets:411 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:3
RX bytes:410766 (401.1 Kb) TX bytes:46221 (45.1 Kb)
eth0 Link encap:Ethernet HWaddr 00:21:91:8A:59:02
inet addr:10.16.6.15 Bcast:10.16.255.255 Mask:255.255.0.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:252018 errors:0 dropped:0 overruns:0 frame:0
TX packets:13671 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:52427654 (49.9 Mb) TX bytes:1355702 (1.2 Mb)
Interrupt:22
eth1 Link encap:Ethernet HWaddr 00:50:8D:68:8C:55
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:18 Base address:0x8000
eth2 Link encap:Ethernet HWaddr 00:E0:51:6E:00:E6
inet addr:192.168.0.1 Bcast:192.168.0.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:725 errors:3 dropped:46 overruns:3 frame:0
TX packets:72 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:242032 (236.3 Kb) TX bytes:13694 (13.3 Kb)
Interrupt:17 Base address:0xe000
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:70 errors:0 dropped:0 overruns:0 frame:0
TX packets:70 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:6076 (5.9 Kb) TX bytes:6076 (5.9 Kb)Код: Выделить всё
# cat /etc/sysctl.conf
# Disable response to broadcasts.
# You don't want yourself becoming a Smurf amplifier.
net.ipv4.icmp_echo_ignore_broadcasts = 1
# enable route verification on all interfaces
net.ipv4.conf.all.rp_filter = 1
# enable ipV6 forwarding
#net.ipv6.conf.all.forwarding = 1
# increase the number of possible inotify(7) watches
fs.inotify.max_user_watches = 65536
# avoid deleting secondary IPs on deleting the primary IP
net.ipv4.conf.default.promote_secondaries = 1
net.ipv4.conf.all.promote_secondaries = 1
net.ipv4.ip_forward = 1Код: Выделить всё
# iptables -L
Chain INPUT (policy DROP)
target prot opt source destination
ACCEPT all -- anywhere anywhere
ACCEPT all -- anywhere anywhere state ESTABLISHED
ACCEPT icmp -- anywhere anywhere state RELATED
input_ext all -- anywhere anywhere
input_ext all -- anywhere anywhere
input_ext all -- anywhere anywhere
input_ext all -- anywhere anywhere
input_ext all -- anywhere anywhere
LOG all -- anywhere anywhere limit: avg 3/min burst 5 LOG level warning tcp-options ip-options prefix `SFW2-IN-ILL-TARGET '
DROP all -- anywhere anywhere
Chain FORWARD (policy DROP)
target prot opt source destination
LOG all -- anywhere anywhere limit: avg 3/min burst 5 LOG level warning tcp-options ip-options prefix `SFW2-FWD-ILL-ROUTING '
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
ACCEPT all -- anywhere anywhere
ACCEPT all -- anywhere anywhere state NEW,RELATED,ESTABLISHED
LOG all -- anywhere anywhere limit: avg 3/min burst 5 LOG level warning tcp-options ip-options prefix `SFW2-OUT-ERROR '
Chain forward_ext (0 references)
target prot opt source destination
Chain input_ext (5 references)
target prot opt source destination
DROP all -- anywhere anywhere PKTTYPE = broadcast
ACCEPT icmp -- anywhere anywhere icmp source-quench
ACCEPT icmp -- anywhere anywhere icmp echo-request
LOG tcp -- anywhere anywhere limit: avg 3/min burst 5 tcp dpt:ssh flags:FIN,SYN,RST,ACK/SYN LOG level warning tcp-options ip-options prefix `SFW2-INext-ACC-TCP '
ACCEPT tcp -- anywhere anywhere tcp dpt:ssh
DROP all -- anywhere anywhere PKTTYPE = multicast
DROP all -- anywhere anywhere PKTTYPE = broadcast
LOG tcp -- anywhere anywhere limit: avg 3/min burst 5 tcp flags:FIN,SYN,RST,ACK/SYN LOG level warning tcp-options ip-options prefix `SFW2-INext-DROP-DEFLT '
LOG icmp -- anywhere anywhere limit: avg 3/min burst 5 LOG level warning tcp-options ip-options prefix `SFW2-INext-DROP-DEFLT '
LOG udp -- anywhere anywhere limit: avg 3/min burst 5 state NEW LOG level warning tcp-options ip-options prefix `SFW2-INext-DROP-DEFLT '
DROP all -- anywhere anywhere
Chain reject_func (0 references)
target prot opt source destination
REJECT tcp -- anywhere anywhere reject-with tcp-reset
REJECT udp -- anywhere anywhere reject-with icmp-port-unreachable
REJECT all -- anywhere anywhere reject-with icmp-proto-unreachableP.S. Связь между компьютерами есть, оба "видят" друг друга