Page 1 of 2 12 LastLast
Results 1 to 10 of 18

Thread: [SOLVED] eth0, eth1

  1. #1
    Join Date
    Dec 2008
    Location
    Utopia
    Beans
    Hidden!
    Distro
    Ubuntu 8.04 Hardy Heron

    Exclamation [SOLVED] eth0, eth1

    I have, i think, a small problem. I have 2 network interfaces in my machine,eth0 and eth1. I want to make eth1 outgoing so i can link another pc to that one so it can go on the internet. This is a windows-machine. From that machine it is a piece of cake to do that stunt. So you can say problem solved! But no! The windows machine is my son's and he is here 2 weekends per month, so when he is not around the 2 machines have to be up and running. That in order to have internet on my Linux-machine. I have tried allmost anything i could find on the internet but nothing seems to work. The only thing that happend, no internet at all and had to change the config-files again. So can somebody help me!My machine runs Ubuntu 8.04

  2. #2
    Join Date
    Jun 2007
    Beans
    Hidden!

    Re: eth0, eth1

    You want to use one of the machines as the internet gateway, right?

    You can use either windows or linux; you already have the windows side covered.

    linux side:

    You need to configure forwarding on the linux box.

    Code:
    echo "1" > /proc/sys/net/ipv4/ipv4_forward
    This will only work for the specific session. To make the change permanent:

    Code:
    cp /etc/sysctl.conf /etc/sysctl.conf-backup
    Open /etc/sysctl.conf and look for net.ipv4_forward directive.
    Change it from net.ipv4_forward=0 to net.ipv4_forward=1.

    Save and close. Now either reboot or run:

    Code:
    sysctl -p
    Now you have forwarding enabled. If you also use a firewall, you'll have to setup forwarding in the firewall rules too. On the windows machine, you'll have to setup the linux box IP to be the default gateway and the dns.

    Dedoimedo

  3. #3
    Join Date
    Dec 2008
    Location
    Utopia
    Beans
    Hidden!
    Distro
    Ubuntu 8.04 Hardy Heron

    Re: eth0, eth1

    wel it does not work, i'll show you what the terminal displays:



    jouke@ubuntu:~$ echo "1" > /proc/sys/net/ipv4/ipv4_forward
    bash: /proc/sys/net/ipv4/ipv4_forward: No such file or directory
    jouke@ubuntu:~$ sudo gedit /etc/sysctl.conf
    [sudo] password for jouke:
    jouke@ubuntu:~$ sysctl -p
    error: permission denied on key 'kernel.printk'
    error: permission denied on key 'kernel.maps_protect'
    error: permission denied on key 'fs.inotify.max_user_watches'
    error: permission denied on key 'vm.mmap_min_addr'
    error: permission denied on key 'net.ipv4.conf.default.rp_filter'
    error: permission denied on key 'net.ipv4.conf.all.rp_filter'
    error: permission denied on key 'net.ipv4.ip_forward'

  4. #4
    Join Date
    Dec 2008
    Location
    Utopia
    Beans
    Hidden!
    Distro
    Ubuntu 8.04 Hardy Heron

    Re: eth0, eth1

    when i put ifconfig in the terminal it does not show the eth1

    jouke@ubuntu:~$ ifconfig
    eth0 Link encap:Ethernet HWaddr 00:18:f3:ea:99:e7
    inet addr:82.75.152.173 Bcast:255.255.255.255 Mask:255.255.254.0
    inet6 addr: fe80::218:f3ff:feea:99e7/64 Scope:Link
    UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
    RX packets:10452 errors:0 dropped:0 overruns:0 frame:0
    TX packets:3218 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:1000
    RX bytes:4867796 (4.6 MB) TX bytes:436816 (426.5 KB)
    Interrupt:17 Base address:0x6000

    lo Link encap:Local Loopback
    inet addr:127.0.0.1 Mask:255.0.0.0
    inet6 addr: ::1/128 Scope:Host
    UP LOOPBACK RUNNING MTU:16436 Metric:1
    RX packets:1990 errors:0 dropped:0 overruns:0 frame:0
    TX packets:1990 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:0
    RX bytes:99500 (97.1 KB) TX bytes:99500 (97.1 KB)
    so where is eth1 I put auto eth1 in the same file where it says auto eth0 and lo and loopback etc. etc.

  5. #5
    Join Date
    Apr 2007
    Beans
    112

    Re: eth0, eth1

    Looks like you tried to run the commands without being root. I dunno how to fix the problem on the NIC looks like the previous poster knows what they are talki ng about so I would try runnning the same commands as root, with sudo infront of each line posted

  6. #6
    Join Date
    Dec 2008
    Location
    Utopia
    Beans
    Hidden!
    Distro
    Ubuntu 8.04 Hardy Heron

    Re: eth0, eth1

    Thanks guys! Tried it again now as root but no succes!

  7. #7
    Join Date
    Jun 2007
    Beans
    Hidden!

    Re: eth0, eth1

    Hello,

    OK, so you enabled forwarding ... sorry for the sudo thingie, forgot to mention, considered it obvious :0

    Now, did you configure the windows client?

    Next, print the ifconfig info ... if eth1 does not show, it means it's not up.

    You'll need to the following:

    1) Decide if you want to use static or dynamic ip addresses. I recommend static, because then your linux box won't have to act as a dhcp server, too.

    2) Setup eth1 on linux and then setup windows accordingly.

    Use ips that you want and find adequate.

    Code:
    ifconfig eth1 192.168.1.100 netmask 255.255.255.0 up
    Next, let's check that it's up with ifconfig and then that it uses the default gateway:

    Code:
    route -n
    Post the info for route command here. Let's make sure that eth1 uses eth0 as the default gateway. If not, we'll change that.

    Next, setup windows to use 192.168.1.101 or any other ip on the same subnet (192.168.1.1-192.168.1.254), exclude the first and the last ips as they are used by the system as network id and broadcast.

    Setup windows to use 192.168.1.100 (linux ip) as dns.

    See if this works now.

    NOTE: the changes we did for route and eth1 are temporary until next reboot or next network restart, but we do this to test the setup. Once we're sure it works, we'll commit the changes to the configuration files.

    Network configurations are stored in /etc/interfaces. Backup this file before making any changes. Furthermore, search the forums a little for how to configure the network device permanently and change the route permanently.

    If during any of the stages you get confused, simply restart the network and start over:

    Code:
    sudo /etc/init.d/networking restart
    Dedoimedo

  8. #8
    Join Date
    Dec 2008
    Location
    Utopia
    Beans
    Hidden!
    Distro
    Ubuntu 8.04 Hardy Heron

    Re: eth0, eth1

    Well long story!

    jouke@ubuntu:~$ sudo ifconfig eth1 192.168.1.100 netmask 255.255.255.0 up
    SIOCSIFADDR: No such device
    eth1: ERROR while getting interface flags: No such device
    SIOCSIFNETMASK: No such device
    eth1: ERROR while getting interface flags: No such device
    jouke@ubuntu:~$ sudo /etc/init.d/networking restart
    * Reconfiguring network interfaces... Ignoring unknown interface eth0=eth0.
    Ignoring unknown interface eth1=eth1.
    [ OK ]
    jouke@ubuntu:~$ sudo ifconfig eth1 192.168.1.100 netmask 255.255.255.0 up
    SIOCSIFADDR: No such device
    eth1: ERROR while getting interface flags: No such device
    SIOCSIFNETMASK: No such device
    eth1: ERROR while getting interface flags: No such device
    jouke@ubuntu:~$ ifconfig
    eth0 Link encap:Ethernet HWaddr 00:18:f3:ea:99:e7
    inet addr:82.75.152.173 Bcast:255.255.255.255 Mask:255.255.254.0
    inet6 addr: fe80::218:f3ff:feea:99e7/64 Scope:Link
    UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
    RX packets:22905 errors:0 dropped:0 overruns:0 frame:0
    TX packets:3382 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:1000
    RX bytes:6932810 (6.6 MB) TX bytes:506992 (495.1 KB)
    Interrupt:20 Base address:0x4000

    lo Link encap:Local Loopback
    inet addr:127.0.0.1 Mask:255.0.0.0
    inet6 addr: ::1/128 Scope:Host
    UP LOOPBACK RUNNING MTU:16436 Metric:1
    RX packets:1908 errors:0 dropped:0 overruns:0 frame:0
    TX packets:1908 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:0
    RX bytes:80136 (78.2 KB) TX bytes:80136 (78.2 KB)

  9. #9
    Join Date
    Jun 2007
    Beans
    Hidden!

    Re: eth0, eth1

    Hmmm, what does ifconfig -a give you ...
    Dedoimedo

  10. #10
    Join Date
    Dec 2008
    Location
    Utopia
    Beans
    Hidden!
    Distro
    Ubuntu 8.04 Hardy Heron

    Re: eth0, eth1

    jouke@ubuntu:~$ ifconfig -a
    eth0 Link encap:Ethernet HWaddr 00:18:f3:ea:99:e7
    inet addr:82.75.152.173 Bcast:255.255.255.255 Mask:255.255.254.0
    inet6 addr: fe80::218:f3ff:feea:99e7/64 Scope:Link
    UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
    RX packets:31815 errors:0 dropped:0 overruns:0 frame:0
    TX packets:1767 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:1000
    RX bytes:3866880 (3.6 MB) TX bytes:341277 (333.2 KB)
    Interrupt:20

    lo Link encap:Local Loopback
    inet addr:127.0.0.1 Mask:255.0.0.0
    inet6 addr: ::1/128 Scope:Host
    UP LOOPBACK RUNNING MTU:16436 Metric:1
    RX packets:2088 errors:0 dropped:0 overruns:0 frame:0
    TX packets:2088 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:0
    RX bytes:87696 (85.6 KB) TX bytes:87696 (85.6 KB)

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •