LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 05-08-2006, 08:49 AM   #1
novis
Member
 
Registered: May 2006
Posts: 59

Rep: Reputation: 15
Iniciate automatly eth1


Hi, i have a problem with fedora core 3 and eth.
My pc have two ethernet cards, eth0 is working perfect and used for internet connexion. The other is used for intern network. The problem is that i cant initialice eth1 automatly on start up. Need to enter the orders in console to enable it. How can i do it?

Thanks.
 
Old 05-09-2006, 03:01 AM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
You can put these commands in /etc/rc.local. Mind that you must include the full path to a command, i.e: /sbin/ifconfig eth1 xx.xx.xx.xx and so on.
Or you can create a script with these commands put it in /etc/init.d/ and run "chkconfig scriptname on" to activate it on the various runlevels.

Regards
 
Old 05-09-2006, 05:46 AM   #3
novis
Member
 
Registered: May 2006
Posts: 59

Original Poster
Rep: Reputation: 15
thanks a lot, it works fine
 
Old 05-09-2006, 12:33 PM   #4
nabeelmoidu
Member
 
Registered: Jul 2005
Location: Bangalore
Distribution: Fedora
Posts: 71

Rep: Reputation: 15
you can also check the ON_BOOT=YES parameter in the interface configuration file
 
Old 05-10-2006, 01:41 AM   #5
novis
Member
 
Registered: May 2006
Posts: 59

Original Poster
Rep: Reputation: 15
Yep, i tryed this but didn't work. I checked the files /etc/sysconfig/networking/profiles/default/ifcfg-eth1 and /etc/sysconfig/network-scripts/ifcfg-eth1 including the key but didnt work.
Only if i put the commands in /etc/rc.local works.

Regards
 
Old 05-10-2006, 09:12 AM   #6
novis
Member
 
Registered: May 2006
Posts: 59

Original Poster
Rep: Reputation: 15
MMM, still not working... When I write route it shows me that the link is up, but when i try to make a ping it dont work. When i call service network restart the eth1 shows me a failure.

The comand i wrote in the file /etc/rc.local was: /sbin/ifconfig eth1 192.168.128.26 netmask 255.255.255.0

any solution?
 
Old 05-10-2006, 12:41 PM   #7
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Quote:
The comand i wrote in the file /etc/rc.local was: /sbin/ifconfig eth1 192.168.128.26 netmask 255.255.255.0
The correct should be:
Code:
/sbin/ifconfig eth1 192.168.128.26 netmask 255.255.255.0 up
You should also enable ip forwarding between the 2 nics:
Code:
echo 1 >> /proc/sys/net/ipv4/ip_forwarding
 
Old 05-11-2006, 02:00 AM   #8
novis
Member
 
Registered: May 2006
Posts: 59

Original Poster
Rep: Reputation: 15
Doesnt work yet
This is a ping
#ping 192.168.128.1
From 192.168.128.26 icmp_seq=1 Destination Host Unreachable
From 192.168.128.26 icmp_seq=2 Destination Host Unreachable
From 192.168.128.26 icmp_seq=3 Destination Host Unreachable
 
Old 05-11-2006, 02:15 AM   #9
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Sorry, but I've made a typo. The correct command for IP forwarding is:
Code:
echo 1 > /proc/sys/net/ipv4/ip_forward
Make sure that you don't have some kind of firewall that drops the packets from eth1
 
Old 05-11-2006, 02:26 AM   #10
novis
Member
 
Registered: May 2006
Posts: 59

Original Poster
Rep: Reputation: 15
Well, this is the file /etc/rc.local of the server

#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.

touch /var/lock/subsys/local

# Afegit per Tecnics DEIC #
modprobe ipt_MASQUERADE
modprobe iptable_filter

sleep 15
/sbin/ifconfig vmnet1:1 192.168.0.1 netmask 255.255.255.0
/sbin/ifconfig eth1 192.168.128.1 netmask 255.255.255.0 up
/sbin/ifconfig eth2 192.168.129.1 netmask 255.255.255.0 up
echo 1 > /proc/sys/net/ipv4/ip_forward
/sbin/iptables -t nat -A POSTROUTING -s 192.168.0.0/24 -j MASQUERADE
 
Old 05-11-2006, 02:35 AM   #11
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Quote:
/sbin/ifconfig eth1 192.168.128.1 netmask 255.255.255.0 up
What is your IP anyway? The one above or 192.168.128.26?
 
Old 05-11-2006, 02:37 AM   #12
novis
Member
 
Registered: May 2006
Posts: 59

Original Poster
Rep: Reputation: 15
there are 26 machines this is the server 1, but i'm trying comunicating the pc 1 with the 26.
There is also a VLAN, this is a reason for the eth2 with another address

Last edited by novis; 05-11-2006 at 02:39 AM.
 
Old 05-11-2006, 03:09 AM   #13
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Quote:
/sbin/iptables -t nat -A POSTROUTING -s 192.168.0.0/24 -j MASQUERADE
I'm not good in subnetting, but is n't that supposed to be
Code:
/sbin/iptables -t nat -A POSTROUTING -s 192.168.128.0/24 -j MASQUERADE
 
Old 05-11-2006, 03:18 AM   #14
novis
Member
 
Registered: May 2006
Posts: 59

Original Poster
Rep: Reputation: 15
I dont know, this was not wrote by me this command existed before i wrote anything.
 
Old 05-11-2006, 03:41 AM   #15
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
If you cannot contact the person you put that command in rc.local, I suggest you to configure your nics the way you want and then use a scipt to configure iptables according to your settings. Try quicktables which is an interactive script that lets you easily configure iptables rules.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
cannot activate eth1 using ifup or using ifcfg-eth1 akay Linux - Hardware 10 12-16-2010 05:10 AM
Can't iniciate Windows XP through boot screen spooks Fedora - Installation 6 08-24-2004 10:23 AM
Routing between eth1 and eth1:1 cli_man Linux - Networking 3 04-05-2004 11:54 AM
eth1 added, mysql connections FROM this machine are from eth1. Need bound to eth0??? kreese Linux - Networking 9 03-31-2004 12:12 PM
Kernel 2.4.22 finds eth0 and eth1 but 2.6.0 does not find eth1 coollink Linux - Networking 3 01-13-2004 07:32 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 04:08 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration