Usuários Online no momento: 466 - entrar  » Pesquisar  » Índice do Fórum  

Static IP

beowulf62381
wrote 2 years ago


reply
Has any one set a static IP on slax?
I am setting it up as a smb/ssh/vpn server and would like to have a static ip for it.

on a side note Has any one had luck with runing a vpn client for Relakks with this slax 6. I can't seem to make a connection last more that 8-15min, the only work around is to have it redial very fast when it does fail. I have heard Relakks is unrelyable but but it seems to stay up for a few days atleast on my xp box but again only 8-15min on vista.
 
leetux
wrote 2 years ago


reply
K Menu > Internet > Set IP adress (network.conf).
 
warez
wrote 2 years ago


reply
edit /etc/rc.d/rc.inet1
Remove the DHCP requests and add your commands to setup IP.
After that ip will be set automaticly on reboot (if changes are used)
 
beowulf62381
wrote 2 years ago


reply
Thanks I will try that. Btw has any one gotten nxserver working on slax? I made a .lzm that has the Debian adduser and its dependences and am able to get the install to work via nxserver --install debian with no problems provided the Debian add user is in place but i keep getting rejected when trying to connect on port 22 even though i can ssh on port 22 with out any problems. I have the same problem on my ubuntu box as well. my hope what is could could get it to install i could just copy the files the installer changed into a .lzm and remove the adduser.lzm since it seems to only be used by the nx install script to make the changes. Oh and the nxserver, nxnode services are running with out issue i can start and stop them with no error.
 
gingerkatze
wrote 2 years ago


reply
I edit the /etc/rc.d/rc.init1 for static IP, but when i reboot it start always in DHCP. What can i do.
Sorry for my english.

rc.init1.conf:
#information for eth0:

IFNAME[0]="eth0"
IPADDR[0]="192.100.166.66"
NETMASK[0]="255.255.255.0"
#USE_DHCP[0]=""
#DHCP_HOSTNAME[0]=""

# Default gateway IP address:
GATEWAY="192.100.166.254"

resolf.conf:
nameserver 192.100.166.254
 
captfed
wrote 2 years ago


reply
hi edit etc/rc.d/rc.local

and add the following lines

killall dhcpcd
ifconfig eth0 192.---- netmask 255.---- up
route add default gateway 192.----


this should make yr ip static

hope it helps
 
beowulf62381
wrote 2 years ago


reply
gingerkatze did you edit /etc/rc.d/rc.inet1 or /etc/rc.d/rc.inet.conf

I was unable to get rc.inet.conf to have any change on my system i think because it is modified from it original Slackware form and has code at the bottom that will set IP via DHCP for eth*

Replace /etc/rc.d/rc.inet1

with this and you should be able to set the static IP

HOSTNAME=`cat /etc/HOSTNAME`

# Attach the loopback device.
/sbin/ifconfig lo 127.0.0.1
/sbin/route add -net 127.0.0.0 netmask 255.0.0.0 lo

# IF YOU HAVE AN ETHERNET CONNECTION, use these lines below to configure the
# eth0 interface.

# Edit these values to set up a static IP address:
IPADDR="192.168.1.244" # REPLACE with YOUR IP address!
NETMASK="255.255.255.0" # REPLACE with YOUR netmask!
NETWORK="192.168.1.0" # REPLACE with YOUR network address!
BROADCAST="192.168.1.255" # REPLACE with YOUR broadcast address, if you
# have one. If not, leave blank and edit below.
GATEWAY="192.168.1.1" # REPLACE with YOUR gateway address!

# To use DHCP instead of a static IP, set this value to "yes":
DHCP="no" # Use DHCP ("yes" or "no")

# OK, time to set up the interface:
if [ "$DHCP" = "yes" ]; then # use DHCP to set everything up:
echo "Attempting to configure eth0 by contacting a DHCP server..."
/sbin/dhcpcd
elif [ ! "$IPADDR" = "127.0.0.1" ]; then # set up IP statically:
# Set up the ethernet card:
echo "Configuring eth0 as ${IPADDR}..."
/sbin/ifconfig eth0 ${IPADDR} broadcast ${BROADCAST} netmask ${NETMASK}

# If that didn't succeed, give the system administrator some hints:
if [ ! $? = 0 ]; then
cat
 
gingerkatze
wrote 2 years ago


