Join us now. It is free, and it takes less than 1 minute to register.
Register now
Subscribe to our daily newsletter. It is free, and it comes with many benefits.


+ Reply to Thread
Results 1 to 5 of 5

Thread: Internet Connection Sharing in ubuntu

  1. #1

    Default Internet Connection Sharing in ubuntu

    Hi Guys
    I've having trouble setting up an ICS with my other computer.
    I've followed the instructions @ https://help.ubuntu.com/community/In...nectionSharing but still no luck.
    I'm using /etc/network/interface to handle my connection so i used the Ubuntu Internet Gateway Method (iptables)
    wlan0 is directly connected to the internet and i would like eth0 to be the wired shared connection.
    So following the guide: * subnet is 192.168.1.x

    Configure your internal network card (eth0) for static IP like so:
    1) sudo ip addr add 192.168.1.1/24 dev wlan0

    Configure NAT
    2)sudo iptables -A FORWARD -o wlan0 -i eth0 -s 192.168.1.0/24 -m conntrack --ctstate NEW -j ACCEPT
    sudo iptables -A FORWARD -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT
    sudo iptables -A POSTROUTING -t nat -j MASQUERADE

    Save iptables rules
    3)sudo iptables-save | sudo tee /etc/iptables.sav

    Modify /etc/rc.local file
    4)iptables-restore < /etc/iptables.sav

    configure routing between two interfaces
    5)sudo sh -c "echo 1 > /proc/sys/net/ipv4/ip_forward"

    edit /etc/sysctl.conf
    6)net.ipv4.conf.default.forwarding=1
    net.ipv4.conf.all.forwarding=1


    Client Setup *do i input these steps into the client machine or host??
    1)sudo /etc/init.d/networking stop
    2)sudo ip addr add 192.168.1.100/24 dev wlan0
    3)sudo ip route add default via 192.168.1.1

    So i followed these steps, but since i'm using /etc/network/interfaces what shoud i put in that file for eth0?
    auto eth0
    iface eth0 inet static
    address ??
    netmask 255.255.255.0

    do i need to add any more??

  2. #2
    Super Grandmaster ponder's Avatar
    Join Date
    Jan 2005
    Location
    Niflheimr
    Posts
    66,345

    Default

    You can not have two interfaces in the same network/subnet, just keep that in mind.

    What are the addresses configured on your interfaces?
    entia non sunt multiplicanda praeter necessitatem

  3. #3

    Default

    wlan0 is configured on 192.168.1.xxx on a dhcp.
    I've not configured eth0 as i am not sure what to put in
    about the two interface not on the same network/subnet if wlan0 is on 192.168.1.x should eth0 be on 192.1168.0.xx or what

  4. #4
    Super Grandmaster ponder's Avatar
    Join Date
    Jan 2005
    Location
    Niflheimr
    Posts
    66,345

    Default

    Quote Originally Posted by etherion View Post
    about the two interface not on the same network/subnet if wlan0 is on 192.168.1.x should eth0 be on 192.168.0.xx or what
    yes.
    entia non sunt multiplicanda praeter necessitatem

  5. #5

    Default

    ok, so i've followed the instructiions again
    Host=wlan0 is on 192.168.1.x
    client eth0 is on 192.168.0.x

    so for the host will the /etc/network/interface file look like this
    auto eth0
    iface eth0 inet static
    address 192.168.0.xx
    netmask 255.255.255.0
    gateway 192.168.0.1

    then for the client machine will the interface file look the same?

+ Reply to Thread

Bookmarks

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
  •