Konfiguracja adresu ip w Gentoo/Sabayonie

Posted by admin on poniedziałek kwietnia 12, 2010 Under Linux, Sabayon

Używanie ifconfig i route

# ifconfig eth0 ${IP_ADDR} broadcast ${BROADCAST} netmask ${NETMASK} up

ustawienie tabeli routingu

# route add default gw ${GATEWAY}

Otwieramy plik /etc/resolv.conf w celu określenia DNS-ów

# nano -w /etc/resolv.conf

nameserver 194.204.152.34
nameserver 194.204.159.1

można oczywiście użyć narzędzia net-setup
# net-setup eth0

Inny sposób
Plik: /etc/conf.d/net

config_eth0=( “192.168.1.101/24″ )
routes_eth0=( “default gw 192.168.1.1″ )

Można także zedytować w ten sposób
Plik: /etc/conf.d/net

config_eth0=( “192.168.1.101 netmask 255.255.255.0 broadcast 192.168.1.255″ )
routes_eth0=( “default gw 192.168.1.1″ )

Wynik polecenia route -n

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.2.1     0.0.0.0         255.255.255.255 UH    0      0        0 eth0
192.168.2.0     0.0.0.0         255.255.255.0   U     0      0        0 eth0
169.254.0.0     0.0.0.0         255.255.0.0     U     1000   0        0 eth0
0.0.0.0         192.168.2.1     0.0.0.0         UG    0      0        0 eth0
0.0.0.0         192.168.2.1     0.0.0.0         UG    0      0        0 eth0

Leave a Reply