LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 06-10-2009, 07:14 AM   #1
jonaskellens
Member
 
Registered: Jul 2008
Location: Ghent, Belgium
Distribution: Fedora, CentOS
Posts: 690

Rep: Reputation: 34
IP-address assignment from WAN : problem


I have 1 IP-address that I get assigned from my ISP.

This IP is leased to a pc who is also running virtual machines.

1 of these virtual machines is an Endian firewall.

Obviously the WAN-IP is assigned to my Host-PC. How do I get this IP-address assigned to my Virtual Machine ??

I'm thinking about creating a bridge adapter that gets this IP-address assigned, and then letting my Host-PC and my Virtual Machine (Endian) make use of this bridge. Will this work ?
Can 2 hosts (host + guest) then use the same WAN-IP ??

Maybe another idea : can I forward all traffic on the physical interface to my Virtual Machine and have no network on my hostOS (at least not on this interface)?
 
Old 06-11-2009, 07:19 AM   #2
centosboy
Senior Member
 
Registered: May 2009
Location: london
Distribution: centos5
Posts: 1,137

Rep: Reputation: 116Reputation: 116
Hi.

if this helps --
Im in a similar situation.
What i do is use iptables to redirect the traffic from wan ip to virtual server

Code:
iptables  -I PREROUTING -t nat  -p tcp -d 212.69.x.x --dport 25  -j DNAT --to 192.168.x.x:25
Also, bridging can work using bridge-utils and iptables or ebtables

Last edited by centosboy; 06-11-2009 at 07:22 AM.
 
Old 06-11-2009, 07:35 AM   #3
hi-olivia
LQ Newbie
 
Registered: Jun 2009
Posts: 2

Rep: Reputation: 0
me too
 
Old 06-11-2009, 11:28 AM   #4
jonaskellens
Member
 
Registered: Jul 2008
Location: Ghent, Belgium
Distribution: Fedora, CentOS
Posts: 690

Original Poster
Rep: Reputation: 34
Quote:
Also, bridging can work using bridge-utils and iptables or ebtables
I have used bridge-utils... works very well !

Only : my bridge does not survive a reboot.

How can I create a persistent bridge ??

What I do now is :

/usr/sbin/brctl addbr bridge1
/usr/sbin/brctl addif bridge1 eth1
/sbin/ifconfig bridge1 192.168.3.11 netmask 255.255.255.0
/sbin/ifconfig bridge1 up

Code:
[root@localhost jonas]# /sbin/ifconfig
bridge1   Link encap:Ethernet  HWaddr 00:24:21:54:70:22  
          inet addr:192.168.3.11  Bcast:192.168.3.255  Mask:255.255.255.0
          inet6 addr: fe80::224:21ff:fe54:7022/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:26 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:0 (0.0 b)  TX bytes:7906 (7.7 KiB)

eth1      Link encap:Ethernet  HWaddr 00:24:21:54:70:22  
          inet addr:192.168.3.12  Bcast:192.168.3.255  Mask:255.255.255.0
          inet6 addr: fe80::224:21ff:fe54:7022/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:119 errors:0 dropped:0 overruns:0 frame:0
          TX packets:191 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:24910 (24.3 KiB)  TX bytes:17128 (16.7 KiB)
          Interrupt:233 Base address:0xa000

Can I create a ifcfg-bridge1 in /etc/sysconfig/network-scripts ??
 
Old 06-12-2009, 02:50 AM   #5
centosboy
Senior Member
 
Registered: May 2009
Location: london
Distribution: centos5
Posts: 1,137

Rep: Reputation: 116Reputation: 116
Yes...this is what you will have to do so it persists with reboots

Code:
1. service network stop
2. Create a /etc/sysconfig/networking/devices/ifcfg-bridge1 like any other device,
but with TYPE=Bridge;
3. ln /etc/sysconfig/networking/devices/ifcfg-bridge1
/etc/sysconfig/networking/profiles/default/ifcfg-bridge1
4. ln /etc/sysconfig/networking/devices/ifcfg-bridge1
/etc/sysconfig/network-scripts/ifcfg-bridge1
5. Edit ifcfg-* files for other interfaces that will participate on the bridge,
take out all address information (IPADDR, NETMASK, etc) and add BRIDGE=bridge1.
6. service network start

Last edited by centosboy; 06-12-2009 at 02:53 AM.
 
Old 06-12-2009, 04:24 AM   #6
jonaskellens
Member
 
Registered: Jul 2008
Location: Ghent, Belgium
Distribution: Fedora, CentOS
Posts: 690

Original Poster
Rep: Reputation: 34
Interfaces that use the bridge and whose ifcfg-file was edited with "BRIDGE=bridge1", can I still hang a switch to this interface to be able to connect multiple physical clients with my virtual machines ??

I now have a virtual machine that is a webserver.
The virtual network adapter uses the BRIDGE. Also my physical eth0 uses the BRIDGE (so I can talk to my webserver guest machine from my HOST). Can I connect a switch to my eth0-interface to be able to let more network-clients talk to my virtual webserver machine ??

Last edited by jonaskellens; 06-12-2009 at 04:25 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
problem telnet to WAN IP address from LAN side rich1976 Linux - Newbie 3 02-22-2009 09:12 AM
Ip address assignment in kernel modules geniuspraju Linux - Kernel 0 11-06-2006 01:58 AM
Assignment of IP-Address santosh_pn Linux - Software 4 06-16-2005 11:22 AM
IP address assignment n3tw0rk Linux - Networking 1 01-05-2004 12:23 AM
IPv6 anycast address assignment harpal Linux - Networking 0 04-27-2003 12:47 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 02:58 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration