Warning: Function ereg() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 4

Warning: Function split() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 19

Warning: Function ereg() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 4

Warning: Function split() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 19

Warning: Function ereg() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 4

Warning: Function split() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 19

Warning: Function ereg() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 4

Warning: Function split() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 19

Warning: Function ereg() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 4

Warning: Function split() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 19
setting static IP on network with no static IP address from internet provider?
Results 1 to 5 of 5

Thread: setting static IP on network with no static IP address from internet provider?

  1. #1

    setting static IP on network with no static IP address from internet provider?

    I am connected to the internet via cable modem. I have a 4 port router plugged into the cable modem. I have 2 linux PCs connected to the the router. They are networked together and both have internet access. I would like to set static IP addresses on both linux boxes so that I do not have to change /etc/hosts when DHCP changes their IP.

    question
    Is this possible set static IPs with the network I have? My cable modem is from Cablevision Optium online and does not have a static ip. Do I need a static IP address from the cable company to set static IPs on my linux boxes.

    -------------------------
    linux box 1
    -------------------------
    computer os: centos 5.7 64-bit
    hostname: server.localdomain
    current ip eth0: 192.168.1.6 -> This changes alot, I would like to convert to static
    default gateway: 192.168.1.1

    -------------------------
    linux box 2
    -------------------------
    computer os: centos 5.7 64-bit
    hostname: laptop.localdomain
    current ip eth0: 192.168.1.4 -> This changes a lot , I would like to convert to static
    default gateway: 192.168.1.1

  2. #2
    Hello Solvetek,

    Hope this reply finds you doing well. In regard: "I would like to set static IP addresses on both linux boxes so that I do not have to change /etc/hosts when DHCP changes their IP" which flavor of Linux do you have? If you have red hat like flavors (Fedora, CentOS) you need to use directory (CentOS) /etc/sysconfig/network-scripts/ifcfg-eth?(?=number of ethernet adapter). Also you can use the network connections tools.

    Now, if you want to set a static public IP, then that's another story. You can use tools such as: http://www.whatismyip.com/ to find your public IP, but they change. If you are a business and want to get a static IP for web hosting, then you need to go to an ISP.

    I hope this is some help. Take care.

  3. #3
    Moderator
    Advisor
    redhead's Avatar
    Join Date
    Jun 2001
    Location
    Copenhagen, Denmark
    Posts
    811
    When you say, "it changes alot" how does it change, because the IP segment you're displaying is a private segment (192.168.x.y) which means it has nothing todo with your external IP, as long as your standard gateway can be reached with the subnet mask used, you should be good to just set a static IP on your linux boxes and keeping the 192.168.1.1 as the standard gateway.
    Don't worry Ma'am. We're university students, - We know what We're doing.
    'Ruiat coelum, fiat voluntas tua.'
    Datalogi - en livsstil; Intet liv, ingen stil.

  4. #4
    Associate
    Join Date
    Sep 2007
    Location
    idaho
    Posts
    16
    Doesn't yr router have an option where you can choose DHCP or static? I'm not going to interrogate my router right now to find out, but the linux OSs I've messed w/ always have the option of setting up a static IP. Right now, my laptop using Ubuntu gives me 2 wired connection options - a fixed IP I've set up for home and DHCP, for when I'm at work. Like redhead said - yr linux boxes IPs have nothing to do w/ the IP yr modem presents to yr provider.

    This is just a vague memory now, but I had IP conflicts between my router and modem, and the router rep helped me change the modem from class C to Class B. Didn't affect internet IP at all.

  5. #5
    Hello ,
    when you say "eth0: 192.168.1.6 -> This changes alot, default gateway: 192.168.1.1 ".
    I have certain assumptions here

    1.IP address assigned to the eth0 is a private segment IP (192.168.x.y) as mentioned in earlier post.This means dhcp server is running on your
    router and if you notice your default gateway ip will never change and remains to be 192.168.1.1 .(Just notice)
    2.You say it changes a lot means dhclient is running on your linux systems and your network interface is on dhcp mode.

    This concludes that :
    All you need to do is change the mode of your system to static and assign a unique static ip in the same ip range .
    Note: Do these change via configuration file so that its effects lasts after rebooting also.

    Hope this helps !!
    Manish Gupta

Similar Threads

  1. Setting static IP on LAN
    By myusername in forum Linux - General Topics
    Replies: 2
    Last Post: 05-07-2009, 07:24 AM
  2. static route
    By aliko in forum Linux - Hardware, Networking & Security
    Replies: 2
    Last Post: 05-30-2002, 01:16 PM
  3. DNS, my domain name, and static IP
    By Rastar in forum Linux - Hardware, Networking & Security
    Replies: 4
    Last Post: 01-04-2002, 12:51 PM
  4. sound static
    By agar in forum Linux - Hardware, Networking & Security
    Replies: 5
    Last Post: 12-27-2001, 08:22 PM
  5. Static and DHCP
    By Aaron_Adams in forum Linux - Hardware, Networking & Security
    Replies: 3
    Last Post: 11-13-2001, 10:57 PM

Bookmarks

Posting Permissions

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