Showing posts with label netmask. Show all posts
Showing posts with label netmask. Show all posts

12 March, 2013

Manually assign (add) fixed (static) IP on FreeBSD


Manually assign/add fixed/static IP on FreeBSD:
 
ifconfig em0 inet  netmask 
route add default 
/etc/netstart

e.g.

ifconfig em0 inet 192.168.0.10 netmask 255.255.255.0
route add default 192.168.0.1
/etc/netstart

Make changes permanently :
As an example of the above, insert the below parameters into /etc/rc.conf :

ifconfig_em0="inet 192.168.0.10 netmask 255.255.255.0"
defaultrouter="192.168.0.1"
hostname="hostname.domain.com"

Remove assigned IP address from network interface

ifconfig  down delete
e.g.

ifconfig em0 down delete

27 June, 2009

Static IP or DHCP Configuration on Ubuntu / Debian

How to configure Ubuntu Linux with
static or dynamic (dhcp) IP
by morphus.dk

File: /etc/network/interfaces

Static IP example:
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
address 208.88.34.106
netmask 255.255.255.248
broadcast 208.88.34.111
network 208.88.34.104
gateway 208.88.34.110

Dynamic IP (DHCP) example:

auto lo
iface lo inet loopback

auto eth0
iface eth0 inet dhcp

auto eth1
iface eth1 inet dhcp

auto eth2
iface eth2 inet dhcp

auto ath0
iface ath0 inet dhcp

auto wlan0
iface wlan0 inet dhcp
Interfaces:
  • lo: Loopback interface (network within your system without slowing down for the real ethernet based network)
  • eth0: First ethernet interface card
  • wlan0: First wireless network interface

Also see "man interfaces"