View previous topic :: View next topic |
Author |
Message |
The_Loserkid Tux's lil' helper
![Tux's lil' helper Tux's lil' helper](/images/ranks/rank_rect_1.gif)
Joined: 16 Nov 2003 Posts: 101 Location: Merksem, Belgium
|
Posted: Wed Nov 26, 2003 6:20 pm Post subject: Static IP |
|
|
in the howto they say u need to enter
Code: | # ifconfig eth0 192.168.0.1 |
for your static network ip
but when i reboot the static ip is gone ...
how can i make it stay ? |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
flanksteak n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
![](images/avatars/178001536543b8c4eb2382b.gif)
Joined: 27 May 2002 Posts: 49 Location: Seattle
|
Posted: Wed Nov 26, 2003 6:28 pm Post subject: /etc/conf.d/net |
|
|
You need to edit the file /etc/conf.d/net. Start with: Code: | iface_eth0="192.168.0.1" | and make sure you have net.eth0 in your default runlevel. There is more sample stuff in the file that you can copy to set up a gateway and routing information. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
The_Loserkid Tux's lil' helper
![Tux's lil' helper Tux's lil' helper](/images/ranks/rank_rect_1.gif)
Joined: 16 Nov 2003 Posts: 101 Location: Merksem, Belgium
|
Posted: Wed Nov 26, 2003 6:32 pm Post subject: Re: /etc/conf.d/net |
|
|
flanksteak wrote: | You need to edit the file /etc/conf.d/net. Start with: Code: | iface_eth0="192.168.0.1" | and make sure you have net.eth0 in your default runlevel. There is more sample stuff in the file that you can copy to set up a gateway and routing information. |
thx, it works ![Smile :)](images/smiles/icon_smile.gif) |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
The_Loserkid Tux's lil' helper
![Tux's lil' helper Tux's lil' helper](/images/ranks/rank_rect_1.gif)
Joined: 16 Nov 2003 Posts: 101 Location: Merksem, Belgium
|
Posted: Wed Nov 26, 2003 6:53 pm Post subject: |
|
|
well, i've done it and i've now got a static ip in my network
but i can't access the internet anymore ???
how did this happen ?
when i set iface_eth0="dhcp" again it works like a charm
i'm a complete networking noob btw, have no clue what broadcast and gateway is |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
flanksteak n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
![](images/avatars/178001536543b8c4eb2382b.gif)
Joined: 27 May 2002 Posts: 49 Location: Seattle
|
Posted: Wed Nov 26, 2003 7:13 pm Post subject: eth0 either points in or out |
|
|
How many network cards do you have in your computer?
How do you access the Internet?
Are you trying to set up an internal LAN?
eth0 can only be one thing at a time. Either it uses dhcp to talk to the Internet, or it uses 192.168.0.1 to talk to your LAN.
What exactly are you trying to do?
Broadcast is a way for one computer to send TCP/IP packets to all computers on a subnet. Router info is how you let your LAN computers talk to the Internet. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
The_Loserkid Tux's lil' helper
![Tux's lil' helper Tux's lil' helper](/images/ranks/rank_rect_1.gif)
Joined: 16 Nov 2003 Posts: 101 Location: Merksem, Belgium
|
Posted: Wed Nov 26, 2003 7:29 pm Post subject: |
|
|
i've got one computer with 2 network cards, it receives internet with one card and sends it to the linux pc with the other card
the linux pc only has one card with wich it receives internet and talks to the other computer
i want the linux pc to have the 192.168.0.1 internal network ip and i want it to be able to access the internet |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
flanksteak n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
![](images/avatars/178001536543b8c4eb2382b.gif)
Joined: 27 May 2002 Posts: 49 Location: Seattle
|
Posted: Wed Nov 26, 2003 8:17 pm Post subject: Ahhh |
|
|
The other PC with two net cards is your gateway/router. What is the IP address of the network card in the other pc that lets your linux box see the Internet? If it is a Windows box that is using Internet Connection Sharing, then it already probably uses 192.168.0.1 for the internal network card. If this is the case, you won't be able to set your linux box to use the same address. You'll have to use something different, like 192.168.0.2. I don't think there is any way to tell Windows to use a different address for this.
Why do you want the linux box to use 192.168.0.1?
Are there other computers on the LAN? |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
The_Loserkid Tux's lil' helper
![Tux's lil' helper Tux's lil' helper](/images/ranks/rank_rect_1.gif)
Joined: 16 Nov 2003 Posts: 101 Location: Merksem, Belgium
|
Posted: Wed Nov 26, 2003 8:20 pm Post subject: |
|
|
Gateway/Router with WinXp with network card manually set to: 192.168.0.1
Linux Box: 192.168.0.2
that's what i want, and it works when i do
Code: | # ifconfig eth0 192.168.0.2 |
but when i do the
Code: | iface_eth0="192.168.0.2" |
thing it gets the 192.168.0.2 ip but it can't surf the internet anymore ![Sad :(](images/smiles/icon_sad.gif) |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
Htwo n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
Joined: 28 May 2002 Posts: 38
|
Posted: Wed Nov 26, 2003 8:29 pm Post subject: |
|
|
better to make it:
Code: |
iface_eth0="192.168.0.2 broadcast 192.168.0.255 netmask 255.255.255.0"
|
also check the bottom of the config file to make sure this is there and not commented out:
Code: |
gateway="eth0/192.168.0.1"
|
|
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
flanksteak n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
![](images/avatars/178001536543b8c4eb2382b.gif)
Joined: 27 May 2002 Posts: 49 Location: Seattle
|
Posted: Wed Nov 26, 2003 8:41 pm Post subject: Try this then |
|
|
OK, here's what I'd do:
Change /etc/conf.d/net to contain:
Code: | iface_eth0="192.168.0.2 netmask 255.255.255.0"
gateway="eth0/192.168.0.1" |
Then try it. Are you using any specific routing software on XP for the LAN? I don't know if XP and Internet Connection Sharing will forward TCP/IP connections for addresses that they have not created through DHCP requests.
The other option is to switch eth0 back to DHCP and use ifconfig to see what XP is assigning to eth0 through DHCP. Then duplicate that configuration through /etc/conf.d/net.
If this doesn't work, you may just have to keep eth0 as a DCHP client of the XP box. Try reading Practically Networked for more info about XP's implementation of ICS.
Good luck. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
|