STATIC IP setup now working on reboot!

Discussion in general that pertains to Sabayon Linux - Must Pertain to Sabayon Linux

Moderator: Moderators

STATIC IP setup now working on reboot!

Postby javabiz » Thu Oct 05, 2006 0:54

If I use network-setup I can manually enter in the ip, sm, bc and dns to get on the internet during my current login. The minute I reboot I lose the connection even though I can see the ip, bc, and sm in the /etc/conf.d/net (file).

1. How can I make this stick at bootup?
2. Is there an easier way? I know Mepis 6 and Kubuntu have network setups that start at boot.
3. Do I have to manually enter all info in like the /etc/host /etc/conf.d/net and a couple of other places for the the gateway and dns?

I am tempted to leave Sabayon on my 64bit computer if I can solve this problem.
There was one other problem with a Broadcom driver missing from the 64 bit OS when I was synching with Kuroo.
Last edited by javabiz on Sat Oct 07, 2006 0:13, edited 2 times in total.
javabiz
Young Hen
 
Posts: 26
Joined: Sat Nov 12, 2005 4:52

Postby cvill64 » Thu Oct 05, 2006 4:13

umm...follow the tutorial and it will actually work ;)
cvill64
Sagely Hen
 
Posts: 2185
Joined: Fri Dec 30, 2005 10:03
Location: Virginia, USA

Postby javabiz » Thu Oct 05, 2006 15:16

The Tutorial says:
And then you may set your static IP to whichever way you'd like to. Easiest way would be that the user just edit /etc/conf.d/net according to the example file /etc/conf.d/net.example

If I used
#net-setup
from the command line and filled in all the blanks--it creates
/etc/conf.d/net which doesn't seem to do anything when I reboot. Also the gateway and dns address are missing in this file. Is there a gui network setup that I'm missing somewhere.? I don't see any gui network setup in Gnome or Kde. As I mentioned, net-setup does let me gain access to the network in my current session--but loses it when I reboot. :(
Last edited by javabiz on Sat Oct 07, 2006 0:28, edited 7 times in total.
javabiz
Young Hen
 
Posts: 26
Joined: Sat Nov 12, 2005 4:52

Postby cvill64 » Thu Oct 05, 2006 20:32

we can't do anything w/o seeing your file that was modified

split from howto
cvill64
Sagely Hen
 
Posts: 2185
Joined: Fri Dec 30, 2005 10:03
Location: Virginia, USA

Here's what I'm trying to do...

Postby javabiz » Fri Oct 06, 2006 0:24

I'm trying to use the following:
ip xxx.xxx.xxx.xx
gw xxx.xxx.xxx.xx
sm 255.255.255.224
bc xxx.xxx.xxx.95
dns xxx.xxx.x.xx
and a domain.
#net-setup
let's me enter this and gives me the network and it also replaces the current /etc/conf.d/net
file.
If my dns is in /etc/resolv.conf
and my hostname is in /etc/conf.d/hostname
then what do I have to do to keep this info at boot.
It looks to me like it is using dhcp by default even though I ran the lines up in the howto portion.
If I do a
#ifconfig
after boot it gives me none of the above settings
after I run
#net-setup
it gives me ip, sm, bc and all works fine till I reboot.

The stock net.example file looks like it is all commented out. If I'm trying to do the above static
assignments to eth0---what do I uncomment and do I have to select between ifconfig or iproute2?
Thanks for any help I'm trying my best to keep Sabayon Linux on this hardware.
javabiz
Young Hen
 
Posts: 26
Joined: Sat Nov 12, 2005 4:52

This might be helpful for the static ip tutorial

Postby javabiz » Fri Oct 06, 2006 20:00

Taking it from the beginning--with the help of cvill64 tutorial--here's what I did!
I followed cvill64's tutorial on getting rid of the network manager.
From cvill64

HOWTO: Static IP
Okay, so we use NetworkManger to handle the eth on the live mode as it is extremely versitile and beautiful. But some of you need static IP support and for some reason NM isn't giving it. So the solution is just to follow this little code snipet
Code:
# rc-update del NetworkManager
# rc-update del dhcdbd
# emerge -C knetworkmanager
# sed -i 's/RC_PLUG_SERVICES=".*"/RC_PLUG_SERVICES=""/' /etc/conf.d/rc
# reboot

After following cvill64 steps above I
1. ran
#net-setup
from the console and filled in all the static info (this evidently helps with the dns and domain in the
/etc/resolv.conf file but more importantly--it gives IMMEDIATE access to the internet)!

2. then (to have it automatically boot) I deleted /etc/conf.d/net
copied net.example to net
3. nano net
and changed only the following lines (I uncommented them)
modules = ( "ifconfig")
and the uncommented lines below that where it mentions
config_eth0
routes_eth0 (this line was not there originally and I added it directly below config_eth0)
and added my static ip, netmask and broadcast where there are X's
and gateway (routes_eth0) below that.

4. After your done run
#ifconfig (to see what eth0 shows)
#/etc/init.d/net.eth0 stop (to stop the service)
#/etc/init.d/net.eth0 start (to reinit) or restart
now
#ifconfig
again and you should see your ip, nm and bc
if the internet isn't up check /etc/resolv.conf
should be something like
nameserver xxx.xxx.xxx.xxx
search state.ca.us co.santaclara.ca.us

