Visualizzazione dei risultati da 1 a 4 su 4
  1. #1

    condivisione connessione....

    lo so che l'argomento e' stato trattato e ritrattato... ma io non sono ancora riuscito a venirne fuori....
    dunque:
    macchina linux:
    eth0 (ip 192.168.1.245) collegata a router adsl (ip 192.168.1.1)
    eth1 (ip 192.168.1.244) collegata allo switch

    route:

    Kernel IP routing table
    Destination Gateway Genmask Flags Metric Ref Use Iface
    RTA230.home * 255.255.255.255 UH 0 0 0 eth0
    192.168.1.0 * 255.255.255.0 U 0 0 0 eth1
    192.168.1.0 * 255.255.255.0 U 0 0 0 eth1
    169.254.0.0 * 255.255.0.0 U 0 0 0 eth1
    127.0.0.0 * 255.0.0.0 U 0 0 0 lo
    default RTA230.home 0.0.0.0 UG 0 0 0 eth0


    [root@server root]# iptables -L
    Chain INPUT (policy ACCEPT)
    target prot opt source destination
    LOG all -- !192.168.1.0/24 anywhere LOG level warning
    DROP all -- !192.168.1.0/24 anywhere
    DROP all -- 127.0.0.0/8 anywhere
    ACCEPT all -- anywhere anywhere
    ACCEPT tcp -- 10.0.0.2 anywhere tcp dpt:http
    ACCEPT tcp -- 10.0.0.2 192.168.1.0/24 state RELATED,ESTABLISHED tcp spt:http
    ACCEPT !icmp -- anywhere anywhere state RELATED,ESTABLISHED
    DROP all -- anywhere anywhere state NEW
    ACCEPT all -- 192.168.1.0/24 anywhere
    ACCEPT icmp -- anywhere 10.0.0.1 icmp echo-reply
    ACCEPT icmp -- anywhere 10.0.0.1 icmp echo-request
    ACCEPT icmp -- anywhere 10.0.0.1 icmp destination-unreachable
    ACCEPT all -- 192.168.1.0/24 anywhere

    Chain FORWARD (policy ACCEPT)
    target prot opt source destination
    LOG all -- !192.168.1.0/24 anywhere LOG level warning
    DROP all -- !192.168.1.0/24 anywhere
    DROP all -- anywhere anywhere state NEW

    Chain OUTPUT (policy ACCEPT)
    target prot opt source destination
    DROP tcp -- anywhere 192.168.1.0/24 state NEW tcp spt:http


    macchina windows xp professional:

    ip: 192.168.1.2
    nm: 255.255.255.0
    gw: li ho provati tutti... dagli indirizzi delle schede del pc linux al 192.168.1.1

    dal pc linux navigo e vedo la rete, ma dal resto della rete vedo solo il pc linux e non riesco a navigare....

    dove sbaglio???

  2. #2
    prova così:
    etho --> router 192.168.1.2 (router 192.168.1.1)
    eth1 --> lan 192.168.2.1 (client 192.168.2.x gw 192.168.2.1)

    Dopo sulla macchina linux dai questi comandi:
    echo 1 > /proc/sys/net/ipv4/ip_forward

    iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

    prima attiva questi moduli:
    ip_conntrack
    ipt_state
    iptable_filter
    ipt_MASQUERADE
    iptable_nat
    ip_tables

  3. #3
    Utente bannato
    Registrato dal
    Mar 2001
    Messaggi
    1,144
    non mi tornano troppo le regole sulla FORWARD CHAIN

    DROP all -- anywhere anywhere state NEW

    dovresti forwardare in uscita almeno i DNS e la porta 80, per navigare

  4. #4

    prova cosi

    prova cosi:
    il server ha due schede di rete eth0 e eth1

    il router deve avere ip 192.168.0.1
    eth0 deve avere ip 192.168.0.2
    eth1 invece deve avere ip 192.168.1.1

    quindi sul server digita:

    ifconfig eth0 192.168.0.2
    route add defalut gw 192.168.0.1

    e con questo hai sistemato il server che dovrebbe navigare tranquillo...

    una volta fatto questo
    digita:

    iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

    e abilita l'ip forwarding

    una volta fatto tutto ciò configura i client devono avere ip della serie 192.168.1.x
    e il router deve essere 192.168.1.1

    io l'ho fatto cosi è funziona benissimo D se hai problemi non esitare a chiedere

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2024 vBulletin Solutions, Inc. All rights reserved.