Padekite pakurti Linux Router (isspresta)

Padekite pakurti Linux Router (isspresta)

Labai reikia pasharinti neta per Linux su windows Xp kompu. Pasikuriau DHCP serveri, viskas veikia, IP ishduoda. Bet niekaip negaliu padaryti kad routintu neta. Pas mane linuxe toks config: eth0 - tiesiog network korta per kuria prisijungiu prie neto per pppoe. ppp0 - mano internet connection eth1 - lan’as. IP: 10.0.0.1, Netmask 255.255.255.0, Gateway 10.0.0.1. Mano /etc/sysconfig/iptables

/proc/sys/net/ipv4/ip_forward viskas teisingai, parashyta 1. Su networkingu dar esu visishkai zhalias. Reikia pagalbos.

bl banga ishkraipe configa, nu tikiuosi suprasite Šypsena

echo “1” > /proc/sys/net/ipv4/ip_forward IPTABLES=/sbin/iptables EXTIF=" eth0" INTIF="eth1¨ $IPTABLES -P INPUT ACCEPT $IPTABLES -F INPUT $IPTABLES -P OUTPUT ACCEPT $IPTABLES -F OUTPUT $IPTABLES -P FORWARD DROP $IPTABLES -F FORWARD $IPTABLES -t nat -F $IPTABLES -A FORWARD -i $EXTIF -o $INTIF -m state --state ESTABLISHED,RELATED -j ACCEPT $IPTABLES -A FORWARD -i $INTIF -o $EXTIF -j ACCEPT $IPTABLES -t nat -A POSTROUTING -o $EXTIF -j MASQUERADE Cia jei pastovaus isorinio IP neturi. O ta *bliamba*svta kur virsuje tai istrink. baisu ziureti.

padariau kaip tu sakiai /dev/null, tada mano /etc/sysconfig/iptables atrodo taip:

tachiau vistiek winXP neto nera… kas gali buti netaip?

Pradziai tai, kad jokiai tinklushkei nereik nurodyt gateway. Uzdek INPUT ir OUTPUT i ACCEPT , o pac routinimas vyxta su POSTROUTING ish ppp0 i eth1 … tixliai cmd neacimenu.

bandziau ir eth0 pakeisti i ppp0, vistiek tas pats… gal reikia kur nors add route padaryti?

tai ka daugiau ideju nera?

nu pradziai sakau: INPUT, OUTPUT, FORWARD i ACCEPT sustatyk, o paskui kazkas tokio: iptables -t nat -A POSTROUTING -i ppp0 -o eth1 -j MASQUERADE … nu kazkas tokio Cha cha tau duota pavyzdziu, be to turi manuala - imk ir bandyk.

gal atsirastu jei padarytum ifconfig route iptables -L Ir windowsuose XP ipconfig /all ping 10.0.0.1 ping delfi.lt

o kaip turi atrodyt jeigu kompas turi isorini IP’a? (eth0: pc - inet; eth1: pc - pc) aciu.

$IPTABLES -t nat -A POSTROUTING -o $EXTIF -j MASQUERADE keiciasi i $IPTABLES -t nat -A POSTROUTING -o $EXTIF -j SNAT --to-source ISORINIS_IP

