February 15

Linux: Backtrack networking options including autostart

Note: Commands listed should be run as root or with sudo (switch user do) command.

Enter the following command to enable or start your networking in BackTrack
/etc/init.d/networking start

This command will start all the interfaces in the /etc/network/interfaces file.

Below are more information in how to enable or start networking in Backtrack.

Setting your interfaces to get ip addresses via DHCP.
See my sample /etc/network/interfaces file.

root@wiztechie:~# cat /etc/network/interfaces
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet dhcp

auto eth1
iface eth1 inet dhcp

auto ath0
iface ath0 inet dhcp

auto wlan0
iface wlan0 inet dhcp

Setting your interfaces manually or having static ip addresses.
See my sample /etc/network/interfaces file.

auto eth0
iface eth0 inet static
address 192.168.0.100
netmask 255.255.255.0
network 192.168.0.0
broadcast 192.168.0.255
gateway 192.168.0.1

Setting up your nameserver.
See my sample /etc/resolv.conf file.

root@wiztechie:~# cat /etc/resolv.conf
nameserver 192.168.0.1

If you only want specific interfaces to get ip address via the DHCP (in this example, let’s say eth0 and wlan0 only) then remove every thing else for the file with the exception of the lo interface.
See my sample /etc/network/interfaces file.
Note: Backup first your /etc/network/interfaces file if you’re having some doubt with what you are doing, in this way you can revert back to the original file. To do this enter cp /etc/network/interfaces /etc/network/interfaces.bak (this create a backup of the /etc/network/interfaces file)

root@wiztechie:~# cat /etc/network/interfaces
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet dhcp

auto wlan0
iface wlan0 inet dhcp

If you want to autostart or run this at startup, enter the command.

update-rc.d networking defaults


Copyright 2021. All rights reserved.

Posted February 15, 2012 by Timothy Conrad in category "Linux

About the Author

If I were to describe myself with one word it would be, creative. I am interested in almost everything which keeps me rather busy. Here you will find some of my technical musings. Securely email me using - PGP: 4CB8 91EB 0C0A A530 3BE9 6D76 B076 96F1 6135 0A1B