IMPORTANT! The net file is a very large file taking into account all kinds of interfaces between wireless and static. The below rendition is a very limited edition showing only what you need to know--you will have to find the parts I changed in the bloated edition!

Hope this helps
and cudos to Lxnay and others like cvill64 for an AWESOME PRODUCTION!!!!! :lol:
##############################################################################
# QUICK-START
#
# The quickest start is if you want to use DHCP.
# In that case, everything should work out of the box, no configuration
# necessary, though the startup script will warn you that you haven't
# specified anything.

#
# WARNING :- some examples have a mixture of IPv4 (ie 192.168.0.1) and IPv6
# (ie 4321:0:1:2:3:4:567:89ab) internet addresses. They only work if you have
# the relevant kernel option enabled. So if you don't have an IPv6 enabled
# kernel then remove the IPv6 address from your config.
#

#
# If you want to use a static address or use DHCP explicitly, jump
# down to the section labelled INTERFACE HANDLERS.
#
# If you want to do anything more fancy, you should take the time to
# read through the rest of this file.

##############################################################################
# MODULES
#
# We now support modular networking scripts which means we can easily
# add support for new interface types and modules while keeping
# compatability with existing ones.
#
# Modules load by default if the package they need is installed. If
# you specify a module here that doesn't have it's package installed
# then you get an error stating which package you need to install.
# Ideally, you only use the modules setting when you have two or more
# packages installed that supply the same service.
#
# In other words, you probably should DO NOTHING HERE...

# Prefer ifconfig over iproute2
#modules=( "ifconfig" )

# You can also specify other modules for an interface
# In this case we prefer udhcpc over dhcpcd
#modules_eth0=( "udhcpc" )

# You can also specify which modules not to use - for example you may be
# using a supplicant or linux-wlan-ng to control wireless configuration but
# you still want to configure network settings per ESSID associated with.
#modules=( "!iwconfig" "!wpa_supplicant" )
# IMPORTANT: If you need the above, please disable modules in that order


##############################################################################
# INTERFACE HANDLERS
#
# We provide two interface handlers presently: ifconfig and iproute2.
# You need one of these to do any kind of network configuration.
# For ifconfig support, emerge sys-apps/net-tools
# For iproute2 support, emerge sys-apps/iproute2

# If you don't specify an interface then we prefer iproute2 if it's installed
# To prefer ifconfig over iproute2
modules=( "ifconfig" )

# For a static configuration, use something like this
# (They all do exactly the same thing btw)
#config_eth0=( "192.168.0.2/24" )
#config_eth0=( "192.168.0.2 netmask 255.255.255.0" )

# We can also specify a broadcast
#config_eth0=( "192.168.0.2/24 brd 192.168.0.255" )
config_eth0=( "xxx.xxx.xxx.xxx netmask xxx.xxx.xxx.xxx broadcast xxx.xxx.xxx.xxx" )
routes_eth0=( "default gw xxx.xxx.xxx.xxx" )

#-----------------------------------------------------------------------------
# System
# For configuring system specifics such as domain, dns, ntp and nis servers
# It's rare that you would need todo this, but you can anyway.
# This is most benefit to wireless users who don't use DHCP so they can change
# their configs based on ESSID. See wireless.example for more details

# To use dns settings such as these, dns_servers_eth0 must be set!
# If you omit the _eth0 suffix, then it applies to all interfaces unless
# overridden by the interface suffix.
#dns_domain_eth0="your.domain.here"
#dns_servers_eth0="xxx.xxx.xxx.xxx"
#dns_search_eth0="state.ca.us co.santaclara.ca.us"
#dns_options_eth0=( "timeout 1" "rotate" )
#dns_sortlist_eth0="130.155.160.0/255.255.240.0 130.155.0.0"
# See the man page for resolv.conf for details about the options and sortlist
# directives

#ntp_servers_eth0="192.168.0.2 192.168.0.3"

#nis_domain_eth0="domain"
#nis_servers_eth0="192.168.0.2 192.168.0.3"

#-----------------------------------------------------------------------------
Last edited by javabiz on Sat Oct 07, 2006 0:22, edited 1 time in total.
javabiz
Young Hen
 
Posts: 26
Joined: Sat Nov 12, 2005 4:52

Postby cvill64 » Sat Oct 07, 2006 5:57

looks good to me, added to the tutorial

nice job javabiz
cvill64
Sagely Hen
 
Posts: 2185
Joined: Fri Dec 30, 2005 10:03
Location: Virginia, USA

Here is what mine looks like

Postby ArcherBM » Tue Nov 07, 2006 14:42

After I removed all the extra stuff that is commented out anyway, here is what my net file looks like:

Code: Select all
modules=( "ifconfig" )

config_eth0=( "192.168.1.5 netmask 255.255.255.0 broadcast 192.168.1.255" )
routes_eth0=( "default gw 192.168.1.1" )


dns_servers_eth0="192.168.1.1"


Of course, change your IP's to match whatever you want your IP's to be.

That should be all you need.
ArcherBM
Young Hen
 
Posts: 26
Joined: Tue Oct 03, 2006 16:12


Return to Sabayon Linux General Discussion

Who is online

Users browsing this forum: No registered users and 2 guests