Showing posts with label network. Show all posts
Showing posts with label network. Show all posts

Monday, January 9, 2012

Configure IP address in FreeBSD

FreeBSD is a free Unix-like operating system descended from AT&T UNIX via BSD UNIX.  Although for legal reasons FreeBSD cannot be called "UNIX", as the direct descendant of BSD UNIX (many of whose original developers became FreeBSD developers), FreeBSD's internals and system APIs are UNIX-compliant.
To set using command (temporarily)

ifconfig interface inet IP
eg: ifconfig lnc0 inet 192.168.1.2

lnc0 -->  interface name which can be obtained using ifconfig -a command

To set permanently
vi /etc/rc.conf
hostname="linux4starters.com"
ifconfig_lnc0="inet 192.168.0.3 netmask 255.255.255.0"





Run /etc/netstart script.

Saturday, January 7, 2012

Configure Network Debian

Those who work in redhat flavour will find setting network in debian a bit tricky. Here is the simple and correct way of doing it.

Open the file: /etc/network/interfaces. This is the file where we can add single or muliple ips. I will show examples of how to do both and also to set via DHCP.

Setup interface to dhcp
auto eth0
iface eth0 inet dhcp

To add single IP
auto eth0
iface eth0 inet static
address 192.168.1.5
netmask 255.255.255.0
gateway 192.168.1.254

To add multiple ips
auto eth0 eth0:1 eth0:2 eth0:3 eth0:4
iface eth0 inet static
    address 74.120.246.194
        netmask 255.255.255.192
        gateway 74.120.246.193
iface eth0:1 inet static
        address 74.120.246.195
        netmask 255.255.255.192
        gateway 74.120.246.193
iface eth0:2 inet static
        address 74.120.246.196
        netmask 255.255.255.192
        gateway 74.120.246.193
iface eth0:3 inet static
        address 74.120.246.197
        netmask 255.255.255.192
        gateway 74.120.246.193
iface eth0:4 inet static
        address 74.120.246.198
        netmask 255.255.255.192
        gateway 74.120.246.193




Tuesday, September 14, 2010

Adding an IP range


Create a file named ifcfg-eth0-range0 in the /etc/sysconfig/network-scripts. Inside this file enter the following:
-----------
IPADDR_START=192.168.0.10
IPADDR_END=192.168.0.110
CLONENUM_START=0

-----------
IPADDR_START: This is the first IP from the address range you want to bind to your ethernet device.
IPADDR_END: This is, of course, the last IP from that address range.
CLONENUM_START: This is the number that will be assigned to the first IP alias interface. For instance, if your Internet interface is eth0 and CLONENUM_START is 0, then this config file will create 100 interfaces starting with eth0:0 (eth0:0, eth0:1, eth0:2 etc) and ending with eth0:100.

NOTE! Be careful if you need to add more ranges of IPs. You'll have to use a proper value for CLONENUM_START. For instance, if you need to add a second range with 100 IPs besides the one above, create a new file called ifcfg-eth0-range1 and set the CLONENUM_START to 101 so an overwrite will be avoided. Also please backup the existing files before editing this.

AFTER THIS DONT FORGET TO RESTART NETWORK
=> service network restart

Twitter Delicious Facebook Digg Stumbleupon Favorites More

 
Design by Free WordPress Themes | Bloggerized by Lasantha - Premium Blogger Themes | Affiliate Network Reviews