reply
Thank you, that was it. I always edit the rc.init1.conf (conf like config). "First look than try and then ask". After I delete some lines from the script it worked perfect. So I know in the future what I have to edit.
 
nikitron
wrote 2 years ago


reply
tell us.
Show your result!!!!
 
gingerkatze
wrote 2 years ago


reply
Hello nikitron, this is the script. I have to deactivate some lines and than it worked. Now have only one small problem. When I'am boot from an other computer, eth0 will be change in eth1. So I have to modified the 70-persistent-net.rules. When I'am only boot from the them Computer it works always with eth0. Sorry for my bad english.

HOSTNAME=`cat /etc/HOSTNAME`

# Attach the loopback device.
/sbin/ifconfig lo 127.0.0.1
/sbin/route add -net 127.0.0.0 netmask 255.0.0.0 lo

# IF YOU HAVE AN ETHERNET CONNECTION, use these lines below to configure the
# eth0 interface.

# Edit these values to set up a static IP address:
IPADDR="192.100.168.64" # REPLACE with YOUR IP address!
NETMASK="255.255.255.0" # REPLACE with YOUR netmask!
GATEWAY="192.100.168.254" # REPLACE with YOUR gateway address!
NETWORK="192.100.168.0" # REPLACE with YOUR network address!
BROADCAST="192.100.168.255" # REPLACE with YOUR broadcast address, if you
# have one. If not, leave blank and edit below.
#GATEWAY="" # REPLACE with YOUR gateway address!

# To use DHCP instead of a static IP, set this value to "yes":
DHCP="no" # Use DHCP ("yes" or "no")

# OK, time to set up the interface:
#if [ "$DHCP" = "yes" ]; then # use DHCP to set everything up:
#echo "Attempting to configure eth0 by contacting a DHCP server..."
#/sbin/dhcpcd
#elif [ ! "$IPADDR" = "127.0.0.1" ]; then # set up IP statically:
# Set up the ethernet card:
echo "Configuring eth0 as ${IPADDR}..."
/sbin/ifconfig eth0 ${IPADDR} broadcast ${BROADCAST} netmask ${NETMASK}
/sbin/route add default gw 192.100.168.254

# If that didn't succeed, give the system administrator some hints:
#if [ ! $? = 0 ]; then
#cat
#
 
nikitron
wrote 2 years ago


reply
thank you!
 
Jolly
wrote 1 year ago


reply
I use Slax 6.0.7 on a USB flash drive and i have the same problem: my static IP was not save after reboot (eth0). I use slax for first time. I don't understand nothing of this. How can I set this up? My rc.inet1.conf file look like this:

# Config information for eth0:
IPADDR[0]=""
NETMASK[0]=""
USE_DHCP[0]=""
DHCP_HOSTNAME[0]=""

# Config information for eth1:
IPADDR[1]=""
NETMASK[1]=""
USE_DHCP[1]=""
DHCP_HOSTNAME[1]=""

# Config information for eth2:
IPADDR[2]=""
NETMASK[2]=""
USE_DHCP[2]=""
DHCP_HOSTNAME[2]=""

# Config information for eth3:
IPADDR[3]=""
NETMASK[3]=""
USE_DHCP[3]=""
DHCP_HOSTNAME[3]=""

# Default gateway IP address:
GATEWAY=""


thanx
 
jolly
wrote 1 year ago


reply
try to edit with my IP, Netmask, gateway, I mark with "NO" the USE_DHCP[0] field . . . nothing . . . after reboot the network don't work . . .
 
markds
wrote 1 year ago


reply
Theres an Free NX module I made, you can search for the link in the forum, although users have reported some issues about the keyboard freezing, especially if you've changed your keyboard layout.

As for the fixed IP, the Slax version of rc.inet1 is different from the regular rc.inet1 and doesn't read your rc.inet1.conf, thats why nothing happens. If memory serves, I think posted the regular Slackware rc.inet1 also in the forum. If you can search for it and replace the Slax version with it (make a module with the Slackware rc.inet1 and the rc.inet1.conf with your settings in it), then you shouldn't have a problem with fixed setting ips.
 

Post your reply

Your name (Login):

Message:

These HTML tags are allowed: <quote>, <b>, <u>, <i>, <pre>, <code>, <small>, <h1>, <h2>, <h3>, <li>



Visit Tomas M's blog for fun, mostly on religious idiocy.