Archive for the 'network' Category

09
Dec
09

getting backtrack to work with ics


As far as I know, Backtrack4 pre-final is not one of the distributions that can autoconfigure the Internet access, if you’re connecting through a Windows’s station Internet Connection Sharing. That’s why, a while ago I wrote some scripts to setup that for me. I’m gonna post them here, so that I can have access to them in an easy way, and so that other people could benefit from them. Maybe they’ll help you configure your distro to work with ICS:

Script 1:


import os

target_file = "/etc/network/interfacesx"
fh = open(target_file,"w")

interface_string = """
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
	address 192.168.0.2
	netmask 255.255.255.0
	network 192.168.0.0
	broadcast 192.168.0.255
	gateway 192.168.0.1
"""
fh.write(interface_string)
fh.close() 

and script 2:


resolve_path = "/etc/resolv.conf"
fh = open(resolve_path)
lines = fh.readlines()
fh.close()
fh = open(resolve_path,"w")
for line in lines:
	fh.write("#%s" % line)
fh.write("nameserver 192.168.0.1")
fh.close() 

Run them in any order you please. However, to get the connection to work, you have to also run this:

/etc/init.d/networking restart

25
Sep
09

some tips on getting an internet connection in backtrack linux


If you have a wired internet connection, and want to USE it, here’s what you can do :

  • for pppoe, run pppoeconf as root, and make the necessary settings ( basically, you just need to fill in your username & password, and go with the default for the rest of the settings ). Choose to start the connection then. For some reason, I have to configure it every time the distro starts. Can’t imagine why.
  • for regular cable connection, enable the network interface ( in my case it was eth0 ), by typing the following command:
    ifconfig eth0 up

    and then do:

    dhclient eth0

    This should do the trick ( I tested both these on my computer, and they worked ). For static ip address, you can do this:

    ifconfig eth0 xxx.xxx.xxx.xxx

    and replace the X’s with the actual address. You may need to configure the routes also. See the route command for that.




Blog Stats

  • 218,505 hits