Portál AbcLinuxu, 30. prosince 2025 10:50
root@notebook# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
localnet * 255.0.0.0 U 0 0 0 eth0
loopback * 255.0.0.0 U 0 0 0 lo
default 10.0.0.50 0.0.0.0 UG 1 0 0 eth0
root@notebook# ifconfig
eth0 Link encap:Ethernet HWaddr 00:30:4F:29:37:5E
inet addr:10.0.0.200 Bcast:10.255.255.255 Mask:255.0.0.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:130 errors:0 dropped:0 overruns:0 frame:0
TX packets:1549 errors:0 dropped:0 overruns:0 carrier:0
collisions:13 txqueuelen:100
RX bytes:11780 (11.5 Kb) TX bytes:96458 (94.1 Kb)
Interrupt:11 Base address:0xb000
Router
root@router# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
10.0.0.200 * 255.255.255.255 UH 0 0 0 eth1
localnet * 255.0.0.0 U 0 0 0 eth0
localnet * 255.0.0.0 U 0 0 0 eth1
loopback * 255.0.0.0 U 0 0 0 lo
default speedtouch.hack 0.0.0.0 UG 1 0 0 eth0
root@router# ifconfig
eth0 Link encap:Ethernet HWaddr 00:0D:88:4E:25:52
inet addr:10.0.0.3 Bcast:10.255.255.255 Mask:255.0.0.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:2576 errors:0 dropped:0 overruns:0 frame:0
TX packets:1519 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:2838679 (2.7 Mb) TX bytes:99547 (97.2 Kb)
Interrupt:12 Base address:0xcc00
eth1 Link encap:Ethernet HWaddr 00:10:5A:30:5F:04
inet addr:10.0.0.50 Bcast:10.255.255.255 Mask:255.0.0.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1541 errors:0 dropped:0 overruns:0 frame:0
TX packets:118 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:96146 (93.8 Kb) TX bytes:10956 (10.6 Kb)
Interrupt:11 Base address:0xc000
root@router# iptables -t nat -L
Chain PREROUTING (policy ACCEPT)
target prot opt source destination
Chain POSTROUTING (policy ACCEPT)
target prot opt source destination
MASQUERADE all -- anywhere anywhere
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
Server
root@server# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
localnet * 255.0.0.0 U 0 0 0 eth0
loopback * 255.0.0.0 U 0 0 0 lo
default speedtouch.hack 0.0.0.0 UG 1 0 0 eth0
root@server# ifconfig
eth0 Link encap:Ethernet HWaddr 00:C0:4F:7E:6F:26
inet addr:10.0.0.100 Bcast:10.255.255.255 Mask:255.0.0.0
inet6 addr: fe80::2c0:4fff:fe7e:6f26/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:7344585 errors:0 dropped:0 overruns:0 frame:0
TX packets:10379994 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1409251403 (1343.9 Mb) TX bytes:4185272519 (3991.3 Mb)
Interrupt:12 Base address:0xdc00
root@server# iptables -L
Chain INPUT (policy ACCEPT)
target prot opt source destination
LOG all -- anywhere anywhere LOG level debug prefix `BANDWIDTH_IN:'
ACCEPT all -- localnet/24 anywhere
ACCEPT tcp -- anywhere anywhere tcp dpt:ftp
ACCEPT tcp -- anywhere anywhere tcp dpt:domain
ACCEPT tcp -- anywhere anywhere tcp dpt:http
ACCEPT tcp -- anywhere anywhere tcp dpt:https
ACCEPT tcp -- anywhere anywhere tcp dpt:8000
REJECT tcp -- anywhere anywhere tcp dpt:auth reject-with icmp-host-unreachable
REJECT tcp -- !localnet/24 anywhere tcp multiport dports netbios-ns,netbios-dgm,netbios-ssn,microsoft-ds reject-with icmp-net-unreachable
Chain FORWARD (policy ACCEPT)
target prot opt source destination
LOG all -- anywhere anywhere LOG level debug prefix `BANDWIDTH_OUT:'
LOG all -- anywhere anywhere LOG level debug prefix `BANDWIDTH_IN:'
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
LOG all -- anywhere anywhere LOG level debug prefix `BANDWIDTH_OUT:'
Vsechny politiky jsou nastaveny na ACCEPT. Predem dik za jakoukoliv odpoved
route použít 'ip route' nebo aspoň 'route -n', těžko hádat, co je u vás localnet (asi 10.0.0.0/24, ale kdo ví). Problém bude ale asi nejspíš v tom, že používáte na dvou segmentech stejný rozsah adres. To je sice v zásadě možné, ale začátečníkovi bych to rozhodně nedoporučil, protože ukonfigurovat to není úplně triviální.
Tiskni
Sdílej:
ISSN 1214-1267, (c) 1999-2007 Stickfish s.r.o.