Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I'm setting up an old box as a dedicated file-sharing server on the LAN as well as an internet web server for my personal web site but I have no network connection. My computer is connected to a router which is connected to my DSL modem. The router has the Ubuntu box's MAC address as well as a Win7 box, which connects to the internet fine.
Here is what I've tried:
1. Check routing table
Code:
$route
Destination Gateway Genmask Flags Metric Gen Use iface
127.0.0.0 * 255.0.0.0 U 0 0 0 lo
2. Try to add a default gateway to the internet on eth2, this happens:
Code:
$sudo route add default gw 192.168.1.254 dev eth2
SIOCADDRT: No such process
3. I edited resolv.conf, which was empty, adding:
nameserver 208.67.222.222
4. I edited /etc/network/interfaces as follows:
Code:
# The primary network interface
auto eth2
iface eth2 inet dhcp
gateway 192.168.1.254
Then I type the following:
Code:
$sudo /etc/init.d/networking restart
Listening on LPF eth2/<MAC address>
Sending on LPF eth2/<MAC address>
Sending on socket/fallback
DHCPDISCOVER on eth2 to 255.255.255.255 port 67 interval 6
DHCPDISCOVER on eth2 to 255.255.255.255 port 67 interval 15
... and it keeps doing this endlessly because it's not finding the DHCP server, presumably...?
This didn't solve the problem and so I attempted another configuration:
Code:
auto eth2
iface eth2 inet static
address x.x.x.x
netmask 255.255.255.0
broadcast 192.168.0.255
gateway 192.168.1.254 (or, alternately, the address of my router, 192.168.0.1)
Still, not internet connection and no ability to apt-get anything (says packages not found)
So, this didn't work either. Can anyone help me with suggestions? I've been reading lots of articles and books so please don't tell me to read something else. What I've tried should work, especially the route command. Now why won't it work?
Thanks,
Danny3
Last edited by mbvpixies78; 01-02-2011 at 01:03 PM.
Why it's your ip address secret? Private ip addresses are not something that needs to be protected. In the interface config the broadcast address is on a different subnet to the default gateway. Which subnet is right?
Why it's your ip address secret? Private ip addresses are not something that needs to be protected. In the interface config the broadcast address is on a different subnet to the default gateway. Which subnet is right?
My bad-- my local addy is 192.168.0.101 (the win comp ends in 100 instead)
If my router is on 192.168.0.1, is the 0 subnet the correct one? As in, gateway should be 192.168.0.254 and broadcast should be 192.168.0.255?
Upon trying this in interfaces, I still get the endless DHCPDISCOVER
Last edited by mbvpixies78; 01-02-2011 at 01:08 PM.
well you really need to know for yourself what your default gateway is. It could be any IP in that subnet, but probably .1 or .254. As above, you've been using .1.254 throughout, which is clearly, at best, inconsistent with this subnet.
well you really need to know for yourself what your default gateway is. It could be any IP in that subnet, but probably .1 or .254. As above, you've been using .1.254 throughout, which is clearly, at best, inconsistent with this subnet.
My Router's routing table says it's 192.168.1.254. So does that mean my broadcast should be 192.168.1.255?
Also, I can't ping my router (192.168.0.1, which is correct because I can access it in Win7 through Firefox browser)
If there is still inconsistency here, how do I change it? Commands aren't working.
Last edited by mbvpixies78; 01-02-2011 at 01:22 PM.
How can your router be 0.1 and 1.254 at the same time?? Or are you saying that your routers own default gw is that other IP??
OK, so you have another box next to it that's working, right? Well copy those details as applicable.
I understand what you're saying. It makes little sense to me either. If I point my browser to 192.168.0.1, I get my router configuration pages, where my router also seems to have the address 192.168.1.64. On there the default gateway is listed as 192.168.1.254
Code:
Login Type: Automatic Configuration - DHCP
IP Address: 192.168.1.64
Subnet Mask: 255.255.255.0
Default Gateway: 192.168.1.254
DNS 1: 192.168.1.254
Are you suggesting I change my router to 192.168.1.1? Whatever will work is what I want to do here because a server with no internet access is pretty useless.
The settings in Win7 box are all automatic DHCP. How do I do this with Ubuntu?
Now it won't boot at all. I'm reinstalling Ubuntu Server and starting again from scratch. I want to learn the command line and get networking set up, then install xfce as a fall-back when stumped. Once it's reinstalled, I'll post all my config file contents.
Last edited by mbvpixies78; 01-02-2011 at 02:37 PM.
Well automatic is just dhcp, which would always be a safe default. I don't see how you got into this combustion in the first place. Just start with dhcp and worry about the rest later.
Never did get to grips with mbv btw. Loveless just always sounded like a really bad hangover to me.
Well automatic is just dhcp, which would always be a safe default. I don't see how you got into this combustion in the first place. Just start with dhcp and worry about the rest later.
Never did get to grips with mbv btw. Loveless just always sounded like a really bad hangover to me.
Ok, so if I set up /etc/network/interfaces like this:
Code:
auto eth0
iface eth0 inet dhcp
This by itself should in theory work?
lol re:mbv-- yeah, but sometimes life feels like a really bad hangover so maybe that's why I like the familiarity of it.
Could you post the full results of "ifconfig" & "route" on each interface on the Ubuntu server. Also post the results of "ipconfig" on the Win7 box.
Having an eth2 implies you also have eth1 & eth0.
If you have more than one interface, please indicate in more detail how your network is wired. Are you trying to set up a DMZ? Do you have more than one router? Are you connecting both the router and the server to the modem directly?
The results of "ipconfig" on the Win7 box will help in determining what your subnet is; e.g. "192.168.0.0/24". The gateway setting should be the same on both if you are on the same lan.
Nail down what your real internet IP address is. Does the modem have an embedded router? If not and you are behind NAT at the ISP, then you won't be able to host a web site because you don't have an internet IP address.
Lastly disable IPv6 support. DHCP6 could be the cause of dhcp failures. I did this do fix a problem with a Vista laptop not joining a wireless network.
Could you post the full results of "ifconfig" & "route" on each interface on the Ubuntu server. Also post the results of "ipconfig" on the Win7 box.
Having an eth2 implies you also have eth1 & eth0.
If you have more than one interface, please indicate in more detail how your network is wired. Are you trying to set up a DMZ? Do you have more than one router? Are you connecting both the router and the server to the modem directly?
The results of "ipconfig" on the Win7 box will help in determining what your subnet is; e.g. "192.168.0.0/24". The gateway setting should be the same on both if you are on the same lan.
Nail down what your real internet IP address is. Does the modem have an embedded router? If not and you are behind NAT at the ISP, then you won't be able to host a web site because you don't have an internet IP address.
Lastly disable IPv6 support. DHCP6 could be the cause of dhcp failures. I did this do fix a problem with a Vista laptop not joining a wireless network.
Js,
Basically, I have 2 computers both connected to 1 Linksys router which is then connected to a Motorolla AT&T DSL modem. I'm using eth0 on Ubuntu box and not using eth1 or eth2 at all. So no, the server isn't connected directly to internet, but router is and server connects to router, just as with Win box.
The AT&T Motorolla DSL modem doesn't appear to have routing as there are no options for such on its IP setup pages. There are a lot of settings there though, just nothing route-related that I was able to find.
Also of important note: I have a DDNS subscription with TZO in order to host my web site. My router has built-in support for TZO and it's set up and was working fine on Win7 before it crashed and the web pages disappeared.
Where should I disable IPv6 support? Modem, router, Ubuntu, Win7, all of the above?
I'm having to write all this down and then type it here, so if I mis(spell) anything, just ask. I'm using a KVM switch between a Win7 and the Ubuntu server. That said, ask and ye shall receive, transcribed:
ifconfig:
Code:
eth0 Link encap ethernet
HW ADDR......
Up broadcast running multicast MTU:1500
metric 1
Rx all 0
Tx all 0
txqueuelen: 1000
Interrupt 17
lo Link encap: local loopback
inetaddr: 127.0.0.1
mask 255.255.255.255
Up Loopback running
MTU: 16436 Metric 1
Rx 184 Tx 184
txque: 0
Rx bytes == Tx bytes
When I enter route I get a completely empty routing table-- it just shows column labels and nothing beneath.
Win7 ipconfig (yay! I can copy and paste this one! Screw stenography)
Disable IPv6 on the Ubuntu computer. On Ubuntu you are using the 192.168.1.0/24 network, while on Windows you are using 192.168.0.0/24. I looks like you manually configured Ubuntu for the wrong network address.
The address you gave for your internet address isn't one that someone on the internet can reach. Go to a site like "www.myip.dk" to find out what your real internet address is. Either the modem has a built in router translating your IP address, or your ISP has you behind NAT and you may be sharing this IP address with other users. If you can open port 80 on your router and someone on the internet can reach it, the former is true.
Not all routers function as a DNS relay. You may need to enter your ISPs name server addresses in that case.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.