Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[Conf] Salvare configurazione di rete [RISOLTO]
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Forum italiano (Italian)
View previous topic :: View next topic  
Author Message
alexio2ky
Apprentice
Apprentice


Joined: 25 Jun 2004
Posts: 199

PostPosted: Wed Jul 14, 2004 4:46 pm    Post subject: [Conf] Salvare configurazione di rete [RISOLTO] Reply with quote

Ciao a tutti,

(non sono riuscito a trovare sul forum risposta a questo)
con una rete di 2 pc nel cmputer principale volevo salvare questa configurazione:

ifconfig eth1 192.168.0.2 netmask 255.255.255.0 up
iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE
echo 1 > /proc/sys/net/ipv4/ip_forward

in quale file và fatto il salvataggio e come? in /etc/rc.conf/net??

Grazie,
Alessio


Last edited by alexio2ky on Thu Jul 15, 2004 10:14 am; edited 2 times in total
Back to top
View user's profile Send private message
fedeliallalinea
Administrator
Administrator


Joined: 08 Mar 2003
Posts: 31449
Location: here

PostPosted: Wed Jul 14, 2004 5:07 pm    Post subject: Reply with quote

Si per quello che rigarda ifconfig il file e' /etc/conf.d/net per la regola di iptables c'era un file se non sbaglio ma non ricordo quale
_________________
Questions are guaranteed in life; Answers aren't.
Back to top
View user's profile Send private message
alexio2ky
Apprentice
Apprentice


Joined: 25 Jun 2004
Posts: 199

PostPosted: Wed Jul 14, 2004 5:49 pm    Post subject: Reply with quote

per iptables in /etc/conf.d/ c'è proprio il file 'iptables' che nel mio caso è:

# Location in which iptables initscript will save set rules on
# service shutdown
IPTABLES_SAVE="/var/lib/iptables/rules-save"

#Options to pass to iptables-save and iptables-restore
SAVE_RESTORE_OPTIONS="-c"

quindi credo che il file sia: /var/lib/iptables/rules-save

per

echo 1 > /proc/sys/net/ipv4/ip_forward

credo invece sia il file:

/etc/sysctl.conf

e modificare -> net.ipv4.ip_forward = 1

Alessio
Back to top
View user's profile Send private message
alexio2ky
Apprentice
Apprentice


Joined: 25 Jun 2004
Posts: 199

PostPosted: Thu Jul 15, 2004 7:35 am    Post subject: Reply with quote

ho risolto così:

per "echo 1 > /proc/sys/net/ipv4/ip_forward":
nel file /etc/sysctl.conf mettere -> net.ipv4.ip_forward = 1


per "ifconfig eth1 192.168.0.2 netmask 255.255.255.0 up":
nel file /etc/conf.d/net mettere
iface_eth1="192.168.0.2 broadcast 192.168.0.255 netmask 255.255.255.0"
e poi
# cd /etc/init.d
# ln -s net.eth0 net.eth1
# rc-update add net.eth1 default


infine per iptables:
# rc-update add iptables default

e nel file /etc/init.d/iptables alla fine della funzione start() aggiungere:
/sbin/iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE

però quest'ultimo punto mi lascia un pò in dubbio. Ho provato a lanciare il comando da shell e poi fare iptables-save, ma non mi salva nulla e quindi sono stato drastico come sopra. Idee per quest'ultimo punto?

Alessio
Back to top
View user's profile Send private message
makoomba
Bodhisattva
Bodhisattva


Joined: 03 Jun 2004
Posts: 1856

PostPosted: Thu Jul 15, 2004 10:02 am    Post subject: Reply with quote

alexio2ky wrote:
però quest'ultimo punto mi lascia un pò in dubbio. Ho provato a lanciare il comando da shell e poi fare iptables-save, ma non mi salva nulla e quindi sono stato drastico come sopra. Idee per quest'ultimo punto?

iptables-save non scrive su file, devi redirigere l'output.
+ semplicemente :
Code:

/etc/init.d/iptables save
Back to top
View user's profile Send private message
alexio2ky
Apprentice
Apprentice


Joined: 25 Jun 2004
Posts: 199

PostPosted: Thu Jul 15, 2004 10:13 am    Post subject: Reply with quote

grazie :) funziona

Alessio
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Forum italiano (Italian) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum