Jump to content
satelliteuser083

Ethernet

Recommended Posts

When you installed shorewall did you use:

 

urpmi shorewall

 

If so, I've had problems before.  If you go into MCC, Security, and then Firewall, go through the GUI configuration, and make sure you choose the ethernet card.

 

I found that when I didn't do this, after rebooting I couldn't access the internet, but as soon as I stopped the shorewall service, it would start working.

 

It then turned out to be a slight configuration problem.

 

Connecting to the internet is still somewhat unreliable, mostly it works but occasionally doesn't. It's no big problem, I just have to reboot and away it goes, but a bit annoying. What was the configuration problem that you had, perhaps the solution will help me?

Share this post


Link to post
Share on other sites

The configuration problem was based on the way I installed shorewall.

 

First, at the prompt I typed "urpmi shorewall".

 

When attempting to ping afterwards, it would fail, and was easily noticeable. Yours pinged OK, so you haven't got the same problem that I had.

 

The way I solved it was going into MCC, security, selecting Firewall and running through this, and making sure the ethernet card was selected. After this, the problems went away. I believe the default install was attempting to use another device for the firewall and not the LAN, so after reconfiguring and telling it which network card, my problems went away.

 

To save on the reboot, you could easily use this command:

 

ifdown eth0 (or eth1, etc)
ifup eth0 (or eth1, etc)

 

this will reset the network card for you, and you can see if this helps, will be much quicker than a reboot. This has to be done as root, so su and supply root password before trying the ifdown/ifup.

Share this post


Link to post
Share on other sites

Thanks. I tried this as suggested - within a terminal with su and then both commands, which worked on the connection that I had previously disabled - but, when I tried to do the same in a script, it failed. This is a matter of principle, because I'm sure that I'll want to do something else like this again, so could you tell me where I'm going wrong?

 

My script first looked like this:

#!/bin/bash

su -c "ifdown eth1"

su -c "ifup eth1"

 

resulting in:

[lawrence@cpc4-clif1-6-0-cust18 ~]$ sbb

Password:

bash: ifdown: command not found

Password:

bash: ifup: command not found

 

My second attempt looks like this

#!/bin/bash

su -

ifdown eth1

ifup eth1

 

resuting in:

[lawrence@cpc4-clif1-6-0-cust18 ~]$ sbb

Password:

[root@cpc4-clif1-6-0-cust18 ~]#exit

/home/lawrence/bin/sbb: line 3: ifdown: command not found

/home/lawrence/bin/sbb: line 4: ifup: command not found

 

Where's the fatal - but probably simple - error?

Share this post


Link to post
Share on other sites

Just make the script:

 

ifdown eth1
ifup eth1
exit

 

Then in the terminal as root:

chown root:root sbb

chmod +x sbb

chmod +s sbb

 

Then the script is executable by you, but runs as root. Be careful with the +s option in chmod on scripts that take commandline arguments...they can possibly be used to breach security.

Edited by Steve Scrimpshire

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...