Code Listing 3.11: Using ifconfig |
# ifconfig eth0 ${IP_ADDR} broadcast ${BROADCAST} netmask ${NETMASK} up |
Code Listing 3.12: Using route |
# route add default gw ${GATEWAY} |
Code Listing 3.13: Creating /etc/resolv.conf |
# nano -w /etc/resolv.conf |
Code Listing 3.14: /etc/resolv.conf template |
nameserver ${NAMESERVER1} nameserver ${NAMESERVER2} |
Also if you want to connect trough wifi, use this wiki:
- Connecting to an OPEN / WEP WLAN (DHCP)
iwconfig yourinterface mode managed key yourwepkey
(128 bit WEP use 26 hex characters, 64 bit WEP uses 10)iwconfig yourinterface essid youressid
(Specify ESSID for the WLAN)dhclient yourinterface
(to receive an IP address, netmask, DNS server and default gateway from the Access Point)
- Connecting to an OPEN / WEP WLAN (Manual IP Setup)
iwconfig
yourinterface
mode managed key
yourwepkey
(128 bit WEP use 26 hex characters, 64 bit WEP uses 10)iwconfig yourinterface essid youressid (Specify ESSID for the WLAN)
ifconfig yourinterface youripaddress netmask yoursubnetmask
route add default gw yourgateway
(Configure your default gateway; usually the IP of the Access Point)echo nameserver yourdnsserver >> /etc/resolve.conf
(Configure your DNS server)
ifconfig [interface] up (bring up specified interface)
ifconfig [interface] down (take down specified interface)
ifconfig [interface] hw ether [MAC] (Change the wireless cards MAC address, specify in format 11:11:11:11:11:11)
And finally, you can try this, if you want to automate the process.