Configurar xarxa
De Guifi.net - Wiki Català
Per a configurar manualment la xarxa hem de assegurar-nos que si el sistema té entorn gràfic (gnome), d'aturar el network-manager:
# service network-manager stop
i deshabilitar-lo perquè no s'engegui al iniciar-se
# sysv-rc-conf
buscar network-manager i deshabilitar-lo.
En el cas que el nostre sistema no tingui entorn gràfic directament el què haurem de fer és modificar el fitxer /etc/network/interfaces i definir així la configuració de xarxa
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet static
address 192.168.1.7
netmask 255.255.255.0
gateway 192.168.1.1
En el cas que tinguem un servidor amb una sola interfície de xarxa, crearem una interfície virtual (eth0:1) per a assignar-li una ip de guifi
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet static
address 192.168.1.7
netmask 255.255.255.0
gateway 192.168.1.1
auto eth0:1
iface eth0:1 inet static
address 10.228.192.210
netmask 255.255.255.248
up route add -net 10.0.0.0 netmask 255.0.0.0 gw 10.228.192.209
Si tinguéssim 2 interfícies de xarxa ho hauriem de fer així
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet static
address 192.168.1.7
netmask 255.255.255.0
gateway 192.168.1.1
auto eth1
iface eth1 inet static
address 10.228.192.210
netmask 255.255.255.248
up route add -net 10.0.0.0 netmask 255.0.0.0 gw 10.228.192.209 dev eth1