network configuration in ubuntu
set hostname
type command
/bin/hostname my_new_hostname
edit files according to your prefered name
/etc/hostname
my_new_hostname
/etc/hosts
1.2.3.4 my_new_hostname
Stop the the host name service
/etc/init.d/hostname.sh stop
Restart the host name service
sudo /etc/init.d/hostname.sh start
Check:
by typing in the command
hostname
associated error: hostname: Unknown Host
if u r connected through a proxy in network
In redhat add following to ur /etc/yum.conf
http://proxy address:port number /
HTTP_PROXY=http://192.168.3.254:8080/
FTP_PROXY=ftp://192.168.3.254:8080/
and for UBUNTU
Edit your /etc/bash.bashrc file as root
export http_proxy=http://username:password@proxyserver:port/
export ftp_proxy=http://username:password@proxyserver:port/
or simply
export http_proxy=http://192.168.3.254:8080/
export ftp_proxy=http://192.168.3.254:8080/
Also
Download the file Link
set executable option and run as root
$ sudo ./file.py proxy port
$ sudo ./file.py -P global.proxy.alcatel-lucent.com 8000
Configuring DHCP address for network card
edit
/etc/network/interfaces
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface for dhcp
auto eth0
iface eth0 inet dhcp
Configuring Static IP address for network card
/etc/network/interfaces
# The primary network interface for staic IP
auto eth0
iface eth0 inet static
address 192.168.3.90
gateway 192.168.3.1
netmask 255.255.255.0
network 192.168.3.0
broadcast 192.168.3.255
restart network service
$ /etc/init.d/networking restart
Setting up DNS
edit
/etc/resolv.conf
search
nameserver
domain
Troubleshooting
ping -c address(-c option is used to pass how many packets u’re sending) :test whether a particular host is reachable across an IP network
traceroute address :determine the route taken by packets across an IP network
ifconfig : tool to configure a network interface for TCP/IP from the command line
route -n:to check routing config
netstat -nral :to see Routing Tables,all open ports,all listen ports
-n: means return numeric output (ie, IP address instead of hostname)
-r: means print the routing table
-a: find all open ports
-l:find listening ports
know ur lan card
$ lspci -v
It will give list of all cards. One can easily find Ethernet controller card