Results 1 to 23 of 23
  1. #1
    Join Date
    Sep 2010
    Posts
    325

    How to BIND IPs?

    I just installed Centos 5.5 64 bit and need to bind an entire C class. How do I do this? I'm so used to Cpanel / Plesk methods done via gui.

  2. #2
    Hello,
    For a small range of IPs, you can manually add each IP to a file called ifcfg-eth0:x, which resides in /etc/sysconfig/network-scripts/. For instance, if you want to add 10 IP addresses, you'll have to create 10 files in that directory, starting with ifcfg-eth0:0

  3. #3
    You can use the following steps to Bing the Multiple IPs.

    Go to the Directory cd /etc/sysconfig/network-scripts/.


    cd /etc/sysconfig/network-scripts/
    [email protected] [/etc/sysconfig/network-scripts]# ls
    ./ ifdown@ ifdown-isdn@ ifdown-tunnel* ifup-ipsec* ifup-post* ifup-wireless*
    ../ ifdown-bnep* ifdown-post* ifup@ ifup-ipv6* ifup-ppp* init.ipv6-global*
    ifcfg-lo ifdown-eth* ifdown-ppp* ifup-aliases* ifup-ipx* ifup-routes* net.hotplug*
    ifcfg-venet0 ifdown-ippp* ifdown-routes* ifup-bnep* ifup-isdn@ ifup-sit* network-functions
    ifcfg-venet0:0 ifdown-ipsec* ifdown-sit* ifup-eth* ifup-plip* ifup-sl* network-functions-ipv6
    ifcfg-venet0:1 ifdown-ipv6* ifdown-sl* ifup-ippp* ifup-plusb* ifup-tunnel* route-venet0
    [email protected] [/etc/sysconfig/network-scripts]#

    The file that we need is ifcfg-eth0, the interface for the Ethernet device. And if there exists second Ethernet device then there would be an ifcfg-eth1 file and so on for each adapter.

    If we want to bind we want to bind three additional IP's (192.168.1.101, 192.168.1.102, and 192.168.1.103) to the NIC We will need to create while ifcfg-eth0 maintains the primary IP address.

    Adapter IP Address Type
    -----------------------------------
    eth0 192.168.1.100 Primary
    eth0:0 192.168.1.101 Alias 1
    eth0:1 192.168.1.102 Alias 2
    eth0:2 192.168.1.103 Alias 3

    cp ifcfg-eth0 ifcfg-eth0:0
    cp ifcfg-eth0 ifcfg-eth0:1
    cp ifcfg-eth0 ifcfg-eth0:2

    [email protected] cp ifcfg-eth0 ifcfg:0
    [email protected] cp ifcfg-eth0 ifcfg:1
    [email protected] cp ifcfg-eth0 ifcfg:2


    [email protected] [/etc/sysconfig/network-scripts]# ifconfig
    lo Link encap:Local Loopback
    inet addr:127.0.0.1 Mask:255.0.0.0
    inet6 addr: ::1/128 Scope:Host
    UP LOOPBACK RUNNING MTU:16436 Metric:1
    RX packets:824651 errors:0 dropped:0 overruns:0 frame:0
    TX packets:824651 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:0
    RX bytes:173682430 (165.6 MiB) TX bytes:173682430 (165.6 MiB)

    venet0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
    inet addr:127.0.0.1 P-t-P:127.0.0.1 Bcast:0.0.0.0 Mask:255.255.255.255
    UP BROADCAST POINTOPOINT RUNNING NOARP MTU:1500 Metric:1
    RX packets:1798212 errors:0 dropped:0 overruns:0 frame:0
    TX packets:2647094 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:0
    RX bytes:370026705 (352.8 MiB) TX bytes:3119549917 (2.9 GiB)

    venet0:0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
    inet addr:109.203.105.210 P-t-P:109.203.105.210 Bcast:109.203.105.210 Mask:255.255.255.255
    UP BROADCAST POINTOPOINT RUNNING NOARP MTU:1500 Metric:1

    venet0:1 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
    inet addr:109.203.105.211 P-t-P:109.203.105.211 Bcast:109.203.105.211 Mask:255.255.255.255
    UP BROADCAST POINTOPOINT RUNNING NOARP MTU:1500 Metric:1


    The test can br done by pinging the IP from some other machine.


    C:\>ping 192.168.1.100

    Pinging 192.168.1.100 with 32 byte

    Reply from 192.168.1.100: bytes=32 time=131ms TTL=52
    Reply from 192.168.1.100: bytes=32 time=132ms TTL=52
    Reply from 192.168.1.100: bytes=32 time=132ms TTL=52
    Reply from 192.168.1.100: bytes=32 time=132ms TTL=52

  4. #4
    Join Date
    Sep 2010
    Posts
    325
    Isn't there a faster way, to bind a /24 C class?

  5. #5
    Join Date
    Feb 2007
    Location
    New York
    Posts
    310
    Quote Originally Posted by The Calling View Post
    Isn't there a faster way, to bind a /24 C class?
    Yes.

    IPADDR_START=192.168.0.100
    IPADDR_END=192.168.0.200
    CLONENUM_START=0

    Replace IPADDR_START and IPADDR_END values with the start and end of the range you want to add, and save this file with your favorite text editor as /etc/sysconfig/network-scripts/ifcfg-{device}-range0

    (Replace {device} with the device, eg. eth0 / venet0 / etc.)

    Then restart networking:

    service network restart

  6. #6
    hello,

    Yes exactly correct, this one is a perfect.

  7. #7
    Join Date
    Sep 2010
    Posts
    325
    Does this look right?


    IPADDR_START=xxx.xxx.254.1
    IPADDR_END=xxx.xxx.254.256
    CLONENUM_START=0

  8. #8
    Join Date
    Sep 2010
    Posts
    325
    Can't be right, won't ping

  9. #9
    Join Date
    Feb 2007
    Location
    New York
    Posts
    310
    Have you restarted networking after saving the file?

  10. #10
    Check this out if it works.

    alias eth0 3c59x
    alias eth1 tg3
    alias eth2 8139too

    Also you need to hash network modules that are loaded in /etc/rc.d/rc.modules and load them in /etc/rc.d/rc.netdevice
    # Load module for network device.
    # This script is automatically generated during the installation.

    /sbin/modprobe 3c59x
    /sbin/modprobe tg3
    /sbin/modprobe 8139too

  11. #11
    Join Date
    Sep 2010
    Posts
    325
    Quote Originally Posted by Ken-************* View Post
    Check this out if it works.

    alias eth0 3c59x
    alias eth1 tg3
    alias eth2 8139too

    Also you need to hash network modules that are loaded in /etc/rc.d/rc.modules and load them in /etc/rc.d/rc.netdevice
    # Load module for network device.
    # This script is automatically generated during the installation.

    /sbin/modprobe 3c59x
    /sbin/modprobe tg3
    /sbin/modprobe 8139too
    What is this stuff? What is 3c59x and all that code?

    I restarted the network yes.

  12. #12
    Hello,

    Before making the changes that i have done, Kindly check the restart network command. And let us know if it worked.

  13. #13
    Join Date
    Feb 2007
    Location
    New York
    Posts
    310
    Quote Originally Posted by The Calling View Post
    What is this stuff? What is 3c59x and all that code?

    I restarted the network yes.
    I seriously doubt you need to do what he said, given your issue .

    Could you paste the output of ifconfig?

    Feel free to censor parts of the IPs as you have if you wish.

  14. #14
    Join Date
    Sep 2010
    Posts
    325
    This is the output

    Code:
    [[email protected] network-scripts]# ifconfig
    eth0      Link encap:Ethernet  HWaddr 00:25:90:10:A8:6A  
              inet addr:xx.xx.96.10  Bcast:xx.xx.96.15  Mask:255.255.255.248
              inet6 addr: fe80::225:90ff:fe10:a86a/64 Scope:Link
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              RX packets:1614619 errors:0 dropped:0 overruns:0 frame:0
              TX packets:1221577 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:100 
              RX bytes:1308084707 (1.2 GiB)  TX bytes:93722601 (89.3 MiB)
              Memory:fc300000-fc320000 
    
    lo        Link encap:Local Loopback  
              inet addr:127.0.0.1  Mask:255.0.0.0
              inet6 addr: ::1/128 Scope:Host
              UP LOOPBACK RUNNING  MTU:16436  Metric:1
              RX packets:147279 errors:0 dropped:0 overruns:0 frame:0
              TX packets:147279 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:0 
              RX bytes:21759709 (20.7 MiB)  TX bytes:21759709 (20.7 MiB)
    
    venet0    Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00  
              UP BROADCAST POINTOPOINT RUNNING NOARP  MTU:1500  Metric:1
              RX packets:0 errors:0 dropped:0 overruns:0 frame:0
              TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:0 
              RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

  15. #15
    Hello,

    I shall suggest you to please mention the reports that you are getting, So that we can try and trouble shoot it and get you the perfect fix.

  16. #16
    Join Date
    Feb 2007
    Location
    New York
    Posts
    310
    Ah.

    Did you use ifcfg-eth0-range0 or ifcfg-venet0-range0?

    If you saved as ifcfg-venet0-range0, try ifcfg-eth0-range0 instead; then restart networking.

    edit:

    Also, I think you'd want the end to be 255 or 254 -- depending on your set up. 255 might not be available.

    When you issue service network restart, do you get any errors?

  17. #17
    Join Date
    Sep 2010
    Posts
    325
    I did /etc/sysconfig/network-scripts/ifcfg-etho0-range0

    I even tried this too:

    IPADDR_START=xxx.xxx.254.0
    IPADDR_END=xxx.xxx.254.256
    CLONENUM_START=0
    NETMASK=255.255.255.0

  18. #18
    Join Date
    Feb 2007
    Location
    New York
    Posts
    310
    Quote Originally Posted by The Calling View Post
    I did /etc/sysconfig/network-scripts/ifcfg-etho0-range0
    Was that a typo, or did you do ifcfg-etho0-range0? If so, change to ifcfg-eth0-range0 (the 'o' after eth needs to be removed).

    also, per my previous posts edit:

    edit:

    Also, I think you'd want the end to be 255 or 254 -- depending on your set up. 255 might not be available.

    When you issue service network restart, do you get any errors?

  19. #19
    Join Date
    Sep 2010
    Posts
    325
    Wooops, typo

    now its working.

    Thanks guys for the help

  20. #20
    Join Date
    Feb 2007
    Location
    New York
    Posts
    310
    Glad to help .

  21. #21
    Join Date
    Sep 2010
    Posts
    325
    Should it start at .2 and end at .254
    with clonenum start at 2 also?

    Code:
    [[email protected] network-scripts]# service network restart                               
    Shutting down interface eth0:                              [  OK  ]
    Shutting down interface venet0:  Shutting down interface venet0: 
                                                               [  OK  ]
    Shutting down loopback interface:                          [  OK  ]
    Disabling IPv4 packet forwarding:  net.ipv4.ip_forward = 0
                                                               [  OK  ]
    Bringing up loopback interface:                            [  OK  ]
    Bringing up interface eth0:                                [  OK  ]
    Bringing up interface venet0:  Bringing up interface venet0: 
    Configuring interface venet0: 
    net.ipv4.conf.venet0.send_redirects = 0
                                                               [  OK  ]

  22. #22
    Join Date
    Feb 2007
    Location
    New York
    Posts
    310
    You'd want to leave CLONENUM the way it is, but for IPADDR_START and IPADDR_END you'd most likely want to go .2 to .254, assuming you're on a proper VLAN - in that case, your default gateway would probably be .1 and broadcast .255, and for that reason those IPs are usually unusable.

  23. #23
    Join Date
    Sep 2010
    Posts
    325
    Ok thanks, done that.

Similar Threads

  1. Win Bind to Linux Bind transfer
    By batoo in forum Domain Names
    Replies: 0
    Last Post: 11-17-2010, 05:58 PM
  2. ips to bind
    By kteo in forum Hosting Security and Technology
    Replies: 2
    Last Post: 08-27-2008, 07:06 PM
  3. Help, i am gettin this BIND error when i try to restart bind
    By mrtaz4u in forum Hosting Security and Technology
    Replies: 8
    Last Post: 02-27-2005, 01:28 AM
  4. Bind 8 to Bind 9 Migration
    By boonchuan in forum Hosting Security and Technology
    Replies: 6
    Last Post: 04-18-2004, 10:55 AM
  5. Help! .. problem with (possibly) Apache (or Bind?).. Domains and IPs
    By Bandit_IC in forum Hosting Security and Technology
    Replies: 5
    Last Post: 06-24-2003, 06:21 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •