Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- network ip address settings in /etc/network/interfaces:
- sudo nano /etc/network/interfaces
- to start interface on startup:
- auto eth0
- static ip sample:
- iface eth0 inet static
- address 192.168.1.5
- netmask 255.255.255.0
- broadcast 192.168.1.255
- network 192.168.1.0
- gateway 192.168.1.254
- dhcp ip sample:
- iface eth0 inet dhcp
- to change hosts settings, edit /etc/hosts:
- sudo nano /etc/hosts
- to change hostname, edit /etc/hostname:
- sudo nano /etc/hostname
- to change dns resolution settings, edit /etc/resolv.conf
- sudo nano /etc/resolv.conf
- add dns server ip address:
- nameserver 8.8.8.8
- nameserver 8.8.4.4
- to turn off interface:
- sudo ifdown eth0
- to turn on interface:
- sudo ifup eth0
- to list active interface ip address:
- ifconfig
- to list all(active/inactive) interface ip address:
- ifconfig -a
- to restart network service:
- sudo /etc/init.d/networking restart
- to list used ports:
- netstat -an |more
- or
- netstat -an |less
- if you are using desktop and you want to use the network config files instead of the network manager:
- sudo apt-get remove network-manager network-manager-gnome
- after removing network manager, when you have problems with dns resolution from /etc/resolv.conf then dns ip and dns search in the interfaces file:
- dns-nameservers 8.8.8.8 8.8.4.4
- dns-search yourdomain.com
- ===================================================================================================
- Wireless adapter or card:
- wireless uitlities:
- sudo apt-get install wireless-tools
- to use windows wireless driver in ubuntu:
- verify the ndiswrapper-utils version before install:
- sudo apt-cache search ndiswrapper-utils
- install ndiswrapper:
- sudo apt-get install ndiswrapper-common ndiswrapper-utils-1.9
- Copy .INF and .SYS files from driver:
- Install Driver:
- sudo ndiswrapper -i driver-name.inf
- Verify if Driver is installed:
- ndiswrapper -l
- install ndiswrapper driver:
- sudo modprobe ndiswrapper
- Verify wireless interface:
- iwconfig
- Make sure your driver get loaded each time you boot your computer:
- sudo ndiswrapper -m
- config in /etc/network/interfaces:(using WEP)
- auto wlan0
- iface wlan0 inet dhcp
- wireless-essid mywifi
- wireless-key 0123456789ABCDEF0123456789
- wireless-channel 11
- wireless-mode managed
- Use WPA and WPA2:
- install wpasupplicant:
- sudo apt-get install wpasupplicant wpagui
- scan your network:
- sudo iwlist wlan0 scan
- Configure Wireless card for WPA authentication:
- sudo nano /etc/wpa_supplicant.conf
- add in the config file:
- network={
- ssid="YOUR-NETWORK-ESSID"
- proto=WPA
- key_mgmt=WPA-PSK
- pairwise=TKIP
- group=TKIP
- psk="YOUR-PASSWORD"
- }
- Configure Wireless card for WPA2 authentication:
- sudo nano /etc/wpa_supplicant.conf
- add in the config file:
- network={
- ssid="YOUR-NETWORK-ESSID"
- proto=RSN
- key_mgmt=WPA-PSK
- pairwise=CCMP TKIP
- group=CCMP TKIP
- psk="YOUR-PASSWORD"
- }
- Connect to network:
- sudo wpa_supplicant -d -c/etc/wpa_supplicant.conf -iwlan0 -Dwext
- assign IP address using DHCP:
- sudo ifconfig wlan0 up
- sudo dhclient wlan0
- If every thing works as expected, you can start wpa_supplicant without -d option i.e replace -d by -B for the deamon mode:
- sudo wpa_supplicant -B -c/etc/wpa_supplicant.conf -iwlan0 -Dwext
- ===================================================================================================
- assign IP Address to a specific interface (eth1) on the fly:
- sudo ip addr add 192.168.50.5 dev eth1
- check ip address:
- sudo ip addr show
- remove an assigned IP address from the given interface (eth1):
- sudo ip addr del 192.168.50.5/24 dev eth1
- enables a network interface:
- sudo ip link set eth1 up
- disables a network interface:
- sudo ip link set eth1 down
- check the routing table:
- sudo ip route show
- add Static routes:
- sudo ip route add 10.10.20.0/24 via 192.168.50.100 dev eth0
- remove assigned static route:
- sudo ip route del 10.10.20.0/24
- add the persistence Static routes:
- sudo nano /etc/network/interfaces
- ---------------------------------
- auto eth0
- iface eth0 inet static
- address 192.168.50.2
- netmask 255.255.255.0
- gateway 192.168.50.100
- #########{Static Route}###########
- up ip route add 10.10.20.0/24 via 192.168.50.100 dev eth0
- ----------------------------------
- add default gateway on the fly:
- sudo ip route add default via 192.168.50.100
- create virtual network interface:
- sudo gedit /etc/network/interfaces
- ----------------------------------
- auto eth0
- iface eth0 static
- address 192.168.x.x
- netmask 255.255.x.x
- gateway 291.168.x.x
- auto eth0:0
- iface eth0:0 static
- address 192.168.xx.xx
- netmask 255.255.xx.xx
- gateway 192.168.xx.xx
- ----------------------------------
Advertisement
Add Comment
Please, Sign In to add comment