ifconfig eth0 Link encap Piktasthernet HWaddr 52:54:00 Piktas4:08:82 inet6 addr: fe80::5054:ff:fee4:882/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:1903 errors:0 dropped:0 overruns:0 frame:0 TX packets:1912 errors:0 dropped:0 overruns:0 carrier:0 collisions:1 txqueuelen:1000 RX bytes:1361507 (1.2 Mb) TX bytes:255264 (249.2 Kb) Interrupt:11 Base address:0xc000 eth1 Link encap Piktasthernet HWaddr 00:0B:6A Veee3:84:23 inet addr:10.0.0.1 Bcast:10.0.0.255 Mask:255.255.255.0 inet6 addr: fe80::20b:6aff:fef3:8423/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:87 errors:0 dropped:0 overruns:0 frame:0 TX packets:19 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:11923 (11.6 Kb) TX bytes:2213 (2.1 Kb) Interrupt:5 Base address:0x4000 lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 inet6 addr: ::1/128 Scope Apkabinimasost UP LOOPBACK RUNNING MTU:16436 Metric:1 RX packets:88 errors:0 dropped:0 overruns:0 frame:0 TX packets:88 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:5472 (5.3 Kb) TX bytes:5472 (5.3 Kb) ppp0 Link encap Liežuvisoint-to-Point Protocol inet addr:151.202.104.144 P-t-P:10.32.107.1 Mask:255.255.255.255 UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1492 Metric:1 RX packets:1839 errors:0 dropped:0 overruns:0 frame:0 TX packets:1842 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:3 RX bytes:1317139 (1.2 Mb) TX bytes:210402 (205.4 Kb) route Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 10.32.107.1 * 255.255.255.255 UH 0 0 0 ppp0 10.0.0.0 * 255.255.255.0 U 0 0 0 eth1 169.254.0.0 * 255.255.0.0 U 0 0 0 eth1 default 10.32.107.1 0.0.0.0 UG 0 0 0 ppp0 iptables -L Chain INPUT (policy ACCEPT) target prot opt source destination Chain FORWARD (policy DROP) target prot opt source destination ACCEPT all – anywhere anywhere state RELATED,ESTABLISHED ACCEPT all – anywhere anywhere Chain OUTPUT (policy ACCEPT) target prot opt source destination tuoj windowsus papostinsiu…

ipconfig /all Host Name . . . . . . . . . . . . : parents Primary Dns Suffix . . . . . . . : Node Type . . . . . . . . . . . . : Mixed IP Routing Enabled. . . . . . . . : No WINS Proxy Enabled. . . . . . . . : No DNS Suffix Search List. . . . . . : domain.org Ethernet adapter Local Area Connection: Connection-specific DNS Suffix . : domain.org Description . . . . . . . . . . . : HP EN1207D-TX PCI 10/100 Fast Ethernet A apter Physical Address. . . . . . . . . : 00-10-B5-7D-62-37 DHCP Enabled. . . . . . . . . . . : Yes Autoconfiguration Enabled . . . . : Yes IP Address. . . . . . . . . . . . : 10.0.0.254 Subnet Mask . . . . . . . . . . . : 255.255.255.0 Default Gateway . . . . . . . . . : 10.0.0.1 DHCP Server . . . . . . . . . . . : 10.0.0.1 DNS Servers . . . . . . . . . . . : 10.0.0.1 Lease Obtained. . . . . . . . . . : Thursday, August 12, 2004 11:51:23 AM Lease Expires . . . . . . . . . . : Thursday, August 12, 2004 5:51:23 PM C:\Documents and Settings\Administrator> ping 10.0.0.1 Pinging 10.0.0.1 with 32 bytes of data: Reply from 10.0.0.1: bytes=32 time<1ms TTL=64 Reply from 10.0.0.1: bytes=32 time<1ms TTL=64 Reply from 10.0.0.1: bytes=32 time<1ms TTL=64 Reply from 10.0.0.1: bytes=32 time<1ms TTL=64 Ping statistics for 10.0.0.1: Packets: Sent = 4, Received = 4, Lost = 0 (0% loss), Approximate round trip times in milli-seconds: Minimum = 0ms, Maximum = 0ms, Average = 0ms C:\Documents and Settings\Administrator> **ping delfi.lt**C:\Documents and Settings\Administrator>ping delfi.lt Ping request could not find host delfi.lt . Please check the name and try again.

? pala pala ka, ant Linux DNS serveris pakurtas Šypsenapabandyk ping 82.135.156.21

Vienzo susitvarkyk savo DHCP, kad duotu normalius DNS

Mano /etc/dhcpd.conf parashyta: option nis-domain “domain.org”; option domain-name “domain.org”; option domain-name-servers 10.0.0.1; Tipo ash su tais DNS visai zhalias dar, gal galite padeti sutvarkyti man ta DNS? Va kiek zhinau ish mano isp saito: DSL settings * Primary DNS: 4.2.2.1 * Secondary DNS: 4.2.2.2 * Domain: dsl.verizon.net * Network protocol used: TCP/IP Beje dar turiu shitame kompe Windoes 2003 server instalines ir jis viska normaliai routina. Gal ish ten kokiu settings paimti?

option nis-domain “dsl.verizon.net”; option domain-name “dsl.verizon.net”; option domain-name-servers 4.2.2.1;

viskas veikia. Labai aciu /dev/null! Statau virtualaus